Skip to content

Commit

Permalink
Add skip_on_ci() function (#826)
Browse files Browse the repository at this point in the history
Fixes #825
  • Loading branch information
mbjoseph authored and hadley committed Apr 1, 2019
1 parent 9711653 commit 9e72f98
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ export(skip_if_offline)
export(skip_if_translated)
export(skip_on_appveyor)
export(skip_on_bioc)
export(skip_on_ci)
export(skip_on_cran)
export(skip_on_os)
export(skip_on_travis)
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

* `skip_if_offline()` skips tests if an internet connection is not available
(#685).
* `skip_on_ci()` skips tests on continuous integration systems
(@mbjoseph, #825).

* Fixed an issue where `devtools::test()` could fail if run multiple times
within the same R session for a package containing Catch tests.
Expand Down
13 changes: 13 additions & 0 deletions R/skip.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
#' `skip_on_appveyor()` skips tests on appveyor by inspecting the
#' `APPVEYOR` environment variable.
#'
#'#' `skip_on_ci()` skips tests on continuous integration systems by inspecting
#' the `CI` environment variable.
#'
#' `skip_on_bioc()` skips tests on Bioconductor by inspecting the
#' `BBS_HOME` environment variable.
#'
Expand Down Expand Up @@ -163,6 +166,16 @@ skip_on_appveyor <- function() {
skip("On Appveyor")
}

#' @export
#' @rdname skip
skip_on_ci <- function() {
if (!isTRUE(as.logical(Sys.getenv("CI")))) {
return(invisible(TRUE))
}

skip("On CI")
}

#' @export
#' @rdname skip
skip_on_bioc <- function() {
Expand Down
6 changes: 6 additions & 0 deletions man/skip.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9e72f98

Please sign in to comment.