Skip to content

Commit

Permalink
Add tests for installing archived CRAN packages
Browse files Browse the repository at this point in the history
  • Loading branch information
JimMadge committed Aug 9, 2024
1 parent 1fb7fc4 commit 28deb56
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions allowlists/cran.allowlist
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
cli
data.table
remotes
15 changes: 15 additions & 0 deletions integration_tests/tests/cran.bats
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@
Rscript -e 'install.packages("data.table")'
}

@test "Install archived version of data.table" {
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")
'
}

@test "Install archived version of data.table using remotes" {
Rscript -e '
install.packages("remotes")
remotes::install_version("data.table", version = "1.13.0")
'
}

@test "Install ggplot2" {
run Rscript -e 'install.packages("ggplot2")'
[[ "$output" == *"download of package ‘ggplot2’ failed"* ]]
Expand Down

0 comments on commit 28deb56

Please sign in to comment.