Skip to content

Commit

Permalink
skip on r-devel (even on linux...)
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentGuyader committed Jul 8, 2024
1 parent 6454db2 commit 32c2155
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 8 deletions.
8 changes: 6 additions & 2 deletions dev/flat_dock_from_renv.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,12 @@ writeLines(renv_file, file.path(dir_build, "renv.lock"))
# dock_from_renv ----
test_that("dock_from_renv works", {
# testthat::skip_on_cran()
# skip_if_not(interactive())
# Create Dockerfile
skip_if(is_rdevel, "skip on R-devel")
out <- dock_from_renv(
lockfile = the_lockfile,
FROM = "rocker/verse",
Expand Down Expand Up @@ -408,7 +410,7 @@ test_that("dock_from_renv works with full dependencies", {
# testthat::skip_on_cran()
# skip_if_not(interactive())
# Create Dockerfile
skip_if(is_rdevel, "skip on R-devel")
out <- dock_from_renv(
dependencies = TRUE,
lockfile = the_lockfile,
Expand Down Expand Up @@ -468,6 +470,8 @@ test_that("gen_base_image works", {
test_that("dock_from_renv works with specific renv", {
skip_if(is_rdevel, "skip on R-devel")
# testthat::skip_on_cran()
the_lockfile1.0.0 <- system.file("renv_with_1.0.0.lock",package = "dockerfiler")
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/setup_cache_dir.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ 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)
# is_debian <- grepl("debian", tolower(Sys.info()['release']))
3 changes: 3 additions & 0 deletions tests/testthat/test-dock_from_desc.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ withr::with_dir(
descdir,
{
test_that("dock_from_desc works", {

skip_if(is_rdevel, "skip on R-devel")

my_dock <- dock_from_desc(file.path(".", "DESCRIPTION__"))

expect_s3_class(my_dock, "R6")
Expand Down
18 changes: 12 additions & 6 deletions tests/testthat/test-dock_from_renv.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ writeLines(renv_file, file.path(dir_build, "renv.lock"))

# dock_from_renv ----
test_that("dock_from_renv works", {


# testthat::skip_on_cran()
# skip_if_not(interactive())
# Create Dockerfile

skip_if(is_rdevel, "skip on R-devel")
out <- dock_from_renv(
lockfile = the_lockfile,
FROM = "rocker/verse",
Expand Down Expand Up @@ -77,9 +79,11 @@ 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 @@ -115,7 +119,7 @@ test_that("dock_from_renv works with full dependencies", {
# testthat::skip_on_cran()
# skip_if_not(interactive())
# Create Dockerfile

skip_if(is_rdevel, "skip on R-devel")
out <- dock_from_renv(
dependencies = TRUE,
lockfile = the_lockfile,
Expand Down Expand Up @@ -175,6 +179,8 @@ test_that("gen_base_image works", {


test_that("dock_from_renv works with specific renv", {

skip_if(is_rdevel, "skip on R-devel")
# testthat::skip_on_cran()
the_lockfile1.0.0 <- system.file("renv_with_1.0.0.lock",package = "dockerfiler")

Expand Down Expand Up @@ -215,10 +221,10 @@ socle_install_version <- "remotes::install_version\\(\"renv\", version = \""
info = paste(lf," & ",renv_version))


}}



}}

})

1 change: 1 addition & 0 deletions tests/testthat/test-dockerbuild.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
n_temp <- tempdir()
file.copy("renv.lock", n_temp)
skip_if(is_rdevel, "skip on R-devel")
withr::with_dir(
n_temp,
{
Expand Down

0 comments on commit 32c2155

Please sign in to comment.