You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rstudio-tests r scope passes when a testthat test errors #19648
src/cpp/tests/testthat/run-tests.R decides whether the r test scope failed from sum(as.data.frame(results)$failed), which it writes to testthat-failures.log for checkRUnitTestFailure in rstudio-tests. testthat's failed column counts failed expectations only: a test that raises an error has failed == 0 and error == TRUE. So a testthat case that errors, rather than failing an expectation, leaves testthat-failures.log at 0, rstudio-tests --scope r exits 0, and CI passes.
Seen on macOS with testthat 3.3.2 while working on #19640: a test whose code errored inside expect_true() was reported by testthat as [ FAIL 1 | WARN 0 | SKIP 0 | PASS 40 ], but testthat-failures.log held 0 and the run exited 0.
A fix is to count errored tests too, e.g. sum(df$failed) + sum(df$error). Any test that errors today would then start failing CI, so the full r scope should be run first to see whether there are any.
Activity