Skip to content

Add a smoke test for the app image init script - #56

Merged
umputun merged 1 commit into
masterfrom
app-image-smoke-test
Nov 21, 2026
Merged

umputun merged 1 commit into
masterfrom
app-image-smoke-test

Conversation

@paskal

@paskal paskal commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

Previously, CI built the app image and, on master and tags, published it, without ever running init.sh. A change that left the script valid but functionally wrong reached the registry with every check green.

After this change, base.alpine/test.sh smoke-tests the app image entrypoint. It implements option 1 with the requested changes:

  • the chown checks create root-owned files inside the test container and then exec /init.sh, so there is no helper image to build or clean up
  • load and the baseimage-app:test tag are set only for the app image
  • the test runs on pull requests and on master pushes, before the registry logins, on both the amd64 and arm64 legs; on master only the app leg runs the extra local build, and tag builds are unchanged
  • the non-root check runs --user 1001 ... id -u and expects exit 0 and the output 1001

make test_app runs the same script against umputun/baseimage:app-latest, the tag make build_app produces.

Checked locally on an image built from this branch: all 18 checks pass. Removing the /srv and /home/app chowns from init.sh makes the three app:app checks fail. Letting the root-only setup run as uid 1001 makes the non-root check fail on the timezone errors printed before 1001. The script passes shellcheck, and the workflow passes actionlint.

Resolves #52

CI built and published the app image without ever running its
entrypoint, so a change that left init.sh valid but functionally wrong
reached the registry with every check green.

base.alpine/test.sh runs the image with each init.sh setting and checks
the effect. The workflow runs it on both platforms for pull requests and
master pushes, before the registry logins; tag builds are unchanged.
make test_app runs the same script locally.

@umputun umputun left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@umputun
umputun merged commit bbac978 into master Nov 21, 2026
14 checks passed
@umputun
umputun deleted the app-image-smoke-test branch November 21, 2026 17:20
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.

Add a smoke test for the app image init script

2 participants