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
c5d9d243
Unverified
Commit
c5d9d243
authored
Nov 23, 2020
by
James Lamb
Committed by
GitHub
Nov 23, 2020
Browse files
[ci] test 32-bit R in CI (#3588)
* [ci] test 32-bit R in CI * add R 3.6 Windows CRAN job * add tests
parent
52859744
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
3 deletions
+13
-3
.ci/test_r_package_windows.ps1
.ci/test_r_package_windows.ps1
+1
-1
.github/workflows/r_package.yml
.github/workflows/r_package.yml
+6
-0
R-package/tests/testthat/test_learning_to_rank.R
R-package/tests/testthat/test_learning_to_rank.R
+6
-2
No files found.
.ci/test_r_package_windows.ps1
View file @
c5d9d243
...
...
@@ -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"
...
...
.github/workflows/r_package.yml
View file @
c5d9d243
...
...
@@ -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
...
...
R-package/tests/testthat/test_learning_to_rank.R
View file @
c5d9d243
...
...
@@ -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
...
...
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