Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
a65ba42c
Unverified
Commit
a65ba42c
authored
Sep 12, 2022
by
James Lamb
Committed by
GitHub
Sep 12, 2022
Browse files
[ci] [R-package] ensure that MSVC jobs fail when tests fail (fixes #5439) (#5448)
parent
c3cf335c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
.ci/test_r_package_windows.ps1
.ci/test_r_package_windows.ps1
+4
-1
R-package/tests/testthat/test_dataset.R
R-package/tests/testthat/test_dataset.R
+4
-0
No files found.
.ci/test_r_package_windows.ps1
View file @
a65ba42c
...
@@ -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"
R-package/tests/testthat/test_dataset.R
View file @
a65ba42c
...
@@ -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
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment