[quality] test: unit coverage for .github/scripts/docs-checks.py - #30
Open
kubestellar-hive[bot] wants to merge 1 commit into
Open
[quality] test: unit coverage for .github/scripts/docs-checks.py#30kubestellar-hive[bot] wants to merge 1 commit into
kubestellar-hive[bot] wants to merge 1 commit into
Conversation
Adds tests/unit/{conftest.py,test_docs_checks.py} — 50 pytest cases covering
load_fm, validate_frontmatter, check_budget, check_stale_flags,
check_internal_links and validate_skill, plus an invariant test that runs the
real checker against the repository docs.
Adds a 'just test-unit' recipe to run the suite. No production code changed.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: kubestellar-hive[bot] <kubestellar-hive[bot]@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.
Claimed ground: projectbluefin/server, new files
tests/unit/conftest.pyandtests/unit/test_docs_checks.py, plus atest-unitrecipe inJustfile. Functions under test:load_fm,validate_frontmatter,check_budget,check_stale_flags,check_internal_links,validate_skillin.github/scripts/docs-checks.py. Tracker cluster: quality/test-coverage for the server repo (no existing tracking issue — this repo had zero tests).Why
serverhad no test directory and no unit tests of any kind..github/scripts/docs-checks.py(186 lines) is a required PR gate: it enforces skill front-matter schema, doc line budgets, stale TODO/draft markers and internal link validity. A regression there either blocks every docs PR or silently stops enforcing the contract.What
tests/unit/conftest.py— re-imports the script by path per test and repointsROOT/DOCS_DIR/SKILLS_DIRattmp_path, so the module-levelerrors/warningsglobals stay isolated.tests/unit/test_docs_checks.py— 50 cases:load_fm: absent, valid, unterminated front-mattervalidate_frontmatter: invalid YAML, non-mapping, unknown top key, missing/non-kebab/over-64-char/stem-mismatchedname, missing/non-string/over-1024-chardescription, non-mapping metadata, unknown metadata key, badmetadata.type, non-stablestatuscheck_budget: under, warn band, over, exact-max boundarycheck_stale_flags: TODO/FIXME/XXX/HACK,draftmarker, the three exempt filenames, and that exempt files still reject TODOcheck_internal_links: http/https/mailto/anchor skips, valid relative link, broken.mdlink, root-absolute link, directory link with and withoutindex.md/INDEX.md, existing and missing non-markdown targetsvalidate_skill: missing front-matter, well-formed skill, >500-line error, 300–500-line warning, stale markerJustfile:just test-unitrunspython3 -m pytest tests/unit -q.Verification
Tests only — no production code, no workflow, no docs changed.
Note: a
.github/workflows/unit-tests.ymlto run this suite on PRs is not included; the bot token lacks theworkflowspermission. Filed separately as an issue.Filed by quality agent (hold-gated mode) — do not merge, do not remove the
holdlabel.— hive: agent=quality backend=copilot model=claude-opus-5