diff --git a/NEWS b/NEWS index e5e54bf..b81dd1f 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,8 @@ Changes in version 2024.9.23 - atime_pkg_test_info returns un-evaluated calls to atime_versions, to make it easier to run one test at a time. -- atime_versions result list contains bench.seconds and install.seconds, to compare how much time is spent in each step. +- atime_versions result list contains bench.seconds and install.seconds, to compare how much time is spent in each step. atime_pkg also writes total install time over all test cases to install_seconds.txt. +- atime_pkg tests_all_facet.png now has ggtitle with number of plots and p-value interpretation. Changes in version 2024.8.11 diff --git a/R/test.R b/R/test.R index 5436520..fa607dc 100644 --- a/R/test.R +++ b/R/test.R @@ -112,10 +112,18 @@ atime_pkg <- function(pkg.path=".", tests.dir=NULL){ blank.dt <- rbindlist(blank.dt.list)[meta.dt, on="test.name"] compare.dt <- rbindlist(compare.dt.list)[meta.dt, on="test.name"] tests.RData <- sub("R$", "RData", test.info$tests.R) + install.seconds <- sapply(pkg.results, "[[", "install.seconds") + cat( + sum(install.seconds), + file=file.path(dirname(tests.RData), "install_seconds.txt")) save( pkg.results, bench.dt, limit.dt, test.info, blank.dt, file=tests.RData) + N.tests <- length(test.info$test.list) gg <- ggplot2::ggplot()+ + ggplot2::ggtitle(paste( + N.tests, + "test cases, ordered by p-value (T-test, HEAD>min, dots show data tested)"))+ ggplot2::theme_bw()+ ggplot2::geom_hline(ggplot2::aes( yintercept=seconds.limit), @@ -148,7 +156,6 @@ atime_pkg <- function(pkg.path=".", tests.dir=NULL){ ggplot2::theme(legend.position="none") out.png <- file.path( dirname(test.info$tests.R), "tests_all_facet.png") - N.tests <- length(test.info$test.list) grDevices::png( out.png, width=test.info$width.in*N.tests, diff --git a/tests/testthat/test-versions.R b/tests/testthat/test-versions.R index 75c7173..a101fc8 100644 --- a/tests/testthat/test-versions.R +++ b/tests/testthat/test-versions.R @@ -38,6 +38,9 @@ test_that("atime_pkg produces tests_all_facet.png", { result.list <- atime::atime_pkg(tdir) tests_all_facet.png <- file.path(inst.atime, "tests_all_facet.png") expect_true(file.exists(tests_all_facet.png)) + install_seconds.txt <- file.path(inst.atime, "install_seconds.txt") + install.seconds <- scan(install_seconds.txt, n=1, quiet=TRUE) + expect_is(install.seconds, "numeric") }) test_that("atime_pkg produces RData with expected names", {