Commit c6869e74 authored by Dorchies David's avatar Dorchies David
Browse files

ci: debug regression tests

- add repo URL
- update .Rbuildignore for new files introduced with this test
- update .gitignore

Refs #59
parent 34db013a
Pipeline #14367 passed with stages
in 30 minutes and 13 seconds
......@@ -2,3 +2,5 @@
^\.Rproj\.user$
^\.Rprofile$
^packrat/
^tests/tmp/
^\.regressionignore$
......@@ -3,12 +3,13 @@ packrat/lib*/
# Compiled files
/src/*.o
/src/*.so
/src/*.dll
/src-*
# Test temporary files
/tests/tmp/
/tests/testthat/*.pdf
*.pdf
######################################################################################################
### Generic .gitignore for R (source: https://github.com/github/gitignore/blob/master/R.gitignore) ###
......
StoreRefExampleResults <- function(package, ...) {
install.packages(package)
install.packages(package, repos = "http://cran.r-project.org")
StoreExampleResults(package = package, path = "tests/tmp/ref", ...)
}
......@@ -22,21 +22,21 @@ StoreExampleResults <- function(package, path, run.dontrun = FALSE, run.donttest
# Install and load stable version of the package
library(package, character.only = TRUE)
# Get the list of documentation pages
rd <- unique(readRDS(system.file("help", "aliases.rds", package = package)))
dir.create(path, showWarnings = FALSE)
lapply(
rd,
StoreTopicResults,
rd,
StoreTopicResults,
package, path, run.dontrun = run.dontrun, run.donttest = run.donttest
)
}
StoreTopicResults <- function(topic, package, path, run.dontrun = TRUE, run.donttest = TRUE) {
cat("*******************************\n")
cat("*", topic, "\n")
cat("*******************************\n")
......@@ -51,11 +51,11 @@ StoreTopicResults <- function(topic, package, path, run.dontrun = TRUE, run.dont
run.dontrun = run.dontrun, run.donttest = run.donttest
)
dev.off()
varAfter <- ls(envir = globalenv())
varToSave <- setdiff(varAfter, varBefore)
if(length(varToSave) > 0) {
path <- file.path(path, topic)
dir.create(path, showWarnings = FALSE, recursive = TRUE)
......@@ -63,8 +63,8 @@ StoreTopicResults <- function(topic, package, path, run.dontrun = TRUE, run.dont
saveRDS(get(x), file = file.path(path, paste0(x, ".rds")))
})
}
rm(list = varToSave, envir = globalenv())
}
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