From a0c9475684639dbc897b78c2d73fc21eb04d0a93 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sun, 22 Nov 2020 01:47:58 +0000 Subject: [PATCH 1/3] [ci] test 32-bit R in CI --- .ci/test_r_package_windows.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index 5ab89f975eab..c538242f0590 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -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" From 0830a59d3cd1dca104b20cbc0d450ff2f9775864 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sun, 22 Nov 2020 01:59:27 +0000 Subject: [PATCH 2/3] add R 3.6 Windows CRAN job --- .github/workflows/r_package.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/r_package.yml b/.github/workflows/r_package.yml index 839ffeaaaa23..651cc8e7635d 100644 --- a/.github/workflows/r_package.yml +++ b/.github/workflows/r_package.yml @@ -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 From b799eb48cca40e4411e7903a967a32edddce6e7b Mon Sep 17 00:00:00 2001 From: James Lamb Date: Mon, 23 Nov 2020 09:53:47 -0600 Subject: [PATCH 3/3] add tests --- R-package/tests/testthat/test_learning_to_rank.R | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/R-package/tests/testthat/test_learning_to_rank.R b/R-package/tests/testthat/test_learning_to_rank.R index 5ab4a391bd84..d4f573710cfd 100644 --- a/R-package/tests/testthat/test_learning_to_rank.R +++ b/R-package/tests/testthat/test_learning_to_rank.R @@ -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) @@ -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