Skip to content

test(ci): run missing-release error checks without network - #31

Merged
Maxerns merged 1 commit into
getsotto:mainfrom
LouisDeconinck:issue-27-hermetic-missing-release
Sep 13, 2026
Merged

Maxerns merged 1 commit into
getsotto:mainfrom
LouisDeconinck:issue-27-hermetic-missing-release

Conversation

@LouisDeconinck

Copy link
Copy Markdown
Contributor

Fixes #27

What

The reject-missing-release checks now run hermetically. POSIX leg: a fake curl first in PATH logs each requested URL, prints 404, and exits 22 — assertions verify the exact error: release asset not found: <archive URL> line, exactly one request, no install dir, untouched sentinels. Windows leg: a step-scope Invoke-WebRequest throws a HttpResponseException wrapping a real 404 HttpResponseMessage — the shape install.ps1's Download catch inspects — with the same assertions.

Testing

Both run: blocks were extracted and executed verbatim: the bash step passes on Linux, and the pwsh step passes under PowerShell 7.4.6 with a cosign shim (the exception type, parameter binding, and StatusCode check all verified). YAML parses cleanly. No production installer changes.

Replace the live GitHub request in the reject-missing-release job with
test-local doubles: a fake curl that logs each requested URL and replays
curl's 404 shape (nonzero exit status, 404 status output) on Linux, and
an Invoke-WebRequest function that throws an exception whose
Response.StatusCode is 404 on Windows.

Both platforms still assert the exact 'release asset not found' error
for the expected archive URL, and now also verify the installer stops
after the first missing asset, creates no installed binary, and leaves
GITHUB_PATH and GITHUB_OUTPUT unchanged.

Fixes getsotto#27

Signed-off-by: Louis Deconinck <louis.dck@gmail.com>
@Maxerns
Maxerns merged commit 800330e into getsotto:main Sep 13, 2026
30 checks passed
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.

CI: make missing-release error tests run without network access

2 participants