Commit 4df67cf0 authored by Dorchies David's avatar Dorchies David
Browse files

ci: debug regression tests

- distinction between R versions which produce the results to test
- add Gitlab artefact instruction for making results available for tests in next jobs in the pipeline

Refs #59
parent c6869e74
Pipeline #14370 passed with stages
in 30 minutes and 49 seconds
......@@ -40,6 +40,10 @@ default:
- Rscript -e 'source("tests/testthat/store_examples.R"); StoreRefExampleResults("airGR");'
- R CMD INSTALL .
- Rscript -e 'source("tests/testthat/store_examples.R"); StoreTestExampleResults("airGR");'
artifacts:
paths:
- tests/tmp/
expire_in: 1 week
.check_not_cran:
stage: tests
......
......@@ -4,7 +4,11 @@ StoreRefExampleResults <- function(package, ...) {
}
StoreTestExampleResults <- function(package, ...) {
StoreExampleResults(package = package, path = "tests/tmp/test", ...)
StoreExampleResults(
package = package,
path = file.path("tests/tmp", Sys.getenv("R_VERSION", "test")),
...
)
}
#' Run examples of a package and store the output variables in RDS files for further testing.
......
......@@ -8,7 +8,10 @@ CompareWithRef <- function(refVarFile, testDir, regIgnore) {
if(is.null(regIgnore) || all(apply(regIgnore, 1, function(x) {!all(x == v)}))) {
test_that(paste("Compare", v$topic, v$var), {
skip_on_cran()
testVarFile <- paste0("../tmp/test/", file.path(v$topic, v$var), ".rds")
testVarFile <- paste0(
file.path("../tmp", Sys.getenv("R_VERSION", "test"), v$topic, v$var),
".rds"
)
expect_true(file.exists(testVarFile))
if(file.exists(testVarFile)) {
testVar <- readRDS(testVarFile)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment