fix(tests): stop the partial-pause quota test depending on installed CLIs - #63
Open
msabel-lang wants to merge 1 commit into
Open
Conversation
…CLIs
`quota_partial_pause_fails_loud_without_collapse` pauses `cli:grok` and expects
the live gate to fail loud with exit 4, naming the paused ref without compacting
the fleet. But `pick_providers` filters by presence *before* the quota gate, so a
provider that is not installed never reaches it.
The test papered over this with a branch: exit 4 asserts the real behaviour,
anything else falls through to an `else` that asserts exit 1 and calls it
"offline / no binaries on PATH". That covers a machine with all three vendor CLIs
and a machine with none. A machine with *some* — Claude Code installed, Grok and
Antigravity not — matches neither: grok is filtered out before the gate, the plan
succeeds, and spar exits 0. The assertion then fails with
expected quota(4) when providers exist, got 0
on a tree with no changes in it. That is the common case, not a corner: anyone
adopting spar has the Claude CLI long before the others.
Stub `claude`, `grok` and `agy` onto PATH for this test so the fleet exists
regardless of the host, and assert exit 4 unconditionally. The regression this
test guards — the old `apply_quota_filter` dropping the paused entry and sliding
a different model into a role's slot — is now checked on every machine instead of
only on a fully-provisioned one. The stubs are never executed: the run stops at
the gate, which only consults presence. They are made executable because `which`
resolves them.
`quota_exit_when_all_paused` needs no change. It pauses all three, so whichever
one is installed is present-but-paused and reaches the gate on its own.
Co-Authored-By: Claude Opus 5 (1M context) <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.
Companion to #62 — same class (a test reading the machine), different mechanism, so it's separate.
quota_partial_pause_fails_loud_without_collapsepausescli:grokand expects the live gate to fail loud with exit 4, naming the paused ref without compacting the fleet. Butpick_providersfilters by presence before the quota gate, so a provider that isn't installed never reaches it.The test papers over this with a branch: exit 4 asserts the real behaviour, and anything else falls through to an
elsethat asserts exit 1, commented "offline / no binaries on PATH". That covers a machine with all three vendor CLIs, and a machine with none.A machine with some matches neither. With Claude Code installed but not Grok or Antigravity, grok is filtered out before the gate, the plan succeeds, and spar exits 0:
Reproduced on pristine
abcac30with no local changes, and it still fails with #62 applied — which rules config out and leavesPATHas the cause.That's the common case rather than a corner: anyone trying spar has the Claude CLI long before the others.
Approach
Stub
claude,grokandagyontoPATHfor this test so the fleet exists regardless of the host, then assert exit 4 unconditionally and drop theelseentirely.I chose stubbing over skipping so the coverage is restored rather than dropped — the regression this test guards (the old
apply_quota_filterdropping the paused entry and sliding a different model into a role's slot) is now checked on every machine instead of only a fully-provisioned one. The pattern is borrowed fromabandoned.rs, which already stubs a fakeclaudeontoPATH.The stubs are never executed — the run stops at the gate, which only consults presence. They're made executable because
whichhas to resolve them.quota_exit_when_all_pausedneeds no change: it pauses all three, so whichever one is installed is present-but-paused and reaches the gate on its own. That's why it survived where this one didn't.Verified
Both quota tests pass on the machine that was failing this one, and the full suite is 463 passed, 0 failed.