test(updater): make not-installed test hermetic (force empty resolution dir) (#571)#37
Merged
Merged
Conversation
…on dir) (#571) Add CLI_BIN_RESOLUTION_DIRS_ENV to override the conventional bin directories for tests, allowing the test to force an empty resolution directory. This makes the 'every_mutation_reports_not_installed_when_no_binary_resolves' test pass deterministically regardless of whether dig-updater is installed locally. Also bump version from 0.31.0 to 0.31.1 (patch). Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix non-deterministic test in
dig-node-service::updater:every_mutation_reports_not_installed_when_no_binary_resolveswas failing on dev machines that havedig-updaterinstalled, because it assumed the binary wouldn't exist locally.Fix: Add
CLI_BIN_RESOLUTION_DIRS_ENVto allow tests to override the conventional bin directories with an empty directory, making binary resolution fail deterministically.Changes
DIG_UPDATER_BIN_RESOLUTION_DIRSthat overridesconventional_bin_dirs()conventional_bin_dirs()to check the env var first (supports semicolon-separated dir list)Test plan
updater::tests::every_mutation_reports_not_installed_when_no_binary_resolvespassescargo test --locked)cargo clippy --all-targets --all-features --locked -- -D warningspassescargo fmt --all -- --checkpasses