diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a95b86c279722366e067b6e45849272357685d65..c3cc5f651c2fca18247af64c66990fef6555d6a3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,13 +28,6 @@ default: script: - R -e 'rcmdcheck::rcmdcheck(args = ifelse(as.logical(Sys.getenv("NOT_CRAN")), "", "--as-cran"), error_on = "warning")' - R -e 'install.packages(c("microbenchmark", "airGR"), repos = "http://cran.r-project.org")' - - Rscript tests/scheduled_tests/benchmarkRunModel.R - - R CMD INSTALL . - - Rscript tests/scheduled_tests/benchmarkRunModel.R - artifacts: - paths: - - tests/tmp/benchmark.tsv - - tests/tmp/mean_execution_time.tsv .check_not_cran: variables: @@ -46,6 +39,19 @@ default: NOT_CRAN: "false" extends: .check +benchmark_patched: + stage: check + variables: + R_VERSION: "patched" + script: + - Rscript tests/scheduled_tests/benchmarkRunModel.R + - R CMD INSTALL . + - Rscript tests/scheduled_tests/benchmarkRunModel.R + artifacts: + paths: + - tests/tmp/benchmark.tsv + - tests/tmp/mean_execution_time.tsv + scheduled_tests_patched: # only: # refs: diff --git a/tests/testthat/benchmarkRunModel.R b/tests/testthat/benchmarkRunModel.R index b38016f3887b1058d8bf387a22f7c2cbcf12c7b0..bc539a324ab641415c5299d0a7766eb7cdcb5b14 100644 --- a/tests/testthat/benchmarkRunModel.R +++ b/tests/testthat/benchmarkRunModel.R @@ -6,7 +6,7 @@ lapply(df$model, function(model) { # Limit threshold for evolution of execution time (in %) between the 2 versions # Negative values of evolution are expected but we apply an error margin depending on execution time # decrease from 1.5 at 0.0ms to 0.5 at 10ms with a minimum at 0.5 - threshold <- max(0.5, -0.1 * df[sel, 2] + 1.5) + threshold <- max(0.5, 2 - 0.1 * df[sel, 2]) expect_lt(df$evolution[sel], threshold) }) })