Closed gretzki closed 8 years ago
You could also easily surround the call with
begin
scan
rescue => ex
# do something here in case of an error
end
# do something here in any case
You're right, I already thought about that.
IMHO, it should'nt be an error (thus no exception) if there are failing tests, but if the action itself can not run successfully. Besides, the lane can be programmed in a cleaner way, without surrounding begin..rescue..end
block and the error
block is called if the number of failing+succeeding tests can't be retrieved.
But that's just my opinion on these things, and I wanted to put this up for discussion.
I'd also like the option of passing on scan failing - that being said (you should fix your travis issues)
@jeeftor There are no errors I could fix. Travis seems to have passed out while executing scan.
If begin...rescue...end
is the supported way to handle this, I'll close this PR now.
Adds an option to omit the exception on failing tests. This addition preserves the default behaviour to not break existing setups. Additionally, the number of failing tests is provided as return value.
This change is to support the use case, where the test results should be processed in every case, e.g:
Here, the test result is forwarded to SonarQube, where I want failing tests to appear as well as succeeding tests.
Using the
error
block is not an alternative here, since it skips the lane's remaining actions. This is the currently the only solution for my use case. What do you think? :)Thanks, Chris