Skip to content

Commit

Permalink
only skip tests on non-GHA runs
Browse files Browse the repository at this point in the history
  • Loading branch information
bschilder committed Jan 2, 2024
1 parent da8b0b1 commit ab72b81
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion tests/testthat/test-bioc_r_versions.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
test_that("bioc_r_versions works", {
## Don't run on CRAN servers due to ongoing internet connectivity issues
testthat::skip_if_offline()
if(!is_gha()) testthat::skip_if_offline()

ver1 <- bioc_r_versions(bioc_version="devel")
testthat::expect_true(ver1$bioc>="3.17")
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-check_cont.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
test_that("check_cont works", {
## Don't run on CRAN servers due to ongoing internet connectivity issues
testthat::skip_if_offline()
if(!is_gha()) testthat::skip_if_offline()

testthat::expect_no_warning(
check_cont(cont = "bioconductor/bioconductor_docker:devel")
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-check_r_version.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
test_that("check_r_version works", {
## Don't run on CRAN servers due to ongoing internet connectivity issues
testthat::skip_if_offline()
if(!is_gha()) testthat::skip_if_offline()

testthat::expect_equal(
check_r_version(r = "4.1"),
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-construct_conda_yml.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ test_that("construct_conda_yml works", {
testthat::expect_true(file.exists(path2))

## Don't run on CRAN servers due to ongoing internet connectivity issues
testthat::skip_if_offline()
if(!is_gha()) testthat::skip_if_offline()

# conda <- conda_path()
out <- reticulate::conda_create(environment = path2,
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-construct_cont.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ test_that("construct_cont works", {
testthat::expect_null(cont3[[3]])

## Don't run on CRAN servers due to ongoing internet connectivity issues
testthat::skip_if_offline()
if(!is_gha()) testthat::skip_if_offline()

cont4 <- construct_cont(default_tag = "release",
default_registry = "ghcr.io",
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-construct_runners.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
test_that("construct_runners works", {
## Don't run on CRAN servers due to ongoing internet connectivity issues
testthat::skip_if_offline()
if(!is_gha()) testthat::skip_if_offline()

#### Set up tests ####
run_tests <- function(runners){
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-get_yaml.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
test_that("get_yaml works", {
testthat::skip_if_offline()
if(!is_gha()) testthat::skip_if_offline()

testthat::expect_type(
rworkflows:::get_yaml(template = "rworkflows"),
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-gha_python_versions.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
test_that("gha_python_versions works", {
## Don't run on CRAN servers due to ongoing internet connectivity issues
testthat::skip_if_offline()
if(!is_gha()) testthat::skip_if_offline()

testthat::expect_equal(gha_python_versions(python_version = "3.11"),"3.11")
testthat::expect_equal(gha_python_versions(python_version = "3.x"),"3.x")
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-url_exists.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
test_that("url_exists works", {
## Don't run on CRAN servers due to ongoing internet connectivity issues
testthat::skip_if_offline()
if(!is_gha()) testthat::skip_if_offline()

testthat::expect_true(
rworkflows:::url_exists("https://github.com/neurogenomics/rworkflows")
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-use_badges.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
test_that("use_badges works", {
testthat::skip_if_offline()
if(!is_gha()) testthat::skip_if_offline()

run_tests <- function(badges){
testthat::expect_length(badges,1)
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-use_workflow.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
test_that("use_workflow works", {
testthat::skip_if_offline()
if(!is_gha()) testthat::skip_if_offline()

path <- use_workflow(save_dir = file.path(tempdir(),".github","workflows"))
testthat::expect_true(file.exists(path))
Expand Down

0 comments on commit ab72b81

Please sign in to comment.