Skip to content

Commit

Permalink
Skip R-devel
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentGuyader committed Jul 4, 2024
1 parent 728d791 commit 6454db2
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 17 deletions.
9 changes: 6 additions & 3 deletions dev/flat_dock_from_renv.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,7 @@ test_that("dock_from_renv works", {
out,
"R6"
)
#python3 is not a direct dependencies from custom_packages
expect_false( any(grepl("python3",out$Dockerfile)))
# read Dockerfile
out$write(
Expand All @@ -370,7 +369,10 @@ test_that("dock_from_renv works", {
1
)
skip_if(is_rdevel, "Skip R-devel")
#python3 is not a direct dependencies from custom_packages
expect_false( any(grepl("python3",out$Dockerfile)))
# System dependencies are different when build in interactive environment?
# yes. strange.
skip_if_not(interactive())
Expand Down Expand Up @@ -420,6 +422,7 @@ test_that("dock_from_renv works with full dependencies", {
out,
"R6"
)
skip_if(is_rdevel, "Skip R-devel")
#python3 is a un-direct dependencies from custom_packages
expect_true( any(grepl("python3",out$Dockerfile)))
})
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/setup_cache_dir.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
R_USER_CACHE_DIR<-tempfile()
dir.create(R_USER_CACHE_DIR)
Sys.setenv("R_USER_CACHE_DIR"=R_USER_CACHE_DIR)
r_version <- R.Version()$version.string
is_rdevel <- grepl("unstable", r_version)
28 changes: 22 additions & 6 deletions tests/testthat/test-dock_from_desc.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,8 @@ withr::with_dir(
tpf
)
)
expect_true(
grepl(
"apt-get update && apt-get install",
tpf
)
)


expect_true(
grepl(
"mkdir /build_zone",
Expand Down Expand Up @@ -92,6 +88,26 @@ withr::with_dir(
# Only if package I guess
# expect_true(file.exists(file.path(descdir, ".Rbuildignore")))
expect_true(file.exists(file.path(descdir, ".dockerignore")))









skip_if(is_rdevel, "Skippé sous R-devel")

expect_true(
grepl(
"apt-get update && apt-get install",
tpf
)
)



})
}
)
17 changes: 9 additions & 8 deletions tests/testthat/test-dock_from_renv.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ test_that("dock_from_renv works", {
out,
"R6"
)
#python3 is not a direct dependencies from custom_packages
expect_false( any(grepl("python3",out$Dockerfile)))


# read Dockerfile
out$write(
Expand All @@ -78,8 +77,9 @@ test_that("dock_from_renv works", {
grep("RUN R -e 'renv::restore\\(\\)'", dock_created),
1
)


skip_if(is_rdevel, "Skip R-devel")
#python3 is not a direct dependencies from custom_packages
expect_false( any(grepl("python3",out$Dockerfile)))
# System dependencies are different when build in interactive environment?
# yes. strange.
skip_if_not(interactive())
Expand Down Expand Up @@ -129,6 +129,7 @@ test_that("dock_from_renv works with full dependencies", {
out,
"R6"
)
skip_if(is_rdevel, "Skip R-devel")
#python3 is a un-direct dependencies from custom_packages
expect_true( any(grepl("python3",out$Dockerfile)))
})
Expand Down Expand Up @@ -214,10 +215,10 @@ socle_install_version <- "remotes::install_version\\(\"renv\", version = \""
info = paste(lf," & ",renv_version))


}}
}}




})

1 change: 1 addition & 0 deletions tests/testthat/test-get_sysreqs.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
test_that("get_sysreqs works", {
skip_on_cran()
skip_if(is_rdevel, "Skip R-devel")
res <- get_sysreqs(
c("mongolite"),
quiet = TRUE
Expand Down

0 comments on commit 6454db2

Please sign in to comment.