I have posted this question on StackOverflow as well (https://stackoverflow.com/questions/62158608/how-to-create-a-negative-test-case-in-github). I’m trying to figure out how to test a negative path with a workflow. I have created a simple test for a mathematical function in a shell script. The idea is to test if it computes f(x,y)=y-x. To do that there are three parameters, x, y, and the expected answer. I want to include tests for negative cases. In other words if the script does not perform as expected or experiences some error, that should cause a failure. What makes this difficult is that:
A) If the negative test fails it is doing what it should and it should be marked as a Pass.
B) If the negative test passes it is not doing what it should and it should be marked as a Fail.
C) I want all the tests in the set to execute regardless of the pass or fail rate.
I’m sure others have implemented this in their tests, but I’m not sure how that is worked into the framework of workflows and actions.