Skip to content

Commit 5032efa

Browse files
committed
test: fix test_ResultAssignerSurrogate due to upcoming changes of internal tuned values in mlr3tuning 1.3.1
1 parent 95bebb9 commit 5032efa

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

NEWS.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
* chore: silence rush logger and fixed some partial matches, depend on mlr3 >= 0.22.1.
44
* test: fix `test_AcqFunctionMulti`, robustify helper and loading.
5-
* test: fix `test_ResultAssignerArchive` due to upcoming changes of internal tuned values in mlr3tuning 1.3.1
5+
* test: fix `test_ResultAssignerArchive` and `test_ResultAssignerSurrogate` due to upcoming changes of internal tuned values in mlr3tuning 1.3.1
66

77
# mlr3mbo 0.2.8
88

tests/testthat/test_ResultAssignerSurrogate.R

+7-7
Original file line numberDiff line numberDiff line change
@@ -92,24 +92,24 @@ test_that("ResultAssignerSurrogate passes internal tuned values", {
9292
validate = 0.2,
9393
early_stopping = TRUE,
9494
x = to_tune(0.2, 0.3),
95-
iter = to_tune(upper = 1000, internal = TRUE, aggr = function(x) 99))
95+
iter = to_tune(upper = 1000L, internal = TRUE, aggr = function(x) 99L))
9696

9797
instance = ti(
9898
task = tsk("pima"),
9999
learner = learner,
100-
resampling = rsmp("cv", folds = 3),
100+
resampling = rsmp("cv", folds = 3L),
101101
measures = msr("classif.ce"),
102-
terminator = trm("evals", n_evals = 20),
102+
terminator = trm("evals", n_evals = 20L),
103103
store_benchmark_result = TRUE
104104
)
105105
surrogate = SurrogateLearner$new(REGR_KM_DETERM)
106106
acq_function = AcqFunctionEI$new()
107107
acq_optimizer = AcqOptimizer$new(opt("random_search", batch_size = 2L), terminator = trm("evals", n_evals = 2L))
108108

109109
tuner = tnr("mbo", result_assigner = result_assigner)
110-
expect_data_table(tuner$optimize(instance), nrows = 1)
111-
expect_list(instance$archive$data$internal_tuned_values, len = 20, types = "list")
112-
expect_equal(instance$archive$data$internal_tuned_values[[1]], list(iter = 99))
110+
expect_data_table(tuner$optimize(instance), nrows = 1L)
111+
expect_list(instance$archive$data$internal_tuned_values, len = 20L, types = "list")
112+
expect_equal(instance$archive$data$internal_tuned_values[[1L]]$iter, 99L)
113113
expect_false(instance$result_learner_param_vals$early_stopping)
114-
expect_equal(instance$result_learner_param_vals$iter, 99)
114+
expect_equal(instance$result_learner_param_vals$iter, 99L)
115115
})

0 commit comments

Comments
 (0)