Repository navigation
Add tests on Linux - #702
Conversation
|
@copilot please review and check whether this is an appropriate way to add tests specifically for linux. |
Yes, this is functionally appropriate: the OS guard restricts the tests to Linux, and |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the Linux visual regression test additions and platform-specific snapshots.
No open issues 🎉
What changed in this PR
Extends modelbased’s visual regression tests to Linux, using separate snapshot variants where rendering differs from Windows. No production code changes are included.
Changes:
- Enables ordinal plotting tests on Linux and separates Linux-specific
braclandnnetsnapshots. - Adds Linux-only facet plotting tests, including categorical predictors and the
emmeansbackend. - Adds Linux SVG baselines for ordinal and faceted plots.
| File | Description |
|---|---|
tests/testthat/test-plot-ordinal.R |
Enables Linux execution and adds platform-specific snapshot checks. |
tests/testthat/test-plot-facet-linux.r |
Adds Linux facet plotting tests. |
tests/testthat/_snaps/linux/plot-ordinal/plot-ordinal-nnet.svg |
Linux baseline for multinomial predictions by gender. |
tests/testthat/_snaps/linux/plot-ordinal/plot-ordinal-nnet-2.svg |
Linux baseline for multinomial interaction predictions. |
tests/testthat/_snaps/linux/plot-ordinal/plot-ordinal-bracl.svg |
Linux baseline for adjacent-category model predictions. |
tests/testthat/_snaps/linux/plot-facet-linux/plot-interaction-facets-cat-4emmeans.svg |
Categorical facet baseline using emmeans. |
tests/testthat/_snaps/linux/plot-facet-linux/plot-interaction-facets-cat-1.svg |
Categorical facet baseline without connecting lines. |
tests/testthat/_snaps/linux/plot-facet-linux/plot-interaction-facets-cat-1-lines.svg |
Categorical facet baseline with connecting lines. |
tests/testthat/_snaps/linux/plot-facet-linux/plot-interaction-facets-2.svg |
Baseline for continuous predictions with opacity grouping. |
tests/testthat/_snaps/linux/plot-facet-linux/plot-interaction-facets-10.svg |
Baseline for multi-factor facets with confidence bands. |
tests/testthat/_snaps/linux/plot-facet-linux/plot-interaction-facets-1.svg |
Baseline for two-panel interaction predictions. |
Review effort: Balanced
|
Sorry I missed this |
|
No worries. This is still "work in progress", and this was just a test. So I still need to figure out how I can add variants of visual snapshot for windows and linux, so that testing on one system does not remove those snapshots for the other system? |
|
@strengejacke Right now the Linux facet tests live in their own file, The fix is to use one You'd add a helper to snapshot_variant <- function() {
if (identical(Sys.info()[["sysname"]], "Linux")) "linux" else NULL
}and each call in vdiffr::expect_doppelganger(
"plot-interaction-facets-1",
plot(pr, show_data = FALSE),
variant = snapshot_variant()
)Then we'd remove "linux" from that file's Want me to open a PR for this? |
@jmgirard What would be best practice to have vdiffr tests for both Windows and Linux? Snapshot SVG files usually slightly differ on both OS, so you can't have just one test for both OS.