Skip to content

Commit

Permalink
Skip tests that may require internet
Browse files Browse the repository at this point in the history
  • Loading branch information
HDash committed Dec 18, 2024
1 parent de63e02 commit 7ca2469
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 9 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ Suggests:
tidyr,
DiagrammeR,
forcats,
arrow
arrow,
curl
Remotes:
github::monarch-initiative/monarchr,
github::phenoscape/rphenoscape,
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
## Bug fixes
* `DESCRIPTION`
- Update remote for `monarchr`.
* Tests
- Add `skip_if_offline` to tests that (may) require internet access.
* `ontology_to`
- `igraph::as_adj` (deprecated) -> `igraph::as_adjacency_matrix`.

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-filter_ontology.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip_if_offline()
test_that("filter_ontology works", {

ont <- get_ontology("hp")
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-get_monarch_models.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip_if_offline()
test_that("get_monarch_models works", {

models <- get_monarch_models()
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-get_ontology_levels.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip_if_offline()
test_that("get_ontology_levels works", {

hpo <- get_ontology("hp")
Expand Down
3 changes: 2 additions & 1 deletion tests/testthat/test-map_mondo.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
skip_if_offline()
test_that("map_mondo works", {

dat <- example_dat(rm_types="gene")
dat2 <- map_mondo(dat = dat, map_to = "hpo")
testthat::expect_true(methods::is(dat2,"data.table"))
Expand Down
9 changes: 5 additions & 4 deletions tests/testthat/test-map_ontology_terms.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip_if_offline()
test_that("map_ontology_terms works", {

ont <- get_ontology("hp")
Expand All @@ -6,8 +7,8 @@ test_that("map_ontology_terms works", {
"HP:0000002","HP:0000003")
term_names <- map_ontology_terms(ont=ont, terms=terms)
term_ids <- map_ontology_terms(ont=ont, terms=terms, to="id")


testthat::expect_true(
length(term_names)==length(terms)
)
Expand All @@ -16,8 +17,8 @@ test_that("map_ontology_terms works", {
)
testthat::expect_true(
all(names(term_names)==terms)
)
)
testthat::expect_true(
all(names(term_ids)==terms)
)
)
})
7 changes: 4 additions & 3 deletions tests/testthat/test-map_upheno.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
skip_if_offline()
test_that("map_upheno works", {

testthat::skip()

run_tests <- function(res){
testthat::expect_true(methods::is(res$data,"data.table"))
for(x in res$plots){
Expand All @@ -15,7 +16,7 @@ test_that("map_upheno works", {
# pheno_map_method="upheno",
terms = terms)
run_tests(res)

#### Use cached data and filter by HPO terms
res <- map_upheno(force_new = FALSE,
terms = terms)
Expand Down

0 comments on commit 7ca2469

Please sign in to comment.