Skip to content

[quality] test: add BATS unit tests for bootc-build/create-manifest/action.yml - #428

Open
kubestellar-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-create-manifest
Open

[quality] test: add BATS unit tests for bootc-build/create-manifest/action.yml#428
kubestellar-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-create-manifest

Conversation

@kubestellar-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds tests/bats/test_create_manifest.bats — 21 BATS cases covering the four inline run: blocks in bootc-build/create-manifest/action.yml, which previously had zero test coverage:

Step in action.yml Behaviour covered
Validate required tools podman/jq presence check fails closed with ::error::
Create manifest registry + owner lowercasing (${REGISTRY,,}), failing manifest rm tolerated, manifest create failure propagates
Populate manifest digests-json must be a JSON object; each entry becomes manifest add ... --arch <platform>; blank digests skipped; manifest add failure propagates
Populate manifest (labels) podman manifest annotate --index path, and the buildah fallback for podman < 5.0 on GitHub runners; blank label lines skipped
Push manifest tags first tag pushes with --digestfile and later tags without; blank tag lines skipped; retry succeeds on attempt 3; hard failure after 3 attempts; empty digestfile is a hard error; empty tag list is a hard error; digest written to GITHUB_OUTPUT

podman, buildah and sleep are stubbed on PATH, so the suite needs no container runtime, registry, or network. The snippets under test are verbatim copies of the action.yml run blocks (machine-verified), following the existing convention in tests/bats/test_detect_changes.bats — the tests break if the action logic changes without updating them.

Picked up automatically by the existing bats job in .github/workflows/unit-tests.yml (bats tests/bats/). No production code, workflow, or docs files are touched.

Verification

$ bats --print-output-on-failure tests/bats/test_create_manifest.bats
1..21
ok 1 .. ok 21   # all pass

Claimed ground / overlap check

Claims exactly one new file: tests/bats/test_create_manifest.bats, testing bootc-build/create-manifest/action.yml.

Checked against every open hold-gated PR:

  • actions#427 touches bootc-build/scan-image/action.yml, tests/bats/test_scan_image.bats, and docs/skills/*.md — disjoint files, disjoint action.
  • actions#426 touches .github/workflows/pkg-cadence.yml — disjoint.
  • bluefin-lts#545 concerns NVIDIA manifest assembly in the bluefin-lts repo workflows, not this composite action.
  • No other open PR touches bootc-build/create-manifest/ or tests/bats/.

Deliberately does not edit docs/skills/testing.md, which actions#427 is modifying.


Filed by quality agent (hold-gated mode). Human review required — do not merge without review.

— hive: agent=quality backend=copilot model=claude-opus-5

Adds tests/bats/test_create_manifest.bats covering the four inline run
blocks in bootc-build/create-manifest/action.yml: required-tool
validation, manifest creation, manifest population, and tag push.

podman, buildah and sleep are stubbed on PATH, so no container runtime
or registry is needed. The snippets under test are verbatim copies of
the action.yml run blocks, matching the existing convention in
tests/bats/test_detect_changes.bats.

Covered behaviour:
- podman/jq presence check fails closed
- registry and repository owner are lowercased in manifest references
- a failing 'manifest rm' is tolerated; 'manifest create' still runs
- digests-json must be a JSON object; each entry becomes a
  'manifest add ... --arch <platform>'
- entries with a blank digest are skipped
- label annotation falls back to buildah when 'podman manifest annotate
  --index' is unsupported (podman < 5.0 on GitHub runners)
- first tag pushes with --digestfile, later tags without
- push retries up to 3 attempts before failing
- an empty digestfile and an empty tag list are hard errors
- the manifest digest is written to GITHUB_OUTPUT

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: kubestellar-hive[bot] <kubestellar-hive[bot]@users.noreply.github.com>
@kubestellar-hive kubestellar-hive Bot added the hold Work is intentionally paused. label Aug 28, 2026
@kubestellar-hive
kubestellar-hive Bot requested review from castrojo and p5 as code owners August 28, 2026 03:42
@kubestellar-hive kubestellar-hive Bot added the hold Work is intentionally paused. label Aug 28, 2026
@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@hanthor hanthor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

BATS coverage for bootc-build/create-manifest/action.yml. Verified the embedded snippets match the live file exactly. Tests cover real branches: retry-then-succeed vs. hard-fail-after-3, the buildah fallback path, JSON-shape validation, and a negative assertion against un-lowercased strings. CI green (5/5).


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hold Work is intentionally paused. quality testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant