Skip to content

Commit e412dfa

Browse files
committed
skip all on cran - do not render vignette
1 parent 0075e08 commit e412dfa

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

tests/testthat/test_pingNeotoma.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ library("neotoma2")
33

44
context("Ping Neotoma API to check availability")
55
test_that("The Pings work", {
6+
skip_on_cran()
67
ping_head <- try(httr::HEAD("https://api.neotomadb.org"))
78
ping_call <- try(pingNeotoma("neotoma"))
89
testthat::expect_equal(ping_head$status_code,

tests/testthat/test_set_server.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ library("neotoma2")
33

44
context("Switching servers works between local, dev and neotoma APIs.")
55
testthat::test_that("`Switching server with `set_server()`.", {
6+
skip_on_cran()
67
set_server("dev")
78
testthat::expect_true(Sys.getenv("APIPOINT") == "dev")
89
set_server("local")
@@ -12,5 +13,6 @@ testthat::test_that("`Switching server with `set_server()`.", {
1213
})
1314

1415
testthat::test_that("Invalid server throws error.", {
16+
skip_on_cran()
1517
testthat::expect_error(set_server("invalid_server_name"))
1618
})

vignettes/neotoma2-package.Rmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ if (res$status_code == 200) {
2525
api_available <- TRUE
2626
}
2727
# Disable evaluation globally if API is down
28-
knitr::opts_chunk$set(eval = api_available,
28+
knitr::opts_chunk$set(eval = FALSE,
2929
error = TRUE)
3030
```
3131

32-
```{r setup_md, include=FALSE,error=TRUE}
32+
```{r setup_md, include=FALSE, error=TRUE}
3333
safe_eval <- function(expr, fallback = "N/A") {
3434
tryCatch(eval(expr, envir = .GlobalEnv), error = function(e) fallback)
3535
}
@@ -89,7 +89,7 @@ All sites in Neotoma have a unique numeric identifier. With the `neotoma2` pack
8989

9090
If we're looking for a site and we know its specific identifier, we can use the simplest implementation of `get_sites()`. Here we are searching for a site (Alexander Lake), where we know that the siteid for the record in Neotoma is `24`. We can get these siteids using the [Neotoma Explorer web application](https://apps.neotomadb.org/explorer/), or if we have some familiarity with the site records already.
9191

92-
```{r getSiteBySiteID, error=TRUE}
92+
```{r getSiteBySiteID, error=TRUE, eval=FALSE}
9393
# Search for site by a single numeric ID:
9494
alex <- get_sites(24)
9595
alex

0 commit comments

Comments
 (0)