-
Notifications
You must be signed in to change notification settings - Fork 92
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
testthat::set_max_fails() not working anymore #2723
Comments
That just sets the |
@EmilHvitfeldt since you seem to have a good test case of massive test failure at hand 😄, what happens in RStudio? |
RStudio's build pane inherits the env vars of the R process, so it "just works" and will chug through all the tests because it inherits the new max failure limit of 1k |
Two ways we could go about this:
The second approach has the downside that it might make it a bit harder to create reproducible behaviour in subprocesses. Did that come up as an issue in RStudio? |
We probably want variants for "clean" R subprocesses and "make it look like the current session" R subprocesses |
That would be nice but it's not clear which one we should choose in this case. We want a clean process to run tests but also propagate user configuration. Maybe the solution in this case is to call |
We have encountered this type of problem before. It's why I ask the running session for its locale-related info and then pass Another alternative is for the env vars to transmit to be task-specific, by using the positron/extensions/positron-r/src/tasks.ts Lines 58 to 61 in e790eef
Maybe our |
Addresses #2723 Together with posit-dev/ark#507, this sets up infrastructure so we can propagate known sets of environment variables to our tasks that use `ShellExecution` (or `ProcessExecution`). I added the `TESTTHAT` environment variables for `devtools::test()` only, for now. We can add other sets of environment variables as they come up. ### TODO: - [x] Bump ark ### QA Notes To QA this, you'll need an R package with some failing tests. [Here's one!](https://github.com/juliasilge/vamplyr) - Run `testthat::set_max_fails(1)` in the console - Run the command "R: Test R Package" - Notice that although this package has 4 failing tests, only ones from the first file are run. You'll see output like this: > Maximum number of failures exceeded; quitting at end of file. > ℹ Increase this number with (e.g.) `testthat::set_max_fails(Inf)` --------- Signed-off-by: Julia Silge <[email protected]>
I've got QA notes available here: #4606 (comment) |
Verified Fixed
Test scenario(s)Hit: Link(s) to TestRail test cases run or created: |
Positron Version:
Positron Version: 2024.04.0 (Universal) build 29
Code - OSS Version: 1.87.0
Commit: 6c41ddd
Date: 2024-04-04T03:32:13.676Z
Electron: 27.3.2
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Darwin arm64 23.4.0
Steps to reproduce the issue:
testthat::set_max_fails(1000)
Kapture.2024-04-10.at.09.58.06.mp4
What did you expect to happen?
I feel like this used to work (although, didn't check)
Were there any error messages in the output or Developer Tools console?
Nope
The text was updated successfully, but these errors were encountered: