Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
Remove SVN tests, they used GitHub, which does not support
SVN any more.
  • Loading branch information
gaborcsardi committed Mar 16, 2024
1 parent 627fec4 commit 16f0ea9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 96 deletions.
82 changes: 0 additions & 82 deletions tests/testthat/test-install-svn.R
Original file line number Diff line number Diff line change
@@ -1,66 +1,3 @@
test_that("install_svn", {

skip_on_cran()
skip_if_offline()

Sys.unsetenv("R_TESTS")

lib <- tempfile()
on.exit(unlink(lib, recursive = TRUE), add = TRUE)
dir.create(lib)

url <- "https://github.com/mangothecat/simplegraph/trunk"
install_svn(url, lib = lib, quiet = TRUE)

expect_silent(packageDescription("simplegraph", lib.loc = lib))
expect_equal(
packageDescription("simplegraph", lib.loc = lib)$RemoteType,
"svn")

remote <- package2remote("simplegraph", lib = lib)
expect_s3_class(remote, "remote")
expect_s3_class(remote, "svn_remote")
expect_equal(format(remote), "SVN")
expect_equal(remote$url, url)
expect_equal(remote$svn_subdir, NULL)
expect_true(!is.na(remote$revision) && nzchar(remote$revision))
expect_equal(remote$args, NULL)
})

test_that("install_svn branch", {

skip_on_cran()
skip_if_offline()

Sys.unsetenv("R_TESTS")

lib <- tempfile()
on.exit(unlink(lib, recursive = TRUE), add = TRUE)
dir.create(lib)

url <- "https://github.com/mangothecat/simplegraph"
install_svn(
url,
subdir = "branches/remotes-test",
lib = lib,
quiet = TRUE
)

expect_silent(packageDescription("simplegraph", lib.loc = lib))
expect_equal(
packageDescription("simplegraph", lib.loc = lib)$RemoteType,
"svn")

remote <- package2remote("simplegraph", lib = lib)
expect_s3_class(remote, "remote")
expect_s3_class(remote, "svn_remote")
expect_equal(format(remote), "SVN")
expect_equal(remote$url, url)
expect_equal(remote$svn_subdir, "branches/remotes-test")
expect_true(!is.na(remote$revision) && nzchar(remote$revision))
expect_equal(remote$args, NULL)
})

test_that("install_svn subdir", {

skip_on_cran()
Expand Down Expand Up @@ -98,25 +35,6 @@ test_that("remote_download.svn_remote error", {
)
})

test_that("downloading an SVN revision", {

skip_on_cran()
skip_if_offline()

x <- list(
url = "https://github.com/mangothecat/simplegraph/trunk",
revision = "r28"
)

bundle <- remote_download.svn_remote(x)
on.exit(unlink(bundle), add = TRUE)

expect_output(
print(list.files(bundle)),
"DESCRIPTION"
)
})

test_that("downloading a wrong SVN revision", {

skip_on_cran()
Expand Down
17 changes: 3 additions & 14 deletions tests/testthat/test-system_requirements.R
Original file line number Diff line number Diff line change
Expand Up @@ -193,23 +193,13 @@ test_that("system_requirements work with vector package arguments", {
)
})

test_that("system_requirements errors for a single non-existing CRAN package", {
test_that("system_requirements empty for a single non-existing CRAN package", {
skip_on_cran()
skip_if_offline()

expect_error(
expect_equal(
system_requirements("ubuntu", "16.04", package = c("iDontExist")),
"Could not locate package 'iDontExist'", fixed = TRUE
)
})

test_that("system_requirements errors for multiple packages when one does not exist", {
skip_on_cran()
skip_if_offline()

expect_error(
system_requirements("ubuntu", "16.04", package = c("curl", "iDontExist")),
"Could not locate package 'iDontExist'", fixed = TRUE
character()
)
})

Expand All @@ -224,4 +214,3 @@ test_that("system_requirements allow specifying os_release within os", {
)
)
})

0 comments on commit 16f0ea9

Please sign in to comment.