feat(update): smoke-test new binary and print from/to versions #40
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/update-verify-by-running"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
yt updatepreviously ended with "Runyt --versionto confirm." which pushed the smoke test onto the user. This PR has the command actually spawn<new-binary> --versionitself; if the spawn fails, exits non-zero, or returns empty stdout, the update is reported as failed instead of silently leaving the user with a broken binary (corrupt artifact, arch mismatch, missing shared lib, etc.).from: <CARGO_PKG_VERSION> (<git-hash>, built <date>)(baked into the running binary at build time) andto: <whatever the new binary's --version prints>(clap'sytprefix is stripped so the banners line up).ytbinary returns its banner, missing path errors on spawn, non-zero exit (/bin/falseon Unix) errors with the exit status.verify_checksumin this file). No new YouTrack issue needed.Test plan
cargo fmt --checkcargo clippy --all-targets -- -D warningscargo test --all-targets(215 passed, +3 new)yt update --forceprints both FROM/TO lines and refuses to proceed if<bin> --versionfails.