Repository navigation
test: unit coverage for the desktop contract gates — scripts/verify-desktop-contract.py + scripts/verify-gnome-extensions.py, new tests/test_desktop_contract.py [quality] - #96
Conversation
…tract gates scripts/verify-desktop-contract.py and scripts/verify-gnome-extensions.py both gate builds -- the first from `just check` (--check) and from the Containerfile against a composed image, the second for the bundled GNOME extension set -- and neither had any unit coverage. A gate that stopped rejecting anything would still have reported success. tests/test_desktop_contract.py adds 25 cases over validate_contract, read_os_release, verify_values, parse_brewfile, unit_enabled, the --check path of verify-desktop-contract.main(), and verify-gnome-extensions shell_versions()/main() driven through --root against a temporary tree. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: sec-check[bot] <sec-check[bot]@users.noreply.github.com>
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the Hive will automatically remove the |
|
This PR adds one file, The job then fails several steps later in That is the same parity drift tracked by the open PR #110 Run: https://github.com/projectbluefin/utah/actions/runs/35187193245/job/105091684090 — hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.78 |
|
@castrojo could you review/approve? Test-only addition (no production code touched); the ruleset needs an approval from someone other than the last pusher before it can be merged. Generated by Claude Code |
hanthor
left a comment
There was a problem hiding this comment.
Reviewed. Test-only: one new file, no production code, discovered by the existing runner. Ran it locally against the current tree — 29 tests pass — and read the contract job log: its 52 tests were OK; the only red was just check-parity, which is the main drift #110 just fixed. Updating the branch so CI re-runs on the repaired base, then merging.
Generated by Claude Code
Closes #95
Test Improvement
Adds
tests/test_desktop_contract.py— 25 cases, the first coverage of eitherdesktop contract gate.
Claimed ground (files/functions), so the next comparison is mechanical:
tests/test_desktop_contract.pyscripts/verify-desktop-contract.py—validate_contract,read_os_release,verify_values,parse_brewfile,unit_enabled,main()--checkpathscripts/verify-gnome-extensions.py—shell_versions,main()via--rootJustfilechange (theJustfileis already claimed by open PRs test: unit coverage for scripts/flavors.py flavor-matrix queries — new tests/unit/test_flavors.py, Justfile test recipe #40 and refactor: single owner for the just check syntax inventory — Justfile check recipe, new scripts/check-script-syntax.py #91, and by refactor(flavors): make flavors.py the only flavor-to-image-name map #44/refactor: single-source install-repo identity in packages/*.repo — scripts/check-repo-availability.py REPOS #74/refactor: single owner for the just check syntax inventory — Justfile check recipe, new scripts/check-script-syntax.py #91 for other surfaces — this PR is disjoint from all of them)What the tests pin down:
validate_contractnames every missing section, rejects relative contract paths, an empty Flatpak app list, duplicate Flatpak IDs and a relative Brewfile; the shippedcontracts/bluefin-desktop.tomlvalidates clean.read_os_releasehandles quoting, comments, blank lines and values containing=.verify_valuesreports exact mismatches and missing keys, and uses full-match (not prefix) pattern semantics.parse_brewfilepreserves order, ignores non-flatpaklines, accepts indentation, and does not acceptflatpak "id", args: ...lines as a bare app.unit_enabledaccepts onlyenabled/enabled-runtimewith exit 0 —static,maskedand non-zero exits fail — and invokessystemctl is-enabled <unit>.main(--check)accepts the shipped contract, rejects a truncated one, and reads no image path (read_os_release/unit_enabledasserted not called), which is what makes it safe in source-only CI.shell-versionwithout51, or invalid metadata JSON — failing rather than raising.shell_versionssubstitutes the GSConnect@PACKAGE_VERSION@placeholder and rejects metadata missing the key.Discovery is the existing
python3 -m unittest discover -s tests -p "test_*.py", so no runner or CI change is needed.Verification:
python3 -m unittest discover -s tests -p "test_*.py"— 52 tests, OK (27 pre-existing + 25 new).Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5