Add e2e tests for update binary checksum verification - #434
Merged
skyrpex merged 2 commits intoAug 5, 2026
Merged
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
skyrpex
marked this pull request as ready for review
August 5, 2026 13:18
skyrpex
deleted the
devx-1035-add-e2e-tests-for-lstk-update-checksum-verification
branch
August 5, 2026 13:22
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.
Issue
lstk update's direct-binary path now hard-depends on SHA-256 verification against the release'schecksums.txt(fail-closed). That gate had unit coverage only — nothing exercised the full download-and-verify flow through the real binary, so a regression could break every binary-install user's update path unnoticed.Solution
Add three hermetic e2e tests that run a real built binary against a mock GitHub server (no network, all side effects in temp dirs):
checksums.txt— fail-closed refusal ("refusing to install an unverifiable binary"), nothing installed.To make the real binary reach the mock, two undocumented test-only env vars redirect the updater's GitHub hosts:
LSTK_UPDATE_GITHUB_API_ENDPOINT(release metadata, defaultapi.github.com) andLSTK_UPDATE_GITHUB_DOWNLOAD_ENDPOINT(assets, defaultgithub.com) — same pattern asLSTK_API_ENDPOINT/LSTK_ANALYTICS_ENDPOINT. Unset means production defaults; behavior is otherwise unchanged.Also hardened the existing real-GitHub tests:
TestUpdateBinaryInPlace/...JSONnow run with an isolated temp$HOME(they previously leaked config/logs into the developer's real one) and assert the replaced binary prints the exact version the update reported.Docs
No user-facing changes. The two new env vars are deliberately undocumented test-only knobs (redirecting the update download source is not a supported user workflow — enterprise/offline setups are served by the existing custom
imageconfig instead). Nothing for technical writers to pick up.Review
Human review advised — small, test-focused change, but it adds env-var redirection hooks into the security-sensitive update download path; worth confirming the test-only override approach there.
Closes DEVX-1035
Co-Authored-By: Claude noreply@anthropic.com