diff --git a/integration_tests/Rprofile b/integration_tests/Rprofile index 104c5c2..8ac4dd2 100644 --- a/integration_tests/Rprofile +++ b/integration_tests/Rprofile @@ -1,3 +1,7 @@ +.First <- function(){ + .libPaths("/root/rpackages") +} + local({ r <- getOption("repos") r["CRAN"] <- "http://localhost:8080/repository/cran-proxy" diff --git a/integration_tests/tests/cran.bats b/integration_tests/tests/cran.bats index cf2e5b4..ad42d81 100644 --- a/integration_tests/tests/cran.bats +++ b/integration_tests/tests/cran.bats @@ -1,20 +1,31 @@ +setup() { + mkdir /root/rpackages +} + +teardown() { + rm -rf /root/rpackages +} + @test "Install data.table" { - Rscript -e 'install.packages("data.table")' + run Rscript -e 'install.packages("data.table")' + [[ "$output" == *"package ‘data.table’ successfully unpacked and MD5 sums checked"* ]] } @test "Install archived version of data.table" { - Rscript -e 'packagename <- "data.table" + run Rscript -e 'packagename <- "data.table" version <- "1.13.0" # or 1.12.0 packageurl <- paste0(contrib.url(getOption("repos")), "/Archive/", packagename, "/", packagename, "_", version, ".tar.gz") install.packages(packageurl, repos=NULL, type="source") ' + [[ "$output" == *"package ‘data.table’ successfully unpacked and MD5 sums checked"* ]] } @test "Install archived version of data.table using remotes" { - Rscript -e ' + run Rscript -e ' install.packages("remotes") remotes::install_version("data.table", version = "1.13.0") ' + [[ "$output" == *"package ‘data.table’ successfully unpacked and MD5 sums checked"* ]] } @test "Install ggplot2" { diff --git a/integration_tests/tests/pypi.bats b/integration_tests/tests/pypi.bats index 9435c5a..9188d73 100644 --- a/integration_tests/tests/pypi.bats +++ b/integration_tests/tests/pypi.bats @@ -1,13 +1,19 @@ +setup () { + python3 -m venv /root/venv + . /root/venv/bin/activate +} + +teardown() { + deactivate + rm -rf /root/venv +} + @test "Install numpy" { - python3 -m venv ./venv - . ./venv/bin/activate pip install numpy } @test "Install mkdocs" { bats_require_minimum_version 1.5.0 - python3 -m venv ./venv - . ./venv/bin/activate run ! pip install mkdocs [ "$status" -eq 1 ] [[ "$output" == *"HTTP error 403"* ]]