Skip to content

Commit

Permalink
use in_covr() instead of env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Jan 4, 2022
1 parent ab72a41 commit 1e1e491
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 0 additions & 1 deletion R-package/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ sh build-cran-package.sh \
--no-build-vignettes

# Get coverage
LIGHTGBM_TEST_COVERAGE="true" \
Rscript -e " \
library(covr);
coverage <- covr::package_coverage('./lightgbm_r', type = 'tests', quiet = FALSE);
Expand Down
6 changes: 2 additions & 4 deletions R-package/tests/testthat/test_lgb.unloader.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ VERBOSITY <- as.integer(
Sys.getenv("LIGHTGBM_TEST_VERBOSITY", "-1")
)

CALCULATING_TEST_COVERAGE <- Sys.getenv("LIGHTGBM_TEST_COVERAGE") == "true"

test_that("lgb.unloader works as expected", {
testthat::skip_if(
condition = CALCULATING_TEST_COVERAGE
condition = covr::in_covr()
, message = "lgb.unloader() tests are skipped when calculating test coverage"
)
data(agaricus.train, package = "lightgbm")
Expand All @@ -31,7 +29,7 @@ test_that("lgb.unloader works as expected", {

test_that("lgb.unloader finds all boosters and removes them", {
testthat::skip_if(
condition = CALCULATING_TEST_COVERAGE
condition = covr::in_covr()
, message = "lgb.unloader() tests are skipped when calculating test coverage"
)
data(agaricus.train, package = "lightgbm")
Expand Down

0 comments on commit 1e1e491

Please sign in to comment.