RMI / RMI/resources

Skip a test on check() but not test()

Open
#293 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

ci/cd unit-testting
Dominant language
No language data
Stars
17
Forks
5
PR merge metrics
No merged PRs in 30d

Description

Saving this here to make it more discoverable -- I found it hard to find that R CMD check sets the environment var "R_CMD".

skip_if_R_CMD_check <- function() {
  if (!nzchar(Sys.getenv("R_CMD"))) {
    return(invisible(TRUE))
  }

  skip("Not run in R CMD check")
}

https://github.com/2DegreesInvesting/PACTA_analysis/blob/master/R/skip_if_R_CMD_check.R

Thanks @cjyetman
cc' @MirijaHa

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the issue body and compare the proposed skip_if_R_CMD_check function with the referenced R/skip_if_R_CMD_check.R file in PACTA_analysis. Determine whether resources has a specific test or integration point for applying this behavior; done should be defined before implementation because the issue does not identify a target file or requested change.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.