[quality] test: executed coverage for docs-checks.py main() — new tests/unit/test_docs_checks_main.py - #106
Open
kubestellar-hive[bot] wants to merge 1 commit into
Open
Conversation
…nit/test_docs_checks_main.py main() is the entry point .github/workflows/docs-checks.yml invokes and was the only uncovered part of the validator (lines 155-182, 82% file coverage). tests/unit/test_docs_checks.py drives the helpers directly and never runs the orchestration, so a regression that quietly stops checking a file, drops a budget target, or loses the exit-1 contract keeps the gate green. Adds 42 cases covering: clean-tree pass, exit 1 + FAIL output on any error, every skill under docs/skills/ being validated and link-checked, the five budget targets and their hard/warning thresholds, stale-flag scope on the top-level docs, internal-link scope, and errors/warnings global isolation across two runs. No production code changes. Adds one new test file only. Signed-off-by: quality <quality@users.noreply.github.com>
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 one new file,
tests/unit/test_docs_checks_main.py, giving executed coverage tomain()in.github/scripts/docs-checks.py— the entry point.github/workflows/docs-checks.ymlinvokes.Exact surface claimed
tests/unit/test_docs_checks_main.py(new)main()in.github/scripts/docs-checks.py, lines 155-182This PR deliberately does not touch
tests/unit/test_docs_checks.py(the existing helper-level suite),tests/unit/test_k0s_manifests.py, ortests/unit/test_kubestellar_kiosk.py.Why
tests/unit/test_docs_checks.pydrives the validator helpers directly —load_fm,validate_frontmatter,check_budget,check_stale_flags,check_internal_links,validate_skill— and never runs the orchestration that wires them together. Measured before:A regression that drops a budget target, stops iterating the
docs/skills/glob after the first entry, or loses thesys.exit(1)would leave the docs-checks workflow green while checking less.What the 42 cases assert
Docs checks passed.and noFAIL/WARN; an emptydocs/skills/is not an errorErrors:/FAILline for an invalid skill, a skill with no front-matter, and for every failing skill (not just the first)docs/skills/is validated — a badzzz-skill is reported while cleanaaa-/mmm-siblings are notlimit+5(error),limit(inclusive, clean),warn+1(warn only) andwarn(silent):AGENTS.md200/150,README.md200/150,CONTRIBUTING.md100/80,docs/MVP_1_0_READINESS.md250/200,docs/DOCUMENTATION_OVERHAUL_PLAN.md3000/2500TODO:/draft markers rejected inAGENTS.md/README.md/CONTRIBUTING.md, allowed in the exempt planning docs, andDOCUMENTATION_OVERHAUL_PLAN.mdconfirmed outside the stale-flag list entirelyDOCUMENTATION_OVERHAUL_PLAN.mdconfirmed outside the link-check listerrors/warningsmodule globals do not leak across two consecutivemain()runsNo new fixtures: the existing
docs_checksfixture intests/unit/conftest.pyalready repointsROOT/DOCS_DIR/SKILLS_DIRattmp_pathand clears the globals.Verification
82% → 99%. The one remaining line is the
if __name__ == "__main__":guard.Related Issue
Closes #105
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.78