-
Couldn't load subscription status.
- Fork 340
Fix the lister when running in parallel #2233
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
Merged
Merged
Changes from all commits
Commits
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 hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # works in parallel | ||
|
|
||
| Code | ||
| results[, c(1:8, 12:13)] | ||
| Output | ||
| file context test nb failed skipped error warning passed result | ||
| 1 f1 t11 2 0 FALSE FALSE 0 2 msg111, msg112 | ||
| 2 f2 t21 2 0 FALSE FALSE 0 2 msg211, msg212 | ||
| 3 f2 t22 1 0 TRUE FALSE 0 0 skip221 | ||
|
|
This file contains hidden or 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.
Uh oh!
There was an error while loading. Please reload this page.
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 don't know if it's important, but to fully handle nested tests (which always existed via
describe()andit()but are now fleshed out fortest_that()too),start_test()might be called multiple times beforeend_test(); i.e. tests are a stack now.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.
Yes, that is actually how the parallel reporting works. We call
start_file()andstart_test()every time we get a result from a subprocess.But do you also call
end_test()multiple times, or no?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.
Right — each test always generates one
start_test()and oneend_test()but there might be multiple starts before you get to the match ends. There's atests/testthat/reporter/nested.Ryou can use to test if needed.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.
This is essentially what he new test case I added does as well. (In addition to doing all this "concurrently".) So this should be fine. (Also, all tests pass, that means it is fine, no?)
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, seems fine. I mostly wanted to make sure that you were aware of this change to the reporter API because I keep forgetting about it.
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.
TBH, I never really looked at how
describe()tests are different, so I indeed wasn't aware of this.But the logic should be the same as before for non-parallel runs, and parallel runs should now produce the same results as non-parallel runs. This was my reasoning for this PR being correct.