Unverified Commit a65ba42c authored by James Lamb's avatar James Lamb Committed by GitHub
Browse files

[ci] [R-package] ensure that MSVC jobs fail when tests fail (fixes #5439) (#5448)

parent c3cf335c
...@@ -283,7 +283,10 @@ if ($env:R_BUILD_TYPE -eq "cmake") { ...@@ -283,7 +283,10 @@ if ($env:R_BUILD_TYPE -eq "cmake") {
if ($env:COMPILER -eq "MSVC") { if ($env:COMPILER -eq "MSVC") {
Write-Output "Running tests with testthat.R" Write-Output "Running tests with testthat.R"
cd R-package/tests cd R-package/tests
Run-R-Code-Redirect-Stderr "source('testthat.R')" ; Check-Output $? # NOTE: using Rscript.exe intentionally here, instead of Run-R-Code-Redirect-Stderr,
# because something about the interaction between Run-R-Code-Redirect-Stderr
# and testthat results in failing tests not exiting with a non-0 exit code.
Rscript.exe --vanilla "testthat.R" ; Check-Output $?
} }
Write-Output "No issues were found checking the R package" Write-Output "No issues were found checking the R package"
...@@ -218,6 +218,10 @@ test_that("lgb.Dataset: Dataset should be able to construct from matrix and retu ...@@ -218,6 +218,10 @@ test_that("lgb.Dataset: Dataset should be able to construct from matrix and retu
}) })
test_that("cpp errors should be raised as proper R errors", { test_that("cpp errors should be raised as proper R errors", {
testthat::skip_if(
Sys.getenv("COMPILER", "") == "MSVC" && as.integer(R.Version()[["major"]]) < 4L
, message = "Skipping on R 3.x and Visual Studio"
)
data(agaricus.train, package = "lightgbm") data(agaricus.train, package = "lightgbm")
train <- agaricus.train train <- agaricus.train
dtrain <- lgb.Dataset( dtrain <- lgb.Dataset(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment