Repository navigation
test(scripts): cover .github helper scripts - #2531
Merged
Merged
Conversation
The standalone scripts under .github/scripts run inside other workflows and inside pre-commit, so a regression in one of them surfaces as a confusing failure somewhere else. Give them direct coverage. - Add tests for star phrase rounding at every milestone boundary, both prose replacement forms, the mkdocs value rewrite and a near-miss key, doctest fence violation counting and message format, markdown link rewriting for relative, absolute, and non-markdown inputs, and the wheel manifest guard - Add a workflow running those tests plus the doctests embedded in the scripts, triggered on pushes and pull requests touching either directory - Add the two missing docstrings in augment_links.py Tests live under tests/ so they inherit the repository's existing ruff and mypy overrides; a conftest puts the scripts directory on sys.path, since they are entry points rather than an installed package. --- Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Test collection currently fails because the referenced update_docs_stats module is absent.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds direct coverage for standalone .github helper scripts and a dedicated CI workflow.
Changes:
- Adds unit tests for documentation, link, doctest, and wheel helpers.
- Adds targeted script CI and doctest execution.
- Documents two
augment_links.pyfunctions.
File summaries
| File | Description |
|---|---|
tests/github_scripts/test_update_docs_stats.py |
Tests documentation statistics rewriting. |
tests/github_scripts/test_ci_helpers.py |
Tests remaining script helpers. |
tests/github_scripts/conftest.py |
Exposes scripts for test imports. |
tests/github_scripts/__init__.py |
Defines the test package. |
.github/workflows/ci-scripts.yml |
Runs script tests and doctests. |
.github/scripts/augment_links.py |
Adds missing docstrings. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 4
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Changes: - Remove the stale test that imported a nonexistent docs-stats helper. - Strengthen script-helper assertions with a controlled repository root and a checked-in manifest happy path. - Align the CI-scripts workflow with main/develop pushes and frozen development dependency synchronization. Impact: - CI script tests now exercise the actual maintained scripts and reject incorrect link resolution. - The workflow tests relevant push branches with reproducible dependency resolution. Verification: - Ruff lint and format checks passed for the changed script tests and helper. - Focused pytest/doctest suite passed: 11 tests. - Workflow YAML parsed and git diff --check passed. Residual limits: - Fresh GitHub Actions CI and independent read-only review evidence require external follow-up. --- Co-authored-by: Codex <codex@openai.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2531 +/- ##
=======================================
Coverage 88% 88%
=======================================
Files 85 85
Lines 12163 12163
=======================================
Hits 10694 10694
Misses 1469 1469 🚀 New features to boost your workflow:
|
- Rename `seed_targets` -> `_seed_targets` to clarify it's an internal test utility. - Update all references to use the new name.
Changes: - Add a dedicated GitHub Actions workflow that installs the required dependency groups and runs every test in `.github/_tests`. Impact: - Repository workflow and documentation configuration regressions now receive a focused CI check on pushes and pull requests. Verification: - `uv run pytest .github/_tests -q` (21 passed). - `uv run pre-commit run --files .github/workflows/ci-github-tests.yml .github/_tests/test_update_docs_stats.py` (passed). Residual limits: - GitHub-hosted runner execution is deferred until Actions runs the workflow. --- Co-authored-by: Codex <codex@openai.com>
Changes: - Move standalone `.github/scripts` tests into `.github/_tests` and merge their shared import setup. - Update CI script-test discovery to use the consolidated directory. Impact: - Script tests now live with the other GitHub configuration tests while preserving script doctest coverage. Verification: - `PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .venv/bin/python -m pytest .github/_tests .github/scripts --doctest-modules -q` (32 passed). - Focused pre-commit, Ruff, and mypy hooks passed. Residual limits: - The GitHub-hosted `uv run` wrapper remains deferred to CI because local uv could not initialize. --- Co-authored-by: Codex <codex@openai.com>
Changes: - Call the manifest validator directly in its success-path test. - Install the docs dependency group before collecting consolidated GitHub tests. Impact: - Full mypy accepts the relocated test and CI can import Mike-based documentation tests. Verification: - `pre-commit run mypy --all-files` (passed). - `PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .venv/bin/python -m pytest .github/_tests .github/scripts --doctest-modules -q` (32 passed). Residual limits: - GitHub-hosted runner execution remains deferred to CI. --- Co-authored-by: Codex <codex@openai.com>
Changes: - Run GitHub configuration tests and standalone script doctests in one workflow. - Delete the duplicate CI scripts workflow. Impact: - Each GitHub test and doctest runs once per workflow invocation. Verification: - `pre-commit run mypy --all-files` (passed). - `PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .venv/bin/python -m pytest .github/_tests .github/scripts --doctest-modules -q` (32 passed). Residual limits: - GitHub-hosted runner execution remains deferred to CI. --- Co-authored-by: Codex <codex@openai.com>
Borda
added a commit
that referenced
this pull request
Sep 3, 2026
* test(scripts): cover .github helper scripts * test(ci): harden script verification * test(tests): prefix internal helper and update references * ci(ci): run GitHub configuration tests * test(ci): consolidate GitHub script tests * fix(ci): install docs for consolidated tests * ci(ci): consolidate GitHub test workflows --------- Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: Codex <codex@openai.com>
Borda
added a commit
that referenced
this pull request
Sep 4, 2026
* test(scripts): cover .github helper scripts * test(ci): harden script verification * test(tests): prefix internal helper and update references * ci(ci): run GitHub configuration tests * test(ci): consolidate GitHub script tests * fix(ci): install docs for consolidated tests * ci(ci): consolidate GitHub test workflows --------- Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: Codex <codex@openai.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.
The standalone scripts under .github/scripts run inside other workflows and inside pre-commit, so a regression in one of them surfaces as a confusing failure somewhere else. Give them direct coverage.
Tests live under tests/ so they inherit the repository's existing ruff and mypy overrides; a conftest puts the scripts directory on sys.path, since they are entry points rather than an installed package.