From 16f0ea97106d8fe5183d8c22604b70a2ec34c3cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Cs=C3=A1rdi?= Date: Sat, 16 Mar 2024 22:07:49 +0100 Subject: [PATCH] Fix failing tests Remove SVN tests, they used GitHub, which does not support SVN any more. --- tests/testthat/test-install-svn.R | 82 ----------------------- tests/testthat/test-system_requirements.R | 17 +---- 2 files changed, 3 insertions(+), 96 deletions(-) diff --git a/tests/testthat/test-install-svn.R b/tests/testthat/test-install-svn.R index 099bce5b..fa7a3c77 100644 --- a/tests/testthat/test-install-svn.R +++ b/tests/testthat/test-install-svn.R @@ -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() @@ -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() diff --git a/tests/testthat/test-system_requirements.R b/tests/testthat/test-system_requirements.R index 002d4cba..e2eae342 100644 --- a/tests/testthat/test-system_requirements.R +++ b/tests/testthat/test-system_requirements.R @@ -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() ) }) @@ -224,4 +214,3 @@ test_that("system_requirements allow specifying os_release within os", { ) ) }) -