Skip to content

[quality] test: unit coverage for .github/scripts/render_card.py — scripts/test_render_card.py - #1453

Open
kubestellar-hive[bot] wants to merge 1 commit into
testingfrom
quality/test-render-card
Open

[quality] test: unit coverage for .github/scripts/render_card.py — scripts/test_render_card.py#1453
kubestellar-hive[bot] wants to merge 1 commit into
testingfrom
quality/test-render-card

Conversation

@kubestellar-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Claims exactly one file cluster: .github/scripts/render_card.py (test-only; the script itself is unchanged). New test file: scripts/test_render_card.py. Justfile gains one recipe, test-render-card, called from the existing validate recipe.

render_card.py is 542 lines, runs on every publish.yml release to produce the release-card PNG and the release-notes markdown, and had zero test coverage.

Functions covered (31 unittest cases)

Function Cases
render_chip changed/unchanged markup, changed without prev, HTML escaping of name/version/prev, missing-key failure
render_diff_bar has_prev gating, updated/added/removed ordering, zero-count omission, all-zero fallback text
build_html tag/sha7/long-date substitution, chip + diff-bar embedding, first-release path, no external resource loads, invalid date raises
build_release_notes all three diff summary lines, notable-versions table (changed and unchanged rows), per-category <details> sections, full-SHA image refs, cosign certificate-identity regexp, no-4-space-indent markdown invariant
main argparse contract + --output/--release-notes defaults, notes written, temp HTML cleaned up on success and on screenshot failure, notes not written when screenshot fails

The screenshot() Playwright boundary is stubbed, so the suite runs offline with no browser download. Runtime is ~0.01s.

$ just test-render-card
Ran 31 tests in 0.012s
OK

Disjointness

  • dakota#1438 covers files/scripts/bst-progress.pyscripts/test_bst_progress.py
  • dakota#1430 covers .github/scripts/sbom_diff.pyscripts/test_sbom_diff.py
  • dakota#1420 covers scripts/gen-filemap.pyscripts/test_gen_filemap.py
  • dakota#1449 / dakota#1437 / dakota#1386 touch no scripts/test_*.py and no .github/scripts/ file

No open PR touches render_card.py or scripts/test_render_card.py. The only shared file is Justfile, where each PR appends its own distinct recipe.

Related Issue

Refs #1440


Filed by quality agent (hold-gated mode). Human review required.

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

render_card.py (542 lines) generates the release-card HTML/PNG and the
release-notes markdown for every publish.yml release, and had zero test
coverage.

Adds scripts/test_render_card.py (31 unittest cases) covering:
- render_chip: changed/unchanged markup, missing prev, HTML escaping
- render_diff_bar: has_prev gating, count ordering, zero-count fallback
- build_html: tag/sha/long-date substitution, chip + diff-bar embedding,
  first-release path, no external resource loads, invalid-date failure
- build_release_notes: diff summary lines, notable-versions table,
  per-category <details> sections, full-sha image refs, cosign identity
  regexp, and the no-4-space-indent markdown invariant
- main: argparse contract and defaults, release-notes write, temp HTML
  cleanup on both success and screenshot failure

The Playwright screenshot() boundary is stubbed so the suite runs
offline with no browser download.

Wires the suite into the Justfile as test-render-card and runs it from
the existing validate recipe.

Signed-off-by: sec-check[bot] <sec-check[bot]@users.noreply.github.com>
@kubestellar-hive
kubestellar-hive Bot requested a review from a team as a code owner August 31, 2026 02:30
@kubestellar-hive kubestellar-hive Bot added the hold Work is intentionally paused. label Aug 31, 2026
@github-actions github-actions Bot added the pr/needs-review PR needs a maintainer review before it can move forward. label Aug 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for the PR! A maintainer will review it.

While you wait, make sure these pass locally:

just validate        # element graph check
just build default   # build the image
just boot-test       # confirm the desktop boots (exits 0 = pass)
just lint            # bootc container lint

If this PR fixes a bug, add verify steps to the linked issue so users can confirm the fix on their hardware after the next nightly ships:

```verify
ujust <something>   # what users should run to confirm the fix
```

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

Labels

hold Work is intentionally paused. pr/needs-review PR needs a maintainer review before it can move forward.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants