Skip to content

Commit

Permalink
Fix test warnings workflow (#941)
Browse files Browse the repository at this point in the history
  • Loading branch information
IndrajeetPatil authored May 26, 2024
1 parent 5617a05 commit d55f86a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/check-test-warnings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,16 @@ jobs:
upgrade: 'TRUE'
extra-packages: |
local::.
any::devtools
needs: check

- name: Run Tests
run: |
options(crayon.enabled = TRUE, warn = 2L)
devtools::test()
options(crayon.enabled = TRUE)
pkgload::load_all()
test_script_paths <- testthat::find_test_scripts("tests/testthat")
test_with_warning_as_error <- function(path) {
withr::local_options(list(warn = 2L))
testthat::test_file(path, stop_on_failure = TRUE, stop_on_warning = TRUE)
}
purrr::walk(test_script_paths, test_with_warning_as_error)
shell: Rscript {0}

0 comments on commit d55f86a

Please sign in to comment.