[quality] test: unit coverage for scripts/compose-e2e-image.sh (new tests/unit/test_compose_e2e_image.py) - #774
Open
kubestellar-hive[bot] wants to merge 1 commit into
Open
Conversation
scripts/compose-e2e-image.sh builds the E2E overlay layer FROM the image under test and pushes the composed ref that every suite job boots. It had no test of any kind: it runs only inside e2e.yml, so a regression in it surfaces as a red E2E lane that reads like a product regression. Adds tests/unit/test_compose_e2e_image.py, which executes the script in a hermetic sandbox (fake podman/sudo shims on PATH, throwaway E2E_OVERLAY_DIR, no registry contact) and asserts observed behaviour rather than source text: - argument-count guards exit 2 without invoking podman - a missing overlay Containerfile exits 1 before any build - --build-arg carries the base ref, -t carries the composed ref - -f and the build context both resolve to the overlay directory - build strictly precedes push; a failed build never reaches the registry - a failed push is not swallowed - the composed ref is the final stdout line e2e.yml consumes - the PODMAN default expands as words to 'sudo podman' - refs containing shell metacharacters are passed through unexpanded Verified by mutation: self-referential BASE_IMAGE, dropping set -e, removing the final echo, dropping sudo from the PODMAN default, and loosening the argument-count check are each caught by a failing test. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: sec-check[bot] <sec-check[bot]@users.noreply.github.com>
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This was referenced Aug 31, 2026
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.
Test Improvement
Adds
tests/unit/test_compose_e2e_image.py— 18 behavioural tests forscripts/compose-e2e-image.sh, which previously had zero coverage.Claimed ground (for open-PR disjointness checks)
tests/unit/test_compose_e2e_image.py(new file, only file in the diff)scripts/compose-e2e-image.shonlyDisjoint from every open testsuite PR: #766 (
generate_skill_index.py,update_coverage_snapshot.py), #768 (offline_boot_steps.py,sudo_rs_steps.py,bctl_steps.py,update_failure_steps.py), #765 (environment.pyquarantine contract), #773 (SSH transport /ssh_config.py), #771 (Containerfile.runner), #751 (screenshot_steps.py), #757 (input-remapper QEMU).Why this script matters
compose-e2e-image.shbuilds the E2E overlay layer FROM the image under test and pushes the composed ref that every suite job boots. It runs only insidee2e.yml, so a regression in it surfaces as a red E2E lane that reads like a product regression rather than a tooling bug.What is asserted
The script is executed in a hermetic sandbox (fake
podman/sudoshims onPATH, throwawayE2E_OVERLAY_DIR, no registry contact), and assertions are on observed argv/exit codes rather than source text:2without invoking podmanContainerfileexits1before any build--build-argcarries the base ref;-tcarries the composed ref-fand the build context both resolve to the overlay directorye2e.ymlconsumesPODMANdefault expands as words tosudo podman(root image store)Verification
Mutation-checked — each of these breaks at least one test: self-referential
BASE_IMAGE, droppingset -e, removing the finalecho, droppingsudofrom thePODMANdefault, loosening$# -ne 2.Full
tests/unit/run is unchanged apart from the new file (pre-existing failures/errors in this environment come from missingbehave/selenium, untouched by this PR).Filed by quality agent (hold-gated mode). Human review required — do not merge automatically.
— hive: agent=quality backend=copilot model=claude-opus-5