From e58c198ed4e665f596b80479a0aa755a477a18fb Mon Sep 17 00:00:00 2001 From: John Ehrlinger Date: Tue, 11 Aug 2026 13:02:06 -0400 Subject: [PATCH] test: track the nine orphaned vdiffr baselines; fix the .Rcheck ignore pattern Nine SVGs under tests/testthat/_snaps/snapshots/ have never been tracked on any branch, though they are baselines for nine live expect_doppelganger() calls in test_snapshots.R. That left them in the worst of both states: not protected by git, and not deliberately ignored either. Two consequences, one loud and one quiet: - Loud: a suite run with VDIFFR_RUN_TESTS unset prunes them as "unused", and `git restore` cannot bring them back because git never had them. On 2026-08-06 they survived only because a stale copy happened to be left in ggRandomForests.Rcheck/00_pkg_src/. That is not a backup. - Quiet: vdiffr writes a baseline and passes when none exists, so on any fresh clone those nine visual-regression tests could never fail. Tracking them is what the package's own convention already prescribes -- test_snapshots.R:18 says "Commit tests/testthat/_snaps/ to the repo" -- and puts them on the same footing as their 40 committed siblings, which share the same Aug 6 generation run. Verified rather than assumed: NOT_CRAN=true VDIFFR_RUN_TESTS=true devtools::test(filter = "snapshots") reports FAIL 0 | SKIP 0 | PASS 49 against main, with no .new.svg written, so these baselines match current output and are not stale recoveries. lintr::lint_package() reports 0 lints. Separately, .gitignore carried `..Rcheck` and `..Rcheck/*`. A dot is a literal in gitignore syntax, so those matched only a path named `..Rcheck`, which nothing creates -- an evident typo for `*.Rcheck`. The 12 MB ggRandomForests.Rcheck/ was therefore never ignored while the file looked like it handled it. Replaced with `*.Rcheck/` and dropped the redundant second line. Confirmed it catches the directory and its contents without matching R/ or tests/. Co-Authored-By: Claude Opus 5 --- .gitignore | 3 +- .../_snaps/snapshots/gg-isopro-default.svg | 152 + .../snapshots/gg-isopro-predict-overlay.svg | 168 ++ .../_snaps/snapshots/gg-isopro-threshold.svg | 154 + .../snapshots/gg-roc-multiclass-facet.svg | 148 + .../snapshots/gg-roc-multiclass-overlay.svg | 82 + .../snapshots/gg-udependent-default.svg | 52 + .../snapshots/gg-udependent-undirected.svg | 49 + .../gg-variable-rf-classification-default.svg | 2581 +++++++++++++++++ .../gg-variable-rf-classification-smooth.svg | 597 ++++ 10 files changed, 3984 insertions(+), 2 deletions(-) create mode 100644 tests/testthat/_snaps/snapshots/gg-isopro-default.svg create mode 100644 tests/testthat/_snaps/snapshots/gg-isopro-predict-overlay.svg create mode 100644 tests/testthat/_snaps/snapshots/gg-isopro-threshold.svg create mode 100644 tests/testthat/_snaps/snapshots/gg-roc-multiclass-facet.svg create mode 100644 tests/testthat/_snaps/snapshots/gg-roc-multiclass-overlay.svg create mode 100644 tests/testthat/_snaps/snapshots/gg-udependent-default.svg create mode 100644 tests/testthat/_snaps/snapshots/gg-udependent-undirected.svg create mode 100644 tests/testthat/_snaps/snapshots/gg-variable-rf-classification-default.svg create mode 100644 tests/testthat/_snaps/snapshots/gg-variable-rf-classification-smooth.svg diff --git a/.gitignore b/.gitignore index c3d132e5..d434728d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ .Rproj.user .Rhistory .RData -..Rcheck +*.Rcheck/ 00check.log 00install.out Sweave.sty @@ -22,7 +22,6 @@ jsslogo.jpg *.bbl inst/doc -..Rcheck/* vignettes/ggRandomForests-regression_cache/* vignettes/ggRandomForests-survival_cache/* vignettes/rmd-rf/* diff --git a/tests/testthat/_snaps/snapshots/gg-isopro-default.svg b/tests/testthat/_snaps/snapshots/gg-isopro-default.svg new file mode 100644 index 00000000..a9ed5e57 --- /dev/null +++ b/tests/testthat/_snaps/snapshots/gg-isopro-default.svg @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.25 +0.50 +0.75 +1.00 + + + + + + + + + +0 +50 +100 +150 +Observation rank (by howbad) +howbad (anomaly score) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.25 +0.50 +0.75 +1.00 + + + + + + + + + + +0.00 +0.25 +0.50 +0.75 +1.00 +howbad (anomaly score) +Density +gg-isopro-default + + diff --git a/tests/testthat/_snaps/snapshots/gg-isopro-predict-overlay.svg b/tests/testthat/_snaps/snapshots/gg-isopro-predict-overlay.svg new file mode 100644 index 00000000..4c8e2184 --- /dev/null +++ b/tests/testthat/_snaps/snapshots/gg-isopro-predict-overlay.svg @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.25 +0.50 +0.75 +1.00 + + + + + + + + + +0 +50 +100 +150 +Observation rank (by howbad) +howbad (anomaly score) + +method + + + + +test +train + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.0 +0.3 +0.6 +0.9 + + + + + + + + + +0.00 +0.25 +0.50 +0.75 +1.00 +howbad (anomaly score) +Density + +method + + + + +test +train +gg-isopro-predict-overlay + + diff --git a/tests/testthat/_snaps/snapshots/gg-isopro-threshold.svg b/tests/testthat/_snaps/snapshots/gg-isopro-threshold.svg new file mode 100644 index 00000000..54f52483 --- /dev/null +++ b/tests/testthat/_snaps/snapshots/gg-isopro-threshold.svg @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.25 +0.50 +0.75 +1.00 + + + + + + + + + +0 +50 +100 +150 +Observation rank (by howbad) +howbad (anomaly score) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.25 +0.50 +0.75 +1.00 + + + + + + + + + + +0.00 +0.25 +0.50 +0.75 +1.00 +howbad (anomaly score) +Density +gg-isopro-threshold + + diff --git a/tests/testthat/_snaps/snapshots/gg-roc-multiclass-facet.svg b/tests/testthat/_snaps/snapshots/gg-roc-multiclass-facet.svg new file mode 100644 index 00000000..f7f151b0 --- /dev/null +++ b/tests/testthat/_snaps/snapshots/gg-roc-multiclass-facet.svg @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +setosa + + + + + + + + + + +versicolor + + + + + + + + + + +virginica + + + + + + + +0.00 +0.25 +0.50 +0.75 +1.00 + + + + + +0.00 +0.25 +0.50 +0.75 +1.00 + + + + + +0.00 +0.25 +0.50 +0.75 +1.00 +0.00 +0.25 +0.50 +0.75 +1.00 + + + + + +1 - Specificity (FPR) +Sensitivity (TPR) +gg-roc-multiclass-facet +OvR ROC, per_class=TRUE. AUC: setosa=1, versicolor=0.992, virginica=0.992 + + diff --git a/tests/testthat/_snaps/snapshots/gg-roc-multiclass-overlay.svg b/tests/testthat/_snaps/snapshots/gg-roc-multiclass-overlay.svg new file mode 100644 index 00000000..3bbc5d5b --- /dev/null +++ b/tests/testthat/_snaps/snapshots/gg-roc-multiclass-overlay.svg @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.25 +0.50 +0.75 +1.00 + + + + + + + + + + +0.00 +0.25 +0.50 +0.75 +1.00 +1 - Specificity (FPR) +Sensitivity (TPR) + +Class + + + + + + +setosa +versicolor +virginica +gg-roc-multiclass-overlay +OvR ROC, per_class=TRUE. AUC: setosa=1, versicolor=0.992, virginica=0.992 + + diff --git a/tests/testthat/_snaps/snapshots/gg-udependent-default.svg b/tests/testthat/_snaps/snapshots/gg-udependent-default.svg new file mode 100644 index 00000000..291f2e0c --- /dev/null +++ b/tests/testthat/_snaps/snapshots/gg-udependent-default.svg @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Sepal.Length + +Petal.Length + +Petal.Width + + +Degree + +2 +gg-udependent-default +Dependency threshold: 0.25. Layout: fr. + + diff --git a/tests/testthat/_snaps/snapshots/gg-udependent-undirected.svg b/tests/testthat/_snaps/snapshots/gg-udependent-undirected.svg new file mode 100644 index 00000000..f3e38ad5 --- /dev/null +++ b/tests/testthat/_snaps/snapshots/gg-udependent-undirected.svg @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +Sepal.Length + +Petal.Length + +Petal.Width + + +Degree + +2 +gg-udependent-undirected +Dependency threshold: 0.25. Layout: fr. + + diff --git a/tests/testthat/_snaps/snapshots/gg-variable-rf-classification-default.svg b/tests/testthat/_snaps/snapshots/gg-variable-rf-classification-default.svg new file mode 100644 index 00000000..e84f8f85 --- /dev/null +++ b/tests/testthat/_snaps/snapshots/gg-variable-rf-classification-default.svg @@ -0,0 +1,2581 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +setosa + + + + + + + + + + +versicolor + + + + + + + + + + +virginica + + + + + + +5 +6 +7 +8 + + + + +5 +6 +7 +8 + + + + +5 +6 +7 +8 +-0.5 +0.0 +0.5 +1.0 + + + + +Sepal.Length +Predicted + +yvar + + + + + + +setosa +versicolor +virginica + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +setosa + + + + + + + + + + +versicolor + + + + + + + + + + +virginica + + + + + + + + +2.0 +2.5 +3.0 +3.5 +4.0 +4.5 + + + + + + +2.0 +2.5 +3.0 +3.5 +4.0 +4.5 + + + + + + +2.0 +2.5 +3.0 +3.5 +4.0 +4.5 +-0.5 +0.0 +0.5 +1.0 +1.5 + + + + + +Sepal.Width +Predicted + +yvar + + + + + + +setosa +versicolor +virginica + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +setosa + + + + + + + + + + +versicolor + + + + + + + + + + +virginica + + + + + +2 +4 +6 + + + +2 +4 +6 + + + +2 +4 +6 +0.0 +0.5 +1.0 + + + +Petal.Length +Predicted + +yvar + + + + + + +setosa +versicolor +virginica + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +setosa + + + + + + + + + + +versicolor + + + + + + + + + + +virginica + + + + + + + + +0.0 +0.5 +1.0 +1.5 +2.0 +2.5 + + + + + + +0.0 +0.5 +1.0 +1.5 +2.0 +2.5 + + + + + + +0.0 +0.5 +1.0 +1.5 +2.0 +2.5 +0.0 +0.4 +0.8 +1.2 + + + + +Petal.Width +Predicted + +yvar + + + + + + +setosa +versicolor +virginica +gg-variable-rf-classification-default + + diff --git a/tests/testthat/_snaps/snapshots/gg-variable-rf-classification-smooth.svg b/tests/testthat/_snaps/snapshots/gg-variable-rf-classification-smooth.svg new file mode 100644 index 00000000..de5004fc --- /dev/null +++ b/tests/testthat/_snaps/snapshots/gg-variable-rf-classification-smooth.svg @@ -0,0 +1,597 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +setosa + + + + + + + + + + +versicolor + + + + + + + + + + +virginica + + + + + + +5 +6 +7 +8 + + + + +5 +6 +7 +8 + + + + +5 +6 +7 +8 +-0.5 +0.0 +0.5 +1.0 + + + + +Sepal.Length +Predicted + +yvar + + + + + + +setosa +versicolor +virginica +gg-variable-rf-classification-smooth + +