Skip to content

Conversation

gobetti
Copy link
Contributor

@gobetti gobetti commented Nov 17, 2020

Checklist

  • I've run bundle exec rspec from the root directory to see all new and existing tests pass
  • I've followed the fastlane code style and run bundle exec rubocop -a to ensure the code style is valid
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary.

Motivation and Context

Fixes #16480

Description

test_results used to early return when disable_xcpretty is true, but that would lead into a crash inside handle_test_results (the only method that calls test_results) because it doesn't check for nil. I'm changing the early return to be in handle_test_results instead so the whole thing is skipped.

Testing Steps

I believe any combination of disable_xcpretty: true without fail_build: false would lead into the crash before this fix. I used to have fail_build: true so I had never detected it myself.

@google-cla google-cla bot added the cla: yes label Nov 17, 2020
Early return on handle_results instead of having test_results early
return nil, so the handling doesn't crash nor prints unwanted error.
@joshdholtz joshdholtz force-pushed the bugfix/disable-xcpretty-crashes-test-results-parser branch from 52aa306 to 162821b Compare November 18, 2020 18:01
@joshdholtz joshdholtz changed the title Fix crash on TestResultParser when disable_xcpretty=true [scan] fix crash on TestResultParser when disable_xcpretty=true Nov 18, 2020
Copy link
Member

@joshdholtz joshdholtz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes a lot of sense! And even goes with what the disable_xcpretty option says it does 😊 Really appreciate the contribution ❤️

@joshdholtz joshdholtz merged commit 13ce494 into fastlane:master Nov 18, 2020
@gobetti gobetti deleted the bugfix/disable-xcpretty-crashes-test-results-parser branch November 18, 2020 23:11
@1oo7
Copy link

1oo7 commented Nov 19, 2020

How would this crash manifest?

@fastlane-bot
Copy link

Congratulations! 🎉 This was released as part of fastlane 2.168.0 🚀

@fastlane fastlane locked and limited conversation to collaborators Jan 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[scan] undefined method `scan' for nil:NilClass
4 participants