GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |
GeezerVison is showing github.com — test(cli): pin RepairArgs flag surface (download-mode=file, gc alias) by mikolalysenko · Pull Request #75 · SocketDev/socket-patch Conversation
Collaborator
SummaryAdds parser-level integration tests for the The This PR is stacked on Coverage
Test plan
Assisted-by: Claude Code:claude-opus-4-7
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsSets up the foundation for a comprehensive unit-test campaign on the
socket-patch CLI. No behavior change to the binary.
Two changes:
1. Expose the clap parser as a library so integration tests can verify
the public CLI contract without spawning the binary:
- new crates/socket-patch-cli/src/lib.rs hosting Cli, Commands,
looks_like_uuid, and parse_with_uuid_fallback (extracted from main.rs)
- Cargo.toml gains [lib] entry alongside the existing [[bin]]
- main.rs is now a thin wrapper that delegates to the lib
2. De-duplicate the manifest-path resolution block that was copy-pasted
into 5 commands (apply, rollback, list, remove, repair). New helper
socket_patch_core::manifest::operations::resolve_manifest_path
handles the absolute-vs-relative join in one place, with 3 unit tests.
3. New CLI_CONTRACT.md next to the crate documenting every subcommand,
flag, default, alias, JSON shape, and exit code as semver-significant
surface. Adds a comment block above pub enum Commands pointing to it
so anyone editing the parser sees the contract reminder.
Verified: cargo build/clippy/test --workspace --all-features all clean
(415 unit tests pass, including 3 new resolve_manifest_path tests).
Foundation for follow-up PRs that add the per-command parser snapshot
tests and helper unit tests.
Assisted-by: Claude Code:claude-opus-4-7
Mikola Lysenko (mikolalysenko)
force-pushed
the
tests/cli-contract-foundation
branch
from
0bd4f50 to
6cb84b8
Compare
Add a parser-level integration test that locks in the public clap contract for the `repair` subcommand. The key assertion is that `--download-mode` defaults to `"file"` — diverging from every other command's `"diff"` default. `repair` restores legacy per-file blobs needed to apply any patch, so a silent flip to `"diff"` would break that path with no parser-level signal. The `gc` visible alias is also exercised (both bare and with a flag) so a refactor that drops it is caught immediately. Covers every flag in the repair row of CLI_CONTRACT.md plus an unknown-flag failure case that pins the clap error kind. Assisted-by: Claude Code:claude-opus-4-7
Mikola Lysenko (mikolalysenko)
force-pushed
the
tests/cli-parse-repair
branch
from
2053747 to
7607110
Compare
Mikola Lysenko (mikolalysenko)
force-pushed
the
tests/cli-contract-foundation
branch
from
6cb84b8 to
ef0deac
Compare
Collaborator
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. 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. | |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |