Skip to content

Commit

Permalink
don't eval vignettes on CRAN
Browse files Browse the repository at this point in the history
close #561
  • Loading branch information
wibeasley committed Jan 10, 2025
1 parent bac319a commit eb2d75c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions R/skippers.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,15 @@ skip_if_onlyread <- function() {

testthat::skip("Skipping test if only server reads/exports are used. (And server writes/imports are skipped.)" )
}

# These internal/nonvisible function is copied from
# https://github.com/r-lib/testthat/blob/690fdb87ed8db5411ef80c0d041a188853cd7050/R/skip.R#L257
on_cran <- function() {
!interactive() && !env_var_is_true("NOT_CRAN")
}

# These internal/invisible function is copied from
# https://github.com/r-lib/testthat/blob/690fdb87ed8db5411ef80c0d041a188853cd7050/R/skip.R#L257
env_var_is_true <- function(x) {
isTRUE(as.logical(Sys.getenv(x, "false")))
}
1 change: 1 addition & 0 deletions vignettes/BasicREDCapROperations.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ library(magrittr)
requireNamespace("kableExtra")
opts_chunk$set(
eval = !REDCapR:::on_cran(),
collapse = TRUE,
comment = "#>",
tidy = FALSE
Expand Down
1 change: 1 addition & 0 deletions vignettes/advanced-redcapr-operations.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ library(magrittr)
suppressPackageStartupMessages(requireNamespace("kableExtra"))
opts_chunk$set(
eval = !REDCapR:::on_cran(),
comment = "#>",
tidy = FALSE
)
Expand Down
1 change: 1 addition & 0 deletions vignettes/longitudinal-and-repeating.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ vignette: >
#| include = FALSE
library(knitr)
knitr::opts_chunk$set(
eval = !REDCapR:::on_cran(),
collapse = TRUE,
comment = "#>",
tidy = FALSE
Expand Down
1 change: 1 addition & 0 deletions vignettes/workflow-read.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ vignette: >
```{r}
#| include = FALSE
knitr::opts_chunk$set(
eval = !REDCapR:::on_cran(),
collapse = TRUE,
comment = "#>",
tidy = FALSE
Expand Down

0 comments on commit eb2d75c

Please sign in to comment.