Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] test 32-bit R in CI #3588

Merged
merged 3 commits into from
Nov 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ci/test_r_package_windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Download-File-With-Retries -url "https://github.com/microsoft/LightGBM/releases/

# Install R
Write-Output "Installing R"
Start-Process -FilePath R-win.exe -NoNewWindow -Wait -ArgumentList "/VERYSILENT /DIR=$env:R_LIB_PATH/R /COMPONENTS=main,x64" ; Check-Output $?
Start-Process -FilePath R-win.exe -NoNewWindow -Wait -ArgumentList "/VERYSILENT /DIR=$env:R_LIB_PATH/R /COMPONENTS=main,x64,i386" ; Check-Output $?
Write-Output "Done installing R"

Write-Output "Installing Rtools"
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/r_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ jobs:
###############
# CRAN builds #
###############
- os: windows-latest
task: r-package
compiler: MINGW
toolchain: MINGW
r_version: 3.6
build_type: cran
- os: windows-latest
task: r-package
compiler: MINGW
Expand Down
8 changes: 6 additions & 2 deletions R-package/tests/testthat/test_learning_to_rank.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ context("Learning to rank")
TOLERANCE <- 1e-06

ON_SOLARIS <- Sys.info()["sysname"] == "SunOS"
ON_32_BIT_WINDOWS <- .Platform$OS.type == "windows" && .Machine$sizeof.pointer != 8L

test_that("learning-to-rank with lgb.train() works as expected", {
set.seed(708L)
Expand Down Expand Up @@ -48,14 +49,17 @@ test_that("learning-to-rank with lgb.train() works as expected", {
}
expect_identical(sapply(eval_results, function(x) {x$name}), eval_names)
expect_equal(eval_results[[1L]][["value"]], 0.775)
if (!ON_SOLARIS) {
if (!(ON_SOLARIS || ON_32_BIT_WINDOWS)) {
expect_true(abs(eval_results[[2L]][["value"]] - 0.745986) < TOLERANCE)
expect_true(abs(eval_results[[3L]][["value"]] - 0.7351959) < TOLERANCE)
}
})

test_that("learning-to-rank with lgb.cv() works as expected", {
testthat::skip_if(ON_SOLARIS, message = "Skipping on Solaris")
testthat::skip_if(
ON_SOLARIS || ON_32_BIT_WINDOWS
, message = "Skipping on Solaris and 32-bit Windows"
)
set.seed(708L)
data(agaricus.train, package = "lightgbm")
# just keep a few features,to generate an model with imperfect fit
Expand Down