fastlane-old / scan

The easiest way to run tests of your iOS and Mac app
https://fastlane.tools
221 stars 25 forks source link

Suggestion to add the option to omit exception on failing tests #64

Closed gretzki closed 8 years ago

gretzki commented 8 years ago

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:

scan
slather
sonar

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

KrauseFx commented 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
gretzki commented 8 years ago

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.

jeeftor commented 8 years ago

I'd also like the option of passing on scan failing - that being said (you should fix your travis issues)

gretzki commented 8 years ago

@jeeftor There are no errors I could fix. Travis seems to have passed out while executing scan.

gretzki commented 8 years ago

If begin...rescue...end is the supported way to handle this, I'll close this PR now.