Skip to content

test(quake): cover all three CliVersionCheck variants#155

Open
Kewe63 wants to merge 1 commit into
circlefin:mainfrom
Kewe63:test/check-cli-version-variants
Open

test(quake): cover all three CliVersionCheck variants#155
Kewe63 wants to merge 1 commit into
circlefin:mainfrom
Kewe63:test/check-cli-version-variants

Conversation

@Kewe63

@Kewe63 Kewe63 commented Jun 15, 2026

Copy link
Copy Markdown

Summary

check_cli_version returns one of three variants:

  • SupportsCli — parseable version >= v0.5.0, or the literal "latest"
  • RequiresConfigToml — parseable version < v0.5.0
  • Assumed — unparseable tag, or missing tag

The boolean wrapper supports_cli_flags only exercised the RequiresConfigToml boundary, leaving the SupportsCli-vs-Assumed distinction documented in code but untested. A future refactor collapsing Assumed into SupportsCli (or vice versa) would silently change how callers observe the tag's confidence level.


Fix

Added a focused test pinning all three variants with the exact tags a real operator would encounter. The test catches any future refactor that merges or renames variants without updating caller behavior.


Changes

File: crates/quake/src/ (CLI version check tests)

  • Added check_cli_version_covers_all_variants test covering SupportsCli, RequiresConfigToml, and Assumed with realistic tag inputs.

How to Test

# CLI version tests
cargo test -p quake cli_version
# ✅ 14 passed, 0 failed

# Format & lint
cargo fmt --check -p quake
cargo clippy -p quake --all-targets -- -D warnings
# ✅ Both clean

Risk & Impact

None. Test-only addition — no production code modified. Locks in the three-variant contract so future refactors surface explicitly rather than silently.

Type: 🧪 Test coverage

`check_cli_version` distinguishes `SupportsCli` (parseable version
>= v0.5.0, or the literal "latest") from `Assumed` (unparseable
tag or missing tag) and `RequiresConfigToml` (parseable version
< v0.5.0). The boolean wrapper `supports_cli_flags` only
exercises the `RequiresConfigToml` boundary, so the
SupportsCli-vs-Assumed distinction is documented in code but
not in tests.

Add a focused test that pins all three variants down with the
exact tags a real operator would see ("v0.5.0", "latest",
"arc_consensus:v0.6.0", "main", "abc123", None). The test
fails if a future refactor collapses `Assumed` into
`SupportsCli` (or vice versa), which would silently change
how callers observe the tag's confidence level.
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.

1 participant