Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[scan] Keep initial xcresult #18555

Merged
merged 2 commits into from Apr 20, 2021
Merged

[scan] Keep initial xcresult #18555

merged 2 commits into from Apr 20, 2021

Conversation

cnotethegr8
Copy link
Contributor

@cnotethegr8 cnotethegr8 commented Apr 14, 2021

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

Scan has a number_of_retries parameter which upon retry, will delete an existing xcresult file and create a new one. The issue with this is the new file will only contain the previous tests that failed. The reason this is an issue is because the xcresult file is used for code coverage.

Description

This PR is building on top of the number_of_retries feature. Instead of removing the xcresult file for each retry, it will create a new file with an appending number. The first attempt will not append a number to the xcresult file.

Testing Steps

This involves enabling result_bundle along with setting number_of_retries greater than 0. When performing scan make sure one of your tests is failing. You will see inside the output_directory path that the first xcresult has the whole test suite and is not removed upon retry attempts.

@google-cla google-cla bot added the cla: yes label Apr 14, 2021
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 is great! I’m so sorry if this broke things for you 😩 This is a very clean way of doing it 💯 Thank you so much for your first contribution!

@joshdholtz joshdholtz merged commit 620cf59 into fastlane:master Apr 20, 2021
Copy link

@fastlane-bot fastlane-bot left a comment

Choose a reason for hiding this comment

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

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

@tengfoung
Copy link

@cnotethegr8 Do we have the same mechanism for junit and it's html?

@cnotethegr8
Copy link
Contributor Author

@tengfoung I don't believe so.
FYI, @joshdholtz

@kitskomina
Copy link

@joshdholtz
This issue is also reproducible for junit and html reports format.
We use junit with our GitLab CI and retry functionality breaks tests statistic (it shows only last retried test as successful test and total amount of tests - 1)
Could we have this fixed, please ? Should I create a bug report for this?
Screenshot 2021-05-18 at 17 47 33

@fastlane fastlane locked and limited conversation to collaborators Jul 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.

None yet

5 participants