Skip to content

Commit

Permalink
skip xgb tests
Browse files Browse the repository at this point in the history
  • Loading branch information
topepo committed Feb 14, 2025
1 parent 00fa075 commit 0174b55
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tests/testthat/test-boost_tree.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ test_that('argument checks for data dimensions', {
})

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

test_that("check_args() works", {
skip_if_not_installed("xgboost")
skip_on_cran()

expect_snapshot(
error = TRUE,
Expand Down
15 changes: 14 additions & 1 deletion tests/testthat/test-boost_tree_xgboost.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ hpc_xgboost <-
# ------------------------------------------------------------------------------

test_that('xgboost execution, classification', {

skip_if_not_installed("xgboost")
skip_on_cran()

ctrl$verbosity <- 0L

Expand Down Expand Up @@ -80,6 +80,7 @@ test_that('xgboost execution, classification', {
test_that('xgboost classification prediction', {

skip_if_not_installed("xgboost")
skip_on_cran()

library(xgboost)

Expand Down Expand Up @@ -130,6 +131,7 @@ bad_rf_reg <-
test_that('xgboost execution, regression', {

skip_if_not_installed("xgboost")
skip_on_cran()

ctrl$verbosity <- 0L

Expand Down Expand Up @@ -158,6 +160,7 @@ test_that('xgboost execution, regression', {
test_that('xgboost regression prediction', {

skip_if_not_installed("xgboost")
skip_on_cran()

ctrl$verbosity <- 0L

Expand Down Expand Up @@ -189,6 +192,7 @@ test_that('xgboost regression prediction', {

test_that('xgboost alternate objective', {
skip_if_not_installed("xgboost")
skip_on_cran()

ctrl$verbosity <- 0L

Expand Down Expand Up @@ -224,6 +228,7 @@ test_that('xgboost alternate objective', {
test_that('submodel prediction', {

skip_if_not_installed("xgboost")
skip_on_cran()

ctrl$verbosity <- 0L

Expand Down Expand Up @@ -264,6 +269,7 @@ test_that('submodel prediction', {

test_that('validation sets', {
skip_if_not_installed("xgboost")
skip_on_cran()

ctrl$verbosity <- 0L

Expand Down Expand Up @@ -309,6 +315,7 @@ test_that('validation sets', {

test_that('early stopping', {
skip_if_not_installed("xgboost")
skip_on_cran()

ctrl$verbosity <- 0L

Expand Down Expand Up @@ -350,6 +357,7 @@ test_that('early stopping', {

test_that('xgboost data conversion', {
skip_if_not_installed("xgboost")
skip_on_cran()

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

test_that('xgboost data and sparse matrices', {
skip_if_not_installed("xgboost")
skip_on_cran()

ctrl$verbosity <- 0L

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

skip_if_not_installed("xgboost")
skip_on_cran()

ctrl$verbosity <- 0L

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

skip_if_not_installed("xgboost")
skip_on_cran()

ctrl$verbosity <- 0L

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

test_that("count/proportion parameters", {
skip_if_not_installed("xgboost")
skip_on_cran()

ctrl$verbosity <- 0L

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

ctrl$verbosity <- 0L

Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-descriptors.R
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ test_that("can be temporarily overriden at evaluation time", {

test_that("system-level descriptor tests", {
skip_if_not_installed("xgboost")
skip_on_cran()

expect_no_condition(
boost_tree(mode = "regression", mtry = .cols()) %>%
set_engine("xgboost") %>%
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-predict_formats.R
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ test_that('non-factor classification', {

test_that("predict() works for model fit with fit_xy() (#1166)", {
skip_if_not_installed("xgboost")
skip_on_cran()

spec <- boost_tree() %>%
set_mode("regression") %>%
Expand Down
14 changes: 14 additions & 0 deletions tests/testthat/test-sparsevctrs.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
test_that("sparse tibble can be passed to `fit() - supported", {
skip_if_not_installed("xgboost")
skip_on_cran()

# Make materialization of sparse vectors throw an error
# https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html
withr::local_options("sparsevctrs.verbose_materialize" = 3)
Expand Down Expand Up @@ -30,6 +32,8 @@ test_that("sparse tibble can be passed to `fit() - unsupported", {

test_that("sparse matrix can be passed to `fit() - supported", {
skip_if_not_installed("xgboost")
skip_on_cran()

# Make materialization of sparse vectors throw an error
# https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html
withr::local_options("sparsevctrs.verbose_materialize" = 3)
Expand Down Expand Up @@ -61,6 +65,8 @@ test_that("sparse matrix can be passed to `fit() - unsupported", {

test_that("sparse tibble can be passed to `fit_xy() - supported", {
skip_if_not_installed("xgboost")
skip_on_cran()

# Make materialization of sparse vectors throw an error
# https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html
withr::local_options("sparsevctrs.verbose_materialize" = 3)
Expand Down Expand Up @@ -90,6 +96,8 @@ test_that("sparse tibble can be passed to `fit_xy() - unsupported", {

test_that("sparse matrices can be passed to `fit_xy() - supported", {
skip_if_not_installed("xgboost")
skip_on_cran()

# Make materialization of sparse vectors throw an error
# https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html
withr::local_options("sparsevctrs.verbose_materialize" = 3)
Expand Down Expand Up @@ -193,6 +201,8 @@ test_that("sparse matrices can be passed to `predict() - unsupported", {

test_that("sparse data work with xgboost engine", {
skip_if_not_installed("xgboost")
skip_on_cran()

# Make materialization of sparse vectors throw an error
# https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html
withr::local_options("sparsevctrs.verbose_materialize" = 3)
Expand Down Expand Up @@ -233,6 +243,8 @@ test_that("sparse data work with xgboost engine", {

test_that("to_sparse_data_frame() is used correctly", {
skip_if_not_installed("xgboost")
skip_on_cran()

# Make materialization of sparse vectors throw an error
# https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html
withr::local_options("sparsevctrs.verbose_materialize" = 3)
Expand Down Expand Up @@ -276,6 +288,8 @@ test_that("to_sparse_data_frame() is used correctly", {

test_that("maybe_sparse_matrix() is used correctly", {
skip_if_not_installed("xgboost")
skip_on_cran()

# Make materialization of sparse vectors throw an error
# https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html
withr::local_options("sparsevctrs.verbose_materialize" = 3)
Expand Down

0 comments on commit 0174b55

Please sign in to comment.