Skip to content

Makes mocks more tolerant to argument changes of deps - #17

Merged
topepo merged 1 commit into
mainfrom
test-fail
Oct 1, 2026
Merged

topepo merged 1 commit into
mainfrom
test-fail

Conversation

@edgararuiz

Copy link
Copy Markdown
Collaborator

Makes mocked functions from brulee and tabicl more resilient to API changes. It does that by making the mocked functions rely on ... as much as possible, but careful to keep those arguments that the tests use as explicitly defined. Here is the breakdown of what was changed:

# Mock Helper Inputs read by the mock Proposed signature Notes
1 chronos2_download() helper-chronos.R revision (by name) function(..., revision)
2 chronos2_parse_config() helper-chronos.R None function(...)
3 chronos2_model() helper-chronos.R None function(...) Stored config is never read back; drop it from the fake object
4 load_chronos2_weights() helper-chronos.R None function(...) Also removes the path vs safetensors_path drift
5 chronos2_predict_core() helper-chronos.R object, context (by position); prediction_length (by name) function(object, context, ..., prediction_length = NULL) Only mocked when also_mock_predict_core = TRUE
6 $.fake_chronos_module() helper-chronos.R x, name No change S3 method, not a mocked binding; signature fixed by the $ generic
7 tabicl_cache_lookup() helper-icl.R None function(...)
8 tabicl_parse_config() helper-icl.R path (by position) function(path, ...)
9 tabicl_load_model() helper-icl.R None function(...) Stored task is never read back; drop it from the fake object
10 tabicl_classifier_proba() helper-icl.R y_train, x_test (3rd and 4th by position) function(loaded, x_train, y_train, x_test, ...)
11 tabicl_regressor_mean() helper-icl.R y_train, x_test (3rd and 4th by position) Replace with tabicl_regressor_stats() mock Dead: brulee's predict now calls tabicl_regressor_stats(), so the TabICL regression test fails

@edgararuiz
edgararuiz requested a review from topepo September 30, 2026 20:39

@topepo topepo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a bunch!

@topepo
topepo merged commit ad4f632 into main Oct 1, 2026
13 checks passed
@topepo
topepo deleted the test-fail branch October 1, 2026 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants