Skip to content

Commit 0174b55

Browse files
committed
skip xgb tests
1 parent 00fa075 commit 0174b55

File tree

5 files changed

+33
-1
lines changed

5 files changed

+33
-1
lines changed

tests/testthat/test-boost_tree.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ test_that('argument checks for data dimensions', {
3737
})
3838

3939
test_that('boost_tree can be fit with 1 predictor if validation is used', {
40+
skip_on_cran()
4041
spec <- boost_tree(trees = 1) %>%
4142
set_engine("xgboost", validation = 0.5) %>%
4243
set_mode("regression")
@@ -48,6 +49,7 @@ test_that('boost_tree can be fit with 1 predictor if validation is used', {
4849

4950
test_that("check_args() works", {
5051
skip_if_not_installed("xgboost")
52+
skip_on_cran()
5153

5254
expect_snapshot(
5355
error = TRUE,

tests/testthat/test-boost_tree_xgboost.R

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ hpc_xgboost <-
99
# ------------------------------------------------------------------------------
1010

1111
test_that('xgboost execution, classification', {
12-
1312
skip_if_not_installed("xgboost")
13+
skip_on_cran()
1414

1515
ctrl$verbosity <- 0L
1616

@@ -80,6 +80,7 @@ test_that('xgboost execution, classification', {
8080
test_that('xgboost classification prediction', {
8181

8282
skip_if_not_installed("xgboost")
83+
skip_on_cran()
8384

8485
library(xgboost)
8586

@@ -130,6 +131,7 @@ bad_rf_reg <-
130131
test_that('xgboost execution, regression', {
131132

132133
skip_if_not_installed("xgboost")
134+
skip_on_cran()
133135

134136
ctrl$verbosity <- 0L
135137

@@ -158,6 +160,7 @@ test_that('xgboost execution, regression', {
158160
test_that('xgboost regression prediction', {
159161

160162
skip_if_not_installed("xgboost")
163+
skip_on_cran()
161164

162165
ctrl$verbosity <- 0L
163166

@@ -189,6 +192,7 @@ test_that('xgboost regression prediction', {
189192

190193
test_that('xgboost alternate objective', {
191194
skip_if_not_installed("xgboost")
195+
skip_on_cran()
192196

193197
ctrl$verbosity <- 0L
194198

@@ -224,6 +228,7 @@ test_that('xgboost alternate objective', {
224228
test_that('submodel prediction', {
225229

226230
skip_if_not_installed("xgboost")
231+
skip_on_cran()
227232

228233
ctrl$verbosity <- 0L
229234

@@ -264,6 +269,7 @@ test_that('submodel prediction', {
264269

265270
test_that('validation sets', {
266271
skip_if_not_installed("xgboost")
272+
skip_on_cran()
267273

268274
ctrl$verbosity <- 0L
269275

@@ -309,6 +315,7 @@ test_that('validation sets', {
309315

310316
test_that('early stopping', {
311317
skip_if_not_installed("xgboost")
318+
skip_on_cran()
312319

313320
ctrl$verbosity <- 0L
314321

@@ -350,6 +357,7 @@ test_that('early stopping', {
350357

351358
test_that('xgboost data conversion', {
352359
skip_if_not_installed("xgboost")
360+
skip_on_cran()
353361

354362
mtcar_x <- mtcars[, -1]
355363
mtcar_mat <- as.matrix(mtcar_x)
@@ -412,6 +420,7 @@ test_that('xgboost data conversion', {
412420

413421
test_that('xgboost data and sparse matrices', {
414422
skip_if_not_installed("xgboost")
423+
skip_on_cran()
415424

416425
ctrl$verbosity <- 0L
417426

@@ -459,6 +468,7 @@ test_that('xgboost data and sparse matrices', {
459468
test_that('argument checks for data dimensions', {
460469

461470
skip_if_not_installed("xgboost")
471+
skip_on_cran()
462472

463473
ctrl$verbosity <- 0L
464474

@@ -489,6 +499,7 @@ test_that('argument checks for data dimensions', {
489499
test_that("fit and prediction with `event_level`", {
490500

491501
skip_if_not_installed("xgboost")
502+
skip_on_cran()
492503

493504
ctrl$verbosity <- 0L
494505

@@ -554,6 +565,7 @@ test_that("fit and prediction with `event_level`", {
554565

555566
test_that("count/proportion parameters", {
556567
skip_if_not_installed("xgboost")
568+
skip_on_cran()
557569

558570
ctrl$verbosity <- 0L
559571

@@ -602,6 +614,7 @@ test_that("count/proportion parameters", {
602614
test_that('interface to param arguments', {
603615
skip_if_not_installed("xgboost")
604616
skip_on_os("windows") # some snapshots different on windows (added spaces)
617+
skip_on_cran()
605618

606619
ctrl$verbosity <- 0L
607620

tests/testthat/test-descriptors.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ test_that("can be temporarily overriden at evaluation time", {
199199

200200
test_that("system-level descriptor tests", {
201201
skip_if_not_installed("xgboost")
202+
skip_on_cran()
203+
202204
expect_no_condition(
203205
boost_tree(mode = "regression", mtry = .cols()) %>%
204206
set_engine("xgboost") %>%

tests/testthat/test-predict_formats.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ test_that('non-factor classification', {
154154

155155
test_that("predict() works for model fit with fit_xy() (#1166)", {
156156
skip_if_not_installed("xgboost")
157+
skip_on_cran()
157158

158159
spec <- boost_tree() %>%
159160
set_mode("regression") %>%

tests/testthat/test-sparsevctrs.R

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
test_that("sparse tibble can be passed to `fit() - supported", {
22
skip_if_not_installed("xgboost")
3+
skip_on_cran()
4+
35
# Make materialization of sparse vectors throw an error
46
# https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html
57
withr::local_options("sparsevctrs.verbose_materialize" = 3)
@@ -30,6 +32,8 @@ test_that("sparse tibble can be passed to `fit() - unsupported", {
3032

3133
test_that("sparse matrix can be passed to `fit() - supported", {
3234
skip_if_not_installed("xgboost")
35+
skip_on_cran()
36+
3337
# Make materialization of sparse vectors throw an error
3438
# https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html
3539
withr::local_options("sparsevctrs.verbose_materialize" = 3)
@@ -61,6 +65,8 @@ test_that("sparse matrix can be passed to `fit() - unsupported", {
6165

6266
test_that("sparse tibble can be passed to `fit_xy() - supported", {
6367
skip_if_not_installed("xgboost")
68+
skip_on_cran()
69+
6470
# Make materialization of sparse vectors throw an error
6571
# https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html
6672
withr::local_options("sparsevctrs.verbose_materialize" = 3)
@@ -90,6 +96,8 @@ test_that("sparse tibble can be passed to `fit_xy() - unsupported", {
9096

9197
test_that("sparse matrices can be passed to `fit_xy() - supported", {
9298
skip_if_not_installed("xgboost")
99+
skip_on_cran()
100+
93101
# Make materialization of sparse vectors throw an error
94102
# https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html
95103
withr::local_options("sparsevctrs.verbose_materialize" = 3)
@@ -193,6 +201,8 @@ test_that("sparse matrices can be passed to `predict() - unsupported", {
193201

194202
test_that("sparse data work with xgboost engine", {
195203
skip_if_not_installed("xgboost")
204+
skip_on_cran()
205+
196206
# Make materialization of sparse vectors throw an error
197207
# https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html
198208
withr::local_options("sparsevctrs.verbose_materialize" = 3)
@@ -233,6 +243,8 @@ test_that("sparse data work with xgboost engine", {
233243

234244
test_that("to_sparse_data_frame() is used correctly", {
235245
skip_if_not_installed("xgboost")
246+
skip_on_cran()
247+
236248
# Make materialization of sparse vectors throw an error
237249
# https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html
238250
withr::local_options("sparsevctrs.verbose_materialize" = 3)
@@ -276,6 +288,8 @@ test_that("to_sparse_data_frame() is used correctly", {
276288

277289
test_that("maybe_sparse_matrix() is used correctly", {
278290
skip_if_not_installed("xgboost")
291+
skip_on_cran()
292+
279293
# Make materialization of sparse vectors throw an error
280294
# https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html
281295
withr::local_options("sparsevctrs.verbose_materialize" = 3)

0 commit comments

Comments
 (0)