File: helper-skip.R

package info (click to toggle)
r-cran-plotly 4.9.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 26,616 kB
  • sloc: javascript: 137,775; sh: 20; makefile: 6
file content (13 lines) | stat: -rw-r--r-- 738 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
# Some tests make plot.ly HTTP requests and require a valid user account
# (see test-plotly-filename.R). For security reasons, these tests should be 
# skipped on pull requests (the .travis.yml file uses encrypted credentials
# & encrypted environment vars cannot be accessed on pull request builds)
skip_if_not_master <- function() {
  if (is.na(Sys.getenv("plotly_username", NA))) {
    return(skip("Testing plot.ly API calls requires a plotly account"))
  }
  is_pr <- grepl("^[0-9]+$", Sys.getenv("TRAVIS_PULL_REQUEST"))
  is_r_release <- Sys.getenv("TRAVIS_R_VERSION_STRING", "release") == "release"
  if (!is_pr && is_r_release) return(invisible(TRUE))
  skip("plot.ly API calls are only tested on the master build on r-release")
}