Skip to content

Commit 6e3d85e

Browse files
authored
Merge pull request #621 from remlapmot/devel
Allow toggling of tests that require OpenGWAS access
2 parents b87d8e1 + fb40f30 commit 6e3d85e

File tree

13 files changed

+23
-4
lines changed

13 files changed

+23
-4
lines changed

.github/workflows/check-full.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
strategy:
2727
fail-fast: false
28-
max-parallel: 2
28+
# max-parallel: 2
2929
matrix:
3030
config:
3131
- {os: macos-latest, r: 'release'}

.github/workflows/test-coverage.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
on:
44
push:
55
branches: [main, master]
6-
pull_request:
7-
branches: [main, master]
6+
# pull_request:
7+
# branches: [main, master]
88
workflow_dispatch:
99

1010
name: test-coverage
@@ -18,6 +18,7 @@ jobs:
1818
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1919
OPENGWAS_X_TEST_MODE_KEY: ${{ secrets.OPENGWAS_X_TEST_MODE_KEY }}
2020
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
21+
TWOSAMPLEMR_ENABLE_OPENGWAS_TESTS: TRUE
2122

2223
steps:
2324
- uses: actions/checkout@v4
@@ -34,6 +35,7 @@ jobs:
3435
- name: Create and populate .Renviron file
3536
run: |
3637
echo OPENGWAS_X_TEST_MODE_KEY="$OPENGWAS_X_TEST_MODE_KEY" >> ~/.Renviron
38+
echo TWOSAMPLEMR_ENABLE_OPENGWAS_TESTS="$TWOSAMPLEMR_ENABLE_OPENGWAS_TESTS" >> ~/.Renviron
3739
shell: bash
3840

3941
- name: Test coverage

TwoSampleMR.Rproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ RnwWeave: Sweave
1414
LaTeX: pdfLaTeX
1515

1616
AutoAppendNewline: Yes
17+
StripTrailingWhitespace: Yes
1718

1819
BuildType: Package
1920
PackageUseDevtools: Yes

tests/testthat/test_add_metadata.r

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
context("add metadata")
22

3+
skip_if(Sys.getenv('TWOSAMPLEMR_ENABLE_OPENGWAS_TESTS') != TRUE, "Tests requiring OpenGWAS")
34
skip_if_offline()
45
skip_if_offline(host = "api.opengwas.io")
56
skip_on_cran()

tests/testthat/test_create_test_data.r

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
test_that("Create local data", {
2+
skip_if(Sys.getenv('TWOSAMPLEMR_ENABLE_OPENGWAS_TESTS') != TRUE, "Tests requiring OpenGWAS")
23
skip("Skip local data creation unless you have good access to the API.")
34

45
exp_dat <- extract_instruments("ieu-a-2")

tests/testthat/test_instruments.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
context("Instruments")
22

3+
skip_if(Sys.getenv('TWOSAMPLEMR_ENABLE_OPENGWAS_TESTS') != TRUE, "Tests requiring OpenGWAS")
34
skip_if_offline()
45
skip_if_offline(host = "api.opengwas.io")
56
skip_on_cran()

tests/testthat/test_ld.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
context("ld")
22

3+
skip_if(Sys.getenv('TWOSAMPLEMR_ENABLE_OPENGWAS_TESTS') != TRUE, "Tests requiring OpenGWAS")
34
skip_if_offline()
45
skip_if_offline(host = "api.opengwas.io")
56
skip_on_cran()

tests/testthat/test_ldsc.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
context("LDSC")
22

3-
43
test_that("get afl2", {
4+
skip_if(Sys.getenv('TWOSAMPLEMR_ENABLE_OPENGWAS_TESTS') != TRUE, "Tests requiring OpenGWAS")
55
skip("Very slow")
66
hm3info <- ieugwasr::afl2_list("hapmap3")
77
if(inherits(hm3info, "response")) skip("Server issues")

tests/testthat/test_mvmr.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
context("mvmr")
22

3+
skip_if(Sys.getenv('TWOSAMPLEMR_ENABLE_OPENGWAS_TESTS') != TRUE, "Tests requiring OpenGWAS")
34
skip_on_cran()
45
skip_if_offline()
56
skip_if_offline(host = "api.opengwas.io")

tests/testthat/test_mvmr_local.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ context("mvmr local")
1010
load(system.file("extdata", "test_add_mvmr_local.RData", package="TwoSampleMR"))
1111

1212
test_that("mv exposure local", {
13+
skip_if(Sys.getenv('TWOSAMPLEMR_ENABLE_OPENGWAS_TESTS') != TRUE, "Tests requiring OpenGWAS")
1314
skip_if_offline()
1415
skip_if_offline(host = "api.opengwas.io")
1516
skip_on_cran()

0 commit comments

Comments
 (0)