[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
Open
[quality] test: unit coverage for .github/scripts/render_card.py — scripts/test_render_card.py#1453kubestellar-hive[bot] wants to merge 1 commit into
kubestellar-hive[bot] wants to merge 1 commit into
Conversation
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>
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 lintIf 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
``` |
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
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 existingvalidaterecipe.render_card.pyis 542 lines, runs on everypublish.ymlrelease to produce the release-card PNG and the release-notes markdown, and had zero test coverage.Functions covered (31 unittest cases)
render_chipchangedwithoutprev, HTML escaping of name/version/prev, missing-key failurerender_diff_barhas_prevgating, updated/added/removed ordering, zero-count omission, all-zero fallback textbuild_htmlbuild_release_notes<details>sections, full-SHA image refs, cosign certificate-identity regexp, no-4-space-indent markdown invariantmain--output/--release-notesdefaults, notes written, temp HTML cleaned up on success and on screenshot failure, notes not written when screenshot failsThe
screenshot()Playwright boundary is stubbed, so the suite runs offline with no browser download. Runtime is ~0.01s.Disjointness
files/scripts/bst-progress.py→scripts/test_bst_progress.py.github/scripts/sbom_diff.py→scripts/test_sbom_diff.pyscripts/gen-filemap.py→scripts/test_gen_filemap.pyscripts/test_*.pyand no.github/scripts/fileNo open PR touches
render_card.pyorscripts/test_render_card.py. The only shared file isJustfile, 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