Skip to content

Commit

Permalink
install_seconds.txt, ggtitle
Browse files Browse the repository at this point in the history
  • Loading branch information
tdhock committed Sep 24, 2024
1 parent 643c0d5 commit 74d4bc1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
3 changes: 2 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -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

Expand Down
9 changes: 8 additions & 1 deletion R/test.R
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-versions.R
Original file line number Diff line number Diff line change
Expand Up @@ -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", {
Expand Down

0 comments on commit 74d4bc1

Please sign in to comment.