cr_buildstep_packagetests: Do R package tests and upload to Codecov

View source: R/buildsteps_templates.R

cr_buildstep_packagetestsR Documentation

Do R package tests and upload to Codecov

Description

This lets you run R package tests and is intended to be used in a trigger when you push to a repository so you can monitor code quality.

Usage

cr_buildstep_packagetests(
  test_script = NULL,
  codecov_script = NULL,
  codecov_token = "$_CODECOV_TOKEN",
  build_image = "gcr.io/gcer-public/packagetools:latest",
  env = c("NOT_CRAN=true")
)

Arguments

test_script

The script that will call rcmdcheck to perform tests. If NULL a default script is used in system.file("r_buildsteps", "devtools_tests.R", package="googlecloudRunner")

codecov_script

The script that will call codecov to perform coverage. If NULL a default script is used in system.file("r_buildsteps", "codecov_tests.R", package="googleCloudRunner")

codecov_token

If using codecov, supply your codecov token here.

build_image

The docker image that will be used to run the R code for the test scripts

env

Environment arguments to be set during the test script runs

Details

If using codecov, these environment arguments are added to aid with the codecoverage:

* "CODECOV_TOKEN=$_CODECOV_TOKEN" * "GCB_PROJECT_ID=$PROJECT_ID" * "GCB_BUILD_ID=$BUILD_ID" * "GCB_COMMIT_SHA=$COMMIT_SHA" * "GCB_REPO_NAME=$REPO_NAME" * "GCB_BRANCH_NAME=$BRANCH_NAME" * "GCB_TAG_NAME=$TAG_NAME" * "GCB_HEAD_BRANCH=$_HEAD_BRANCH" * "GCB_BASE_BRANCH=$_BASE_BRANCH" * "GCB_HEAD_REPO_URL=$_HEAD_REPO_URL" * "GCB_PR_NUMBER=$_PR_NUMBER"

See Also

https://docs.codecov.com/reference

Other Cloud Buildsteps: cr_buildstep_bash(), cr_buildstep_decrypt(), cr_buildstep_df(), cr_buildstep_docker(), cr_buildstep_edit(), cr_buildstep_extract(), cr_buildstep_gcloud(), cr_buildstep_gitsetup(), cr_buildstep_mailgun(), cr_buildstep_nginx_setup(), cr_buildstep_pkgdown(), cr_buildstep_run(), cr_buildstep_r(), cr_buildstep_secret(), cr_buildstep_slack(), cr_buildstep_targets(), cr_buildstep()

Examples


cr_buildstep_packagetests()

googleCloudRunner documentation built on March 18, 2022, 8 p.m.