Skip to content

Commit

Permalink
Update tests for #8 and docker version restriction
Browse files Browse the repository at this point in the history
  • Loading branch information
chainsawriot committed Mar 5, 2023
1 parent 13c6353 commit e93a881
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
6 changes: 5 additions & 1 deletion R/resolve.R
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,11 @@
if (isTRUE(no_enhances)) {
disabled_types <- c(disabled_types, "Enhances")
}
res <- dep_df[!dep_df$type %in% disabled_types & dep_df$y != "R" & !(dep_df$y %in% c("datasets", "utils", "grDevices", "graphics", "stats", "methods", "tools", "grid", "splines", "parallel", "stats4", "tcltk", "MASS", "nnet", "class", "spatial")),]
res <- dep_df[!dep_df$type %in% disabled_types &
dep_df$y != "R" & !(dep_df$y %in%
c("datasets", "utils", "grDevices", "graphics", "stats", "methods", "tools",
"grid", "splines", "parallel", "stats4", "tcltk", "MASS", "nnet", "class", "spatial",
"eda", "lqs", "mle", "modreg", "mva", "stepfun", "ts")),]
if (nrow(res) == 0) {
return(NULL)
}
Expand Down
Binary file added tests/testdata/superancientsna.RDS
Binary file not shown.
8 changes: 4 additions & 4 deletions tests/testthat/test_dockerize.R
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ test_that("Dockerize R < 3.1 and >= 2.1", {
expect_true(any(grepl("^RUN mkdir", Dockerfile)))
})

test_that("Docker R < 2.1", {
test_that("Docker R < 1.3.1", {
rang_rio <- readRDS("../testdata/rang_rio_old.RDS")
rang_rio$r_version <- "2.1.0" ## exactly 2.1.0, no error
rang_rio$r_version <- "1.3.1" ## exactly 1.3.1, no error
temp_dir <- .generate_temp_dir()
expect_error(dockerize(rang_rio, output_dir = temp_dir), NA)
rang_rio <- readRDS("../testdata/rang_rio_old.RDS")
## rang_rio$r_version <- "2.0.0"
## expect_error(dockerize(rang_rio, output_dir = temp_dir))
rang_rio$r_version <- "1.3.0"
expect_error(dockerize(rang_rio, output_dir = temp_dir))
})

test_that(".group_sysreqs and issue #21", {
Expand Down
5 changes: 5 additions & 0 deletions tests/testthat/test_expost_rang.R
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,8 @@ test_that("renv export unknown source", {
graph$ranglets[[1]]$original$x_pkgref <- "errr::or"
expect_error(export_rang(graph, temp_dir))
})

test_that("Super ancient special packages", {
graph <- readRDS("../testdata/superancientsna.RDS")
expect_error(.generate_installation_order(graph), NA)
})

0 comments on commit e93a881

Please sign in to comment.