From 300c0fccf327b9959db39c256bae0974908e59b2 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Thu, 19 Nov 2020 16:03:38 +0100 Subject: Update tests, improve CAKE_export test --- build.log | 1 + test.log | 41 ++++++++++++++++++++------------------- tests/testthat/FOCUS_2006_D.csf | 2 +- tests/testthat/test_CAKE_export.R | 5 ++--- 4 files changed, 25 insertions(+), 24 deletions(-) diff --git a/build.log b/build.log index d101d06b..13905abe 100644 --- a/build.log +++ b/build.log @@ -5,5 +5,6 @@ * creating vignettes ... OK * checking for LF line-endings in source and make files and shell scripts * checking for empty or unneeded directories +Removed empty directory ‘mkin/tests/testthat/_snaps’ * building ‘mkin_0.9.50.4.tar.gz’ diff --git a/test.log b/test.log index 32d12209..957a3e87 100644 --- a/test.log +++ b/test.log @@ -1,48 +1,49 @@ Loading mkin +Loading required package: parallel Testing mkin ✔ | OK F W S | Context ✔ | 4 | AIC calculation ✔ | 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.4 s] -✔ | 5 | Analytical solutions for coupled models [3.0 s] +✔ | 7 | Fitting the SFORB model [3.5 s] +✔ | 5 | Analytical solutions for coupled models [3.1 s] ✔ | 5 | Calculation of Akaike weights ✔ | 10 | Confidence intervals and p-values [1.0 s] -✔ | 14 | Error model fitting [4.1 s] +✔ | 14 | Error model fitting [4.6 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 -✔ | 1 | mkinfit features [0.2 s] -✔ | 12 | Special cases of mkinfit calls [0.6 s] -✔ | 8 | mkinmod model generation and printing [0.2 s] +✔ | 1 | mkinfit features [0.3 s] +✔ | 12 | Special cases of mkinfit calls [0.7 s] +✔ | 8 | mkinmod model generation and printing [0.3 s] ✔ | 3 | Model predictions with mkinpredict [0.4 s] -✔ | 14 2 | Evaluations according to 2015 NAFTA guidance [1.1 s] +✔ | 14 2 | Evaluations according to 2015 NAFTA guidance [1.2 s] ──────────────────────────────────────────────────────────────────────────────── -test_nafta.R:25: skip: Test data from Appendix B are correctly evaluated +Skip (test_nafta.R:26:5): 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 +Skip (test_nafta.R:55:5): Test data from Appendix D are correctly evaluated Reason: getRversion() < "4.1.0" is TRUE ──────────────────────────────────────────────────────────────────────────────── -✔ | 9 | Nonlinear mixed-effects models [7.8 s] +✔ | 9 | Nonlinear mixed-effects models [8.2 s] ✔ | 0 1 | Plotting [0.7 s] ──────────────────────────────────────────────────────────────────────────────── -test_plot.R:24: skip: Plotting mkinfit and mmkin objects is reproducible +Skip (test_plot.R:25:3): 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] +✔ | 2 | Complex test case from Schaefer et al. (2007) Piacenza paper [1.6 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.2 s] -✔ | 9 | Hypothesis tests [7.0 s] -✔ | 4 | Calculation of maximum time weighted average concentrations (TWAs) [2.5 s] +✔ | 4 | Results for synthetic data established in expertise for UBA (Ranke 2014) [2.3 s] +✔ | 9 | Hypothesis tests [7.2 s] +✔ | 4 | Calculation of maximum time weighted average concentrations (TWAs) [2.4 s] ══ Results ═════════════════════════════════════════════════════════════════════ -Duration: 37.8 s +Duration: 39.5 s -OK: 146 -Failed: 0 -Warnings: 0 -Skipped: 3 +── Skipped tests ────────────────────────────────────────────────────────────── +● getRversion() < "4.1.0" is TRUE (3) + +[ FAIL 0 | WARN 0 | SKIP 3 | PASS 146 ] diff --git a/tests/testthat/FOCUS_2006_D.csf b/tests/testthat/FOCUS_2006_D.csf index 7d562426..5969712b 100644 --- a/tests/testthat/FOCUS_2006_D.csf +++ b/tests/testthat/FOCUS_2006_D.csf @@ -5,7 +5,7 @@ Description: MeasurementUnits: % AR TimeUnits: days Comments: Created using mkin::CAKE_export -Date: 2020-11-11 +Date: Dummy date 0000-00-00 Optimiser: IRLS [Data] diff --git a/tests/testthat/test_CAKE_export.R b/tests/testthat/test_CAKE_export.R index 8445b69a..b3941f1b 100644 --- a/tests/testthat/test_CAKE_export.R +++ b/tests/testthat/test_CAKE_export.R @@ -6,10 +6,9 @@ test_that("Exporting is reproducible", { "FOCUS D" = FOCUS_2006_D), map = c(parent = "Parent", m1 = "M1"), links = c(parent = "m1"), - filename = "FOCUS_2006_D.csf", overwrite = TRUE, - study = "FOCUS 2006 D") + filename = "FOCUS_2006_D.csf", overwrite = TRUE, + study = "FOCUS 2006 D", date = "Dummy date 0000-00-00") csf <- readLines(con = "FOCUS_2006_D.csf") - csf[8] <- "Date: Dummy date 0000-00-00" expect_known_value(csf, file = "FOCUS_2006_D.rds") expect_error(CAKE_export(ds = list("FOCUS C" = FOCUS_2006_C), filename = "FOCUS_2006_D.csf", overwrite = FALSE), -- cgit v1.2.1