fix(tests): derive the sam init parameter guidance from the command - #9212
Merged
Merged
Conversation
roger-zhangg
force-pushed
the
fix-init-incompatible-param-message
branch
from
August 31, 2026 23:51
e955e72 to
5c98241
Compare
INCOMPATIBLE_PARAM_MESSAGE restated the parameter order and fell behind #9176, which generates the hint from the enforced parameter combinations. Re-render the combinations from those constants so a future change cannot strand them, while keeping the wording around them written out so it is still asserted.
roger-zhangg
force-pushed
the
fix-init-incompatible-param-message
branch
from
September 1, 2026 00:00
5c98241 to
5cdd254
Compare
vicheey
approved these changes
Sep 1, 2026
ckawl
approved these changes
Sep 1, 2026
roger-zhangg
added this pull request to the merge queue
Sep 1, 2026
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.
Which issue(s) does this change fix?
N/A — 4 nightly failures, e.g. run 33379671789.
Why is this change necessary?
Four
TestInitForParametersCompatibilitytests fail on an expected string that no longer matches whatsam initprints:#9176 replaced the hand-written
INCOMPATIBLE_PARAMS_HINTwith one generated fromNON_INTERACTIVE_PARAM_COMBINATIONS, which is also passed asrequired_param_lists— so the hint can no longer drift from the check it describes. That list orders--dependency-managerfirst, so the printed message changed and the test's hardcoded copy was left behind.It escaped PR CI because that class is
pr_skipand runs only in the nightly.How does it address the issue?
Rather than restate the new order and wait for the next drift, only the part that drifts is derived.
_render_combinations()re-renders the accepted combinations fromNON_INTERACTIVE_PARAM_COMBINATIONS, and the wording around them stays written out in the test so it is still asserted. Both messages share it, with the separator each one uses ("\n"for the missing-parameters list,", or\n"for the hint).MISSING_REQUIRED_PARAM_MESSAGEwas not failing, but it restated the same list and would have drifted next — it only matched because it happened to track a messageClickMutexhas always generated from that list.Deliberately not importing the rendered hint wholesale: that would make the assertion self-referential, so a bad edit to the hint's wording or separators would change both sides at once and the tests would stay green. Nothing else in the suite pins that user-facing string.
What side effects does this change have?
Verified against the real CLI via
CliRunnerrather than by comparing the constants to themselves — all five messages the tests assert, all exit code 2:Then confirmed both halves of the intent by mutating the command and re-running with no test change:
The first is the maintenance burden this removes; the second is the wording protection it keeps.
One trade-off worth naming: in the nightly release runs these constants come from the checked-out source while the assertion is against the installed binary, so the tests now also require those two to agree. For a nightly built from the same commit that is the correct expectation, and it replaces a failure mode where a stale copy could disagree with both.
make prpasses (9401 unit tests, 94.09% coverage).Mandatory Checklist
PRs will only be reviewed after checklist is complete
make prpassesmake update-reproducible-reqsif dependencies were changedBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.