From e02b376bf70850d88e756225fec64a08cba2f79c Mon Sep 17 00:00:00 2001 From: James Lamb Date: Fri, 9 Aug 2024 04:23:27 -0500 Subject: [PATCH] [R] Ignore auto-generated config.h, ensure tests run without 'vcd' (#10688) --- .gitignore | 1 + R-package/tests/testthat/test_helpers.R | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 4480c8102..a53ce7fd0 100644 --- a/.gitignore +++ b/.gitignore @@ -97,6 +97,7 @@ metastore_db # files from R-package source install **/config.status +R-package/config.h R-package/src/Makevars *.lib diff --git a/R-package/tests/testthat/test_helpers.R b/R-package/tests/testthat/test_helpers.R index c619bc50b..16831cf38 100644 --- a/R-package/tests/testthat/test_helpers.R +++ b/R-package/tests/testthat/test_helpers.R @@ -36,6 +36,10 @@ if (isTRUE(VCD_AVAILABLE)) { base_score = 0.5) feature.names <- colnames(sparse_matrix) + + # without feature names + bst.Tree.unnamed <- xgb.copy.Booster(bst.Tree) + setinfo(bst.Tree.unnamed, "feature_name", NULL) } # multiclass @@ -49,10 +53,6 @@ mbst.GLM <- xgb.train(data = xgb.DMatrix(as.matrix(iris[, -5]), label = mlabel), booster = "gblinear", eta = 0.1, nthread = 1, nrounds = nrounds, objective = "multi:softprob", num_class = nclass, base_score = 0) -# without feature names -bst.Tree.unnamed <- xgb.copy.Booster(bst.Tree) -setinfo(bst.Tree.unnamed, "feature_name", NULL) - test_that("xgb.dump works", { .skip_if_vcd_not_available() if (!flag_32bit)