-
Notifications
You must be signed in to change notification settings - Fork 0
Add to nlmixr2plot fix #53
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
Show all changes
5 commits
Select commit
Hold shift + click to select a range
86487c3
Add to nlmixr2plot fix
mattfidler ccd8902
Address Copilot review + add tidyvpc pred-corr censoring fix
mattfidler 3f04c21
CI: split tests into essential (PR) + weekly slow batches
mattfidler 038ebf1
CI: wrap augPred-skip message under 80 cols (CodeFactor)
mattfidler 1b266c2
CI: use snake_case locals in tests/testthat.R (lintr/CodeFactor)
mattfidler 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,7 @@ | |
| ^README\.Rmd$ | ||
| ^pkgdown$ | ||
| ^logo.png$ | ||
|
|
||
|
|
||
| ^.git$ | ||
| ^.vexp$ | ||
| ^cran-comments\.md$ | ||
| ^CRAN-SUBMISSION$ | ||
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,65 @@ | ||
| # Runs the slow test files that push/PR R-CMD-check.yaml deliberately skips. | ||
| # The slow files are split into batches (defined in tests/testthat.R via | ||
| # NLMIXR2PLOT_TEST_BATCH); each batch is sized to finish well under an hour. | ||
| # `max-parallel: 1` runs the batches one at a time so they never overlap. | ||
| on: | ||
| schedule: | ||
| # Weekly, Saturdays 04:30 UTC. | ||
| - cron: '30 4 * * 6' | ||
| workflow_dispatch: | ||
|
|
||
| name: slow-tests.yaml | ||
|
|
||
| permissions: read-all | ||
|
|
||
| # Never overlap slow-test runs (they are long); let an in-progress run finish. | ||
| concurrency: | ||
| group: slow-tests | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| slow-tests: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| name: slow-tests (batch ${{ matrix.batch }}) | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| # Run the batches sequentially so they do not overlap. | ||
| max-parallel: 1 | ||
| matrix: | ||
| # Must match the number of entries in `.slowBatches` in | ||
| # tests/testthat.R. | ||
| batch: [1, 2] | ||
|
|
||
| env: | ||
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
| R_KEEP_PKG_SOURCE: yes | ||
| NLMIXR2PLOT_TEST_BATCH: ${{ matrix.batch }} | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - uses: r-lib/actions/setup-pandoc@v2 | ||
|
|
||
| - uses: r-lib/actions/setup-r@v2 | ||
| with: | ||
| r-version: release | ||
| use-public-rspm: true | ||
|
|
||
| - uses: r-lib/actions/setup-r-dependencies@v2 | ||
| with: | ||
| extra-packages: | | ||
| any::rcmdcheck | ||
| nlmixr2/nlmixr2data | ||
| nlmixr2/lotri | ||
| nlmixr2/rxode2ll | ||
| nlmixr2/rxode2 | ||
| nlmixr2/nlmixr2est | ||
| nlmixr2/nlmixr2extra | ||
| needs: check | ||
|
|
||
| - uses: r-lib/actions/check-r-package@v2 | ||
| with: | ||
| upload-snapshots: true | ||
| build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' |
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
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 |
|---|---|---|
| @@ -1,4 +1,62 @@ | ||
| library(testthat) | ||
| library(nlmixr2plot) | ||
|
|
||
| test_check("nlmixr2plot") | ||
| # Thread policy on CI / CRAN: keep the test process single-threaded so the | ||
| # repeated model fits do not oversubscribe the (small) hosted runners. On CRAN | ||
| # also cap rxode2 within-solve threads to two per CRAN's policy. | ||
| .on_cran <- !identical(Sys.getenv("NOT_CRAN"), "true") | ||
| .on_ci <- isTRUE(as.logical(Sys.getenv("CI", "false"))) | ||
| if (.on_ci || .on_cran) { | ||
| options(Ncpus = 1L) | ||
| Sys.setenv(TESTTHAT_CPUS = "1") | ||
| Sys.setenv(TESTTHAT_PARALLEL = "FALSE") | ||
| } | ||
| if (.on_cran && requireNamespace("rxode2", quietly = TRUE)) { | ||
| rxode2::setRxThreads(2L) | ||
| } | ||
|
|
||
| # ------------------------------------------------------------------------- | ||
| # CI test partitioning | ||
| # | ||
| # Every test file fits real nlmixr2 models, so the full suite is expensive on a | ||
| # single hosted runner. push/PR R-CMD-check runs only the "essential" subset -- | ||
| # every test file EXCEPT the slow ones listed in .slow_batches below -- which | ||
| # still exercises the core plotting surface (plot(fit) goodness-of-fit plots, | ||
| # vpcPlot()/traceplot(), augPred() plots and the gglist collection structure). | ||
| # | ||
| # The slow files run separately in the weekly slow-tests workflow, split into | ||
| # batches that run one-at-a-time (non-overlapping). That workflow sets | ||
| # NLMIXR2PLOT_TEST_BATCH=<n> to run only batch n's files. | ||
| # | ||
| # Names are the test file basename with the leading "test-" and trailing ".R" | ||
| # removed (what testthat's `filter` matches). When a test file grows past a few | ||
| # minutes, move it into one of the batches here. | ||
| # ------------------------------------------------------------------------- | ||
| .slow_batches <- list( | ||
| # batch 1 -- heaviest fit-based files (multi-endpoint PK/PD + censored VPC) | ||
| c("plots-multiple-endpoints", "plots-cens"), | ||
| # batch 2 -- between-subject-variability plot detail (QQ / correlation / | ||
| # covariate plots across several fits) | ||
| c("plots-bsv") | ||
| ) | ||
| .slow_all <- unlist(.slow_batches) | ||
|
|
||
| .batch <- Sys.getenv("NLMIXR2PLOT_TEST_BATCH") | ||
|
|
||
| .filter <- NULL | ||
| if (nzchar(.batch)) { | ||
| # Slow-batch mode: run ONLY this batch's slow files. | ||
| .b <- suppressWarnings(as.integer(.batch)) | ||
| if (is.na(.b) || .b < 1L || .b > length(.slow_batches)) { | ||
| stop(sprintf("NLMIXR2PLOT_TEST_BATCH=%s out of range (1..%d)", | ||
| .batch, length(.slow_batches))) | ||
| } | ||
| .files <- .slow_batches[[.b]] | ||
| .filter <- paste0("^(", paste(.files, collapse = "|"), ")$") | ||
| } else if (.on_ci && !.on_cran && length(.slow_all) > 0L) { | ||
| # Essential subset on push/PR CI: everything EXCEPT the slow files. | ||
| .filter <- paste0("^(?!(", paste(.slow_all, collapse = "|"), ")$)") | ||
| } | ||
| # Locally (and on CRAN) .filter stays NULL -> run everything. | ||
|
|
||
| test_check("nlmixr2plot", filter = .filter, perl = TRUE) |
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
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.