-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
spec_helper: improve parallel test handling. #18639
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not very familiar with the
parallel_tests
gem but according to the docs it looks like this.last_process?
method indicates that it's the last started process not the last finished process. I assume we want to test for the last finished process so that we format the coverage result for all test processes. If that's the case, we should keep the old logic.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this would need
ParallelTests.wait_for_other_processes_to_finish
for this to work which internally just doesnumber_of_running_processes <= 1
anyway but with the downside of sleep calls.Seems the original is more correct as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bit that's weird here is the
RUBY_PLATFORM[/darwin/]
. Why not do this for all OS? I suspect that part of the check came from a time when coverage was macOS only.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@apainintheneck I am very familiar with it. I wrote this code (3c270b3). I also reread all the relevant SimpleCov code in making this change.
Yes but: this doesn't matter. We don't need to run this on the last running process, just any single process.
@Bo98 did you test this locally? I did and it seemed to work as expected. Similarly, I don't understand why the coverage metrics on this PR would work if this were the case.
I'm going to just leave this as-is, I'm not sure it's worth anyone's time to further discuss this cleanup. I don't think the review process here has been optimal.
@Bo98 Feel free to open a PR for this if desired.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like that's because SimpleCov already has ParallelTests support and has the
ParallelTests.wait_for_other_processes_to_finish
call I suggested adding: https://github.com/simplecov-ruby/simplecov/blob/b6c2d4208a5fa395ce09d7e1d3b074f680ee29b0/lib/simplecov.rb#L279I'll clarify the comment to specify the problem more directly to avoid future confusion here - I thought it meant that SimpleCov didn't support parallel tests at all. Probably worth upstreaming this diff at some point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Bo98 Thanks for getting this over the line!