test: smoke test the container image before it is published - #69
Merged
gordonmurray merged 1 commit intoAug 1, 2026
Merged
Conversation
The test job installs the backend on the runner and runs pytest against the source tree. Nothing ran the image itself, so a fault in the Dockerfile reached the registry with every check green. The build job now builds the amd64 image, starts it, and checks /healthz, /datasets, and two static paths before the publish step runs. A failure stops the job, prints the container logs, and removes the container. Docker picks the host port, so the step assumes no free port on the runner. Verified against a Dockerfile with COPY web/ /web/ in place of COPY web/vanilla/ /web/. That builds without error and leaves the files one directory too deep, so /healthz and /datasets answer 200 while / returns 404. The smoke test fails on it. Deleting the COPY line instead is already caught by the chown that follows it. load: true accepts one platform, so the smoke image is amd64 and the multi-platform build reuses its layers from the cache.
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.
Fixes #67
The
testjob installs the backend on the runner and runs pytest against the source tree. Nothing ran the image itself, so a fault in the Dockerfile reached the registry with every check green.The
buildjob now builds the amd64 image, starts it, and checks four endpoints before the publish step runs.The fault this catches
COPY web/ /web/in place ofCOPY web/vanilla/ /web/builds without error and leaves the static files one directory too deep. The directory/webexists, so the chown succeeds andapp.pymounts it. The image then answers every API request and serves no page:The smoke test fails on that image and the publish step never runs.
Deleting the
COPYline instead is already caught today, because thechown -R appuser:appuser /app /webthat follows it fails on the missing directory. The wrong path is the case that gets through.Notes
load: trueaccepts one platform, so the smoke image is amd64 only. The existing step still builds and pusheslinux/amd64,linux/arm64, and it reuses the smoke layers from the cache.Docker picks the host port and the step reads it back with
docker port, so the step needs no free port on the runner.An empty directory is enough for the mount, because
entrypoint.shonly needs/datato exist and to be readable.Test plan
0.33.0image at v0.3.1 returns 200 on all four endpoints, exit 0COPY web/ /web/returns 404 on/, exit 22The workflow runs on
main, tags, and pull requests, so the change first runs in CI on this PR.