From 8363b1c179c4e83d97c3c0c4cfa365f92c7832af Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Mon, 15 Jun 2020 10:27:19 +0200 Subject: Test plots on r-devel only following the arguments of Xavier Robin https://github.com/r-lib/vdiffr/issues/86#issuecomment-636447231 --- GNUmakefile | 3 +- test.log | 39 ++++++---- tests/figs/deps.txt | 2 +- .../nafta-sop-appendix-b.svg | 12 +-- .../plot-nafta-analysis.svg | 12 +-- .../figs/plotting/mkinerrplot-for-focus-c-sfo.svg | 2 +- .../mkinfit-plot-for-focus-c-with-defaults.svg | 2 +- ...ot-for-focus-c-with-residuals-like-in-gmkin.svg | 4 +- .../mkinfit-plot-for-focus-c-with-sep-true.svg | 4 +- .../figs/plotting/mkinparplot-for-focus-c-sfo.svg | 4 +- tests/figs/plotting/mmkin-plot-for-focus-c.svg | 16 ++-- .../plotting/mmkin-plot-for-sfo-focus-c-and-d.svg | 8 +- tests/figs/plotting/plot-err-for-focus-d.svg | 86 +++++++++++----------- .../figs/plotting/plot-errmod-with-focus-c-tc.svg | 4 +- .../plot-errmod-with-focus-d-obs-eigen.svg | 86 +++++++++++----------- .../plotting/plot-errmod-with-sfo-lin-a-obs.svg | 56 +++++++------- .../plotting/plot-errmod-with-sfo-lin-a-tc.svg | 56 +++++++------- tests/figs/plotting/plot-res-for-focus-c.svg | 4 +- tests/figs/plotting/plot-res-for-focus-d.svg | 86 +++++++++++----------- tests/testthat/test_nafta.R | 2 + tests/testthat/test_plot.R | 1 + 21 files changed, 252 insertions(+), 237 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index d2476218..8108704a 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -10,6 +10,7 @@ WINBIN := $(PKGSRC)_$(PKGVERS).zip # If no alternate bin folder is specified, the default is to use the folder # containing the first instance of R on the PATH. RBIN ?= $(shell dirname "`which R`") +#RBIN=/home/jranke/svn/R/r-devel/build/bin # Specify package and static documentation directories for subversion on r-forge RFSVN ?= $(HOME)/svn/r-forge/kinfit @@ -82,7 +83,7 @@ slowtests: install sed -i -e "s/\r.*\r//" tests_slow.log vdiffr: - "$(RBIN)/Rscript" -e 'vdiffr::manage_cases(filter = "plots|nafta")' + /home/jranke/svn/R/r-devel/build/bin/Rscript -e 'vdiffr::manage_cases(filter = "plot|nafta")' testcheck: test check diff --git a/test.log b/test.log index b4e97d72..3f217296 100644 --- a/test.log +++ b/test.log @@ -5,32 +5,43 @@ Testing mkin ✔ | 2 | Export dataset for reading into CAKE ✔ | 14 | Results for FOCUS D established in expertise for UBA (Ranke 2014) [0.9 s] ✔ | 4 | Calculation of FOCUS chi2 error levels [0.4 s] -✔ | 7 | Fitting the SFORB model [3.5 s] -✔ | 5 | Analytical solutions for coupled models [3.3 s] +✔ | 7 | Fitting the SFORB model [3.3 s] +✔ | 5 | Analytical solutions for coupled models [3.2 s] ✔ | 5 | Calculation of Akaike weights -✔ | 10 | Confidence intervals and p-values [1.2 s] -✔ | 14 | Error model fitting [4.0 s] +✔ | 10 | Confidence intervals and p-values [1.1 s] +✔ | 14 | Error model fitting [3.8 s] ✔ | 4 | Test fitting the decline of metabolites from their maximum [0.3 s] ✔ | 1 | Fitting the logistic model [0.2 s] ✔ | 1 | Test dataset class mkinds used in gmkin ✔ | 12 | Special cases of mkinfit calls [0.6 s] -✔ | 8 | mkinmod model generation and printing [0.3 s] +✔ | 8 | mkinmod model generation and printing [0.2 s] ✔ | 3 | Model predictions with mkinpredict [0.4 s] -✔ | 16 | Evaluations according to 2015 NAFTA guidance [1.5 s] -✔ | 9 | Nonlinear mixed-effects models [8.0 s] -✔ | 14 | Plotting [1.5 s] +✔ | 14 2 | Evaluations according to 2015 NAFTA guidance [1.1 s] +──────────────────────────────────────────────────────────────────────────────── +test_nafta.R:25: skip: Test data from Appendix B are correctly evaluated +Reason: getRversion() < "4.1.0" is TRUE + +test_nafta.R:53: skip: Test data from Appendix D are correctly evaluated +Reason: getRversion() < "4.1.0" is TRUE +──────────────────────────────────────────────────────────────────────────────── +✔ | 9 | Nonlinear mixed-effects models [7.8 s] +✔ | 0 1 | Plotting [0.7 s] +──────────────────────────────────────────────────────────────────────────────── +test_plot.R:24: skip: Plotting mkinfit and mmkin objects is reproducible +Reason: getRversion() < "4.1.0" is TRUE +──────────────────────────────────────────────────────────────────────────────── ✔ | 4 | Residuals extracted from mkinfit models ✔ | 2 | Complex test case from Schaefer et al. (2007) Piacenza paper [1.5 s] ✔ | 4 | Summary [0.1 s] ✔ | 1 | Summaries of old mkinfit objects -✔ | 4 | Results for synthetic data established in expertise for UBA (Ranke 2014) [2.3 s] -✔ | 9 | Hypothesis tests [7.0 s] -✔ | 4 | Calculation of maximum time weighted average concentrations (TWAs) [2.4 s] +✔ | 4 | Results for synthetic data established in expertise for UBA (Ranke 2014) [2.2 s] +✔ | 9 | Hypothesis tests [6.8 s] +✔ | 4 | Calculation of maximum time weighted average concentrations (TWAs) [2.5 s] ══ Results ═════════════════════════════════════════════════════════════════════ -Duration: 39.7 s +Duration: 37.2 s -OK: 161 +OK: 145 Failed: 0 Warnings: 0 -Skipped: 0 +Skipped: 3 diff --git a/tests/figs/deps.txt b/tests/figs/deps.txt index 0f64e23e..fa7c5968 100644 --- a/tests/figs/deps.txt +++ b/tests/figs/deps.txt @@ -1,3 +1,3 @@ - vdiffr-svg-engine: 1.0 -- vdiffr: 0.3.1 +- vdiffr: 0.3.2 - freetypeharfbuzz: 0.2.5 diff --git a/tests/figs/evaluations-according-to-2015-nafta-guidance/nafta-sop-appendix-b.svg b/tests/figs/evaluations-according-to-2015-nafta-guidance/nafta-sop-appendix-b.svg index 617e39b3..b3aaee5a 100644 --- a/tests/figs/evaluations-according-to-2015-nafta-guidance/nafta-sop-appendix-b.svg +++ b/tests/figs/evaluations-according-to-2015-nafta-guidance/nafta-sop-appendix-b.svg @@ -40,7 +40,7 @@ 30 40 50 - + @@ -116,7 +116,7 @@ -5 0 5 - + @@ -188,7 +188,7 @@ 30 40 50 - + @@ -264,7 +264,7 @@ -2 0 2 - + @@ -336,7 +336,7 @@ 30 40 50 - + @@ -420,7 +420,7 @@ 1 2 3 - + diff --git a/tests/figs/evaluations-according-to-2015-nafta-guidance/plot-nafta-analysis.svg b/tests/figs/evaluations-according-to-2015-nafta-guidance/plot-nafta-analysis.svg index 5e98487b..74ff25d2 100644 --- a/tests/figs/evaluations-according-to-2015-nafta-guidance/plot-nafta-analysis.svg +++ b/tests/figs/evaluations-according-to-2015-nafta-guidance/plot-nafta-analysis.svg @@ -34,7 +34,7 @@ 60 80 100 - + @@ -112,7 +112,7 @@ 0 10 20 - + @@ -182,7 +182,7 @@ 60 80 100 - + @@ -260,7 +260,7 @@ 0 10 20 - + @@ -330,7 +330,7 @@ 60 80 100 - + @@ -404,7 +404,7 @@ -10 0 10 - + diff --git a/tests/figs/plotting/mkinerrplot-for-focus-c-sfo.svg b/tests/figs/plotting/mkinerrplot-for-focus-c-sfo.svg index 186d4aac..31be7e53 100644 --- a/tests/figs/plotting/mkinerrplot-for-focus-c-sfo.svg +++ b/tests/figs/plotting/mkinerrplot-for-focus-c-sfo.svg @@ -34,7 +34,7 @@ 40 60 80 - + Predicted Squared residual diff --git a/tests/figs/plotting/mkinfit-plot-for-focus-c-with-defaults.svg b/tests/figs/plotting/mkinfit-plot-for-focus-c-with-defaults.svg index 82577502..a157161c 100644 --- a/tests/figs/plotting/mkinfit-plot-for-focus-c-with-defaults.svg +++ b/tests/figs/plotting/mkinfit-plot-for-focus-c-with-defaults.svg @@ -38,7 +38,7 @@ 40 60 80 - + Time Observed diff --git a/tests/figs/plotting/mkinfit-plot-for-focus-c-with-residuals-like-in-gmkin.svg b/tests/figs/plotting/mkinfit-plot-for-focus-c-with-residuals-like-in-gmkin.svg index 8d16bfd3..e16a5260 100644 --- a/tests/figs/plotting/mkinfit-plot-for-focus-c-with-residuals-like-in-gmkin.svg +++ b/tests/figs/plotting/mkinfit-plot-for-focus-c-with-residuals-like-in-gmkin.svg @@ -38,7 +38,7 @@ 40 60 80 - + @@ -101,7 +101,7 @@ 0 5 10 - + diff --git a/tests/figs/plotting/mkinfit-plot-for-focus-c-with-sep-true.svg b/tests/figs/plotting/mkinfit-plot-for-focus-c-with-sep-true.svg index 327161da..3c207187 100644 --- a/tests/figs/plotting/mkinfit-plot-for-focus-c-with-sep-true.svg +++ b/tests/figs/plotting/mkinfit-plot-for-focus-c-with-sep-true.svg @@ -38,7 +38,7 @@ 40 60 80 - + @@ -112,7 +112,7 @@ 0 5 10 - + diff --git a/tests/figs/plotting/mkinparplot-for-focus-c-sfo.svg b/tests/figs/plotting/mkinparplot-for-focus-c-sfo.svg index 62590397..4c2f2b7b 100644 --- a/tests/figs/plotting/mkinparplot-for-focus-c-sfo.svg +++ b/tests/figs/plotting/mkinparplot-for-focus-c-sfo.svg @@ -12,7 +12,7 @@ ]]> - + @@ -49,7 +49,7 @@ - + diff --git a/tests/figs/plotting/mmkin-plot-for-focus-c.svg b/tests/figs/plotting/mmkin-plot-for-focus-c.svg index 1c697328..39c6217f 100644 --- a/tests/figs/plotting/mmkin-plot-for-focus-c.svg +++ b/tests/figs/plotting/mmkin-plot-for-focus-c.svg @@ -38,7 +38,7 @@ 40 60 80 - + @@ -115,7 +115,7 @@ 0 5 10 - + @@ -180,7 +180,7 @@ 40 60 80 - + @@ -255,7 +255,7 @@ 1 2 3 - + @@ -320,7 +320,7 @@ 40 60 80 - + @@ -394,7 +394,7 @@ -0.5 0.5 1.5 - + @@ -459,7 +459,7 @@ 40 60 80 - + @@ -532,7 +532,7 @@ 0 1 2 - + diff --git a/tests/figs/plotting/mmkin-plot-for-sfo-focus-c-and-d.svg b/tests/figs/plotting/mmkin-plot-for-sfo-focus-c-and-d.svg index 72496e86..bb1177bf 100644 --- a/tests/figs/plotting/mmkin-plot-for-sfo-focus-c-and-d.svg +++ b/tests/figs/plotting/mmkin-plot-for-sfo-focus-c-and-d.svg @@ -38,7 +38,7 @@ 40 60 80 - + @@ -115,7 +115,7 @@ 0 5 10 - + @@ -176,7 +176,7 @@ 60 80 100 - + @@ -254,7 +254,7 @@ 0 5 10 - + diff --git a/tests/figs/plotting/plot-err-for-focus-d.svg b/tests/figs/plotting/plot-err-for-focus-d.svg index e7f05168..3e7b5486 100644 --- a/tests/figs/plotting/plot-err-for-focus-d.svg +++ b/tests/figs/plotting/plot-err-for-focus-d.svg @@ -40,7 +40,7 @@ 60 80 100 - + @@ -71,33 +71,33 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - + parent m1 @@ -140,7 +140,7 @@ 100 120 140 - + @@ -171,26 +171,26 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/tests/figs/plotting/plot-errmod-with-focus-c-tc.svg b/tests/figs/plotting/plot-errmod-with-focus-c-tc.svg index 8adefc27..05949f24 100644 --- a/tests/figs/plotting/plot-errmod-with-focus-c-tc.svg +++ b/tests/figs/plotting/plot-errmod-with-focus-c-tc.svg @@ -38,7 +38,7 @@ 40 60 80 - + @@ -97,7 +97,7 @@ 40 60 80 - + diff --git a/tests/figs/plotting/plot-errmod-with-focus-d-obs-eigen.svg b/tests/figs/plotting/plot-errmod-with-focus-d-obs-eigen.svg index afd3e064..3a528f9c 100644 --- a/tests/figs/plotting/plot-errmod-with-focus-d-obs-eigen.svg +++ b/tests/figs/plotting/plot-errmod-with-focus-d-obs-eigen.svg @@ -40,7 +40,7 @@ 60 80 100 - + @@ -71,33 +71,33 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - + parent m1 @@ -140,7 +140,7 @@ 100 120 140 - + @@ -171,26 +171,26 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/tests/figs/plotting/plot-errmod-with-sfo-lin-a-obs.svg b/tests/figs/plotting/plot-errmod-with-sfo-lin-a-obs.svg index 28df5d2d..8c234234 100644 --- a/tests/figs/plotting/plot-errmod-with-sfo-lin-a-obs.svg +++ b/tests/figs/plotting/plot-errmod-with-sfo-lin-a-obs.svg @@ -40,7 +40,7 @@ 60 80 100 - + @@ -65,18 +65,18 @@ - - - - - - - - - - - - + + + + + + + + + + + + @@ -115,7 +115,7 @@ - + parent @@ -159,7 +159,7 @@ 20 25 30 - + @@ -184,18 +184,18 @@ - - - - - - - - - - - - + + + + + + + + + + + + @@ -222,7 +222,7 @@ - + diff --git a/tests/figs/plotting/plot-errmod-with-sfo-lin-a-tc.svg b/tests/figs/plotting/plot-errmod-with-sfo-lin-a-tc.svg index f4e7679d..a670ca80 100644 --- a/tests/figs/plotting/plot-errmod-with-sfo-lin-a-tc.svg +++ b/tests/figs/plotting/plot-errmod-with-sfo-lin-a-tc.svg @@ -40,7 +40,7 @@ 60 80 100 - + @@ -65,18 +65,18 @@ - - - - - - - - - - - - + + + + + + + + + + + + @@ -115,7 +115,7 @@ - + parent @@ -159,7 +159,7 @@ 20 25 30 - + @@ -180,22 +180,22 @@ - + - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/tests/figs/plotting/plot-res-for-focus-c.svg b/tests/figs/plotting/plot-res-for-focus-c.svg index 43b94055..b5e79275 100644 --- a/tests/figs/plotting/plot-res-for-focus-c.svg +++ b/tests/figs/plotting/plot-res-for-focus-c.svg @@ -38,7 +38,7 @@ 40 60 80 - + @@ -101,7 +101,7 @@ 0 5 10 - + diff --git a/tests/figs/plotting/plot-res-for-focus-d.svg b/tests/figs/plotting/plot-res-for-focus-d.svg index ea3388ed..cf4c2ec4 100644 --- a/tests/figs/plotting/plot-res-for-focus-d.svg +++ b/tests/figs/plotting/plot-res-for-focus-d.svg @@ -40,7 +40,7 @@ 60 80 100 - + @@ -71,33 +71,33 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - + parent m1 @@ -136,7 +136,7 @@ 0 5 10 - + @@ -167,26 +167,26 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/tests/testthat/test_nafta.R b/tests/testthat/test_nafta.R index dad6d84c..62c88983 100644 --- a/tests/testthat/test_nafta.R +++ b/tests/testthat/test_nafta.R @@ -22,6 +22,7 @@ test_that("Test data from Appendix B are correctly evaluated", { plot_nafta <- function() plot(res) if(requireNamespace("vdiffr", quietly = TRUE)) { + skip_if(getRversion() < "4.1.0") vdiffr::expect_doppelganger("NAFTA SOP Appendix B", plot_nafta) } }) @@ -49,6 +50,7 @@ test_that("Test data from Appendix D are correctly evaluated", { plot_nafta <- function() plot(res) if(requireNamespace("vdiffr", quietly = TRUE)) { + skip_if(getRversion() < "4.1.0") vdiffr::expect_doppelganger("Plot NAFTA analysis", plot_nafta) } }) diff --git a/tests/testthat/test_plot.R b/tests/testthat/test_plot.R index c6a187be..40d5928f 100644 --- a/tests/testthat/test_plot.R +++ b/tests/testthat/test_plot.R @@ -21,6 +21,7 @@ test_that("Plotting mkinfit and mmkin objects is reproducible", { plot_errmod_fit_obs_1 <- function() plot_err(fit_obs_1, sep_obs = FALSE) plot_errmod_fit_tc_1 <- function() plot_err(fit_tc_1, sep_obs = FALSE) + skip_if(getRversion() < "4.1.0") vdiffr::expect_doppelganger("mkinfit plot for FOCUS C with defaults", plot_default_FOCUS_C_SFO) vdiffr::expect_doppelganger("mkinfit plot for FOCUS C with residuals like in gmkin", plot_res_FOCUS_C_SFO) vdiffr::expect_doppelganger("plot_res for FOCUS C", plot_res_FOCUS_C_SFO_2) -- cgit v1.2.1