-
Notifications
You must be signed in to change notification settings - Fork 195
Check if tests are coupled by randomizing order in which tests are run #1938
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
base: main
Are you sure you want to change the base?
Changes from all commits
8020173
9e0b705
d01a9e3
c26668d
d462116
be21496
b084cac
72a5596
f09b243
397c072
f6e3b2f
93d504f
84fe347
77270a2
a90db51
8d4629a
b4dbcb2
8099d9e
49cd1c4
5efb535
e8b84ff
4b27a4a
5686404
b8b6762
6770d9d
b317d0a
d4a7edc
b1f9027
6a30c7a
fe6e283
e6b2dce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| on: | ||
| push: | ||
| branches: | ||
| - 'rc-*' | ||
|
|
||
| name: check-random-test-order | ||
|
|
||
| jobs: | ||
| check-random-test-order: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - uses: r-lib/actions/setup-r@v2 | ||
| with: | ||
| use-public-rspm: true | ||
|
|
||
| - uses: r-lib/actions/setup-r-dependencies@v2 | ||
| with: | ||
| install-quarto: false | ||
| extra-packages: local::. | ||
|
|
||
| - name: Run Tests in Random Order | ||
| run: | | ||
| options(crayon.enabled = TRUE) | ||
| seed <- sample.int(1e6, 1L) | ||
| cli::cli_inform("Chosen seed for the current test run: {seed}") | ||
| set.seed(seed) | ||
| testthat::test_dir("tests", shuffle = TRUE) | ||
| shell: Rscript {0} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,7 +46,7 @@ Suggests: | |
| rlang, | ||
| rmarkdown, | ||
| rstudioapi (>= 0.2), | ||
| testthat (>= 3.2.1), | ||
| testthat (>= 3.3.0), | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we don't technically need this since it's GHA-only requirement right?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't, but it's a good way to enforce the dev team to upgrade to use the latest version, which will become especially relevant if we run into a flaky test. I know it's not ideal because they are forced to make this update globally, since we aren't using project dependency manager (like |
||
| tibble, | ||
| tufte, | ||
| withr (>= 2.5.0) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.