Test the HTTP and command-line paths of the tools #91

Merged
Tirsvad merged 1 commits from test-tools-coverage into main 2026-10-11 05:27:09 +02:00
Owner

Adds tests/test_tool_entrypoints.py for the parts of tools/ that the flow tests did not reach. Line and branch coverage of tools/*.py goes from 88% to 97% (measured with coverage.py in a scratch environment; coverage is not added to the repository requirements).

  • The real request_json of release.py, publish_wiki.py and sync_github_metadata.py: a JSON reply, an empty reply, a body, and 401, 403, 404, 500 and an unreachable host named by category.
  • Pagination of tags and of wiki titles, and an invalid list.
  • The inputs of release.py (malformed repository and commit, unreadable or non-conforming changelog).
  • The command lines of changelog.py and build_wiki.py (check, notes, --hash, --check, the error exits).
  • Each tool run as a process: exit code 1 and ERROR: on stderr.

The remaining uncovered lines are the __main__ blocks, which the process tests run but coverage does not count in the parent. tools/quality-checks.sh is covered by tests/test_quality_workflow.py.

301 tests pass. No wiki pages changed: only tests changed.

No issue closed: requested by the user.

Adds `tests/test_tool_entrypoints.py` for the parts of `tools/` that the flow tests did not reach. Line and branch coverage of `tools/*.py` goes from 88% to 97% (measured with coverage.py in a scratch environment; coverage is not added to the repository requirements). - The real `request_json` of `release.py`, `publish_wiki.py` and `sync_github_metadata.py`: a JSON reply, an empty reply, a body, and 401, 403, 404, 500 and an unreachable host named by category. - Pagination of tags and of wiki titles, and an invalid list. - The inputs of `release.py` (malformed repository and commit, unreadable or non-conforming changelog). - The command lines of `changelog.py` and `build_wiki.py` (`check`, `notes`, `--hash`, `--check`, the error exits). - Each tool run as a process: exit code 1 and `ERROR:` on stderr. The remaining uncovered lines are the `__main__` blocks, which the process tests run but coverage does not count in the parent. `tools/quality-checks.sh` is covered by `tests/test_quality_workflow.py`. 301 tests pass. No wiki pages changed: only tests changed. No issue closed: requested by the user.
Tirsvad added 1 commit 2026-10-11 05:26:50 +02:00
Test the HTTP and command-line paths of the tools
TirSystem/github-action: Publish wiki / publish-wiki (push) Skipped
TirSystem/github-action: Sync GitHub mirror metadata / sync-metadata (push) Skipped
Validate workflows / validate (pull_request) Successful in 17s
eb3e1395db
Task: MIL-003#3
Tirsvad merged commit 80fb0cfa82 into main 2026-10-11 05:27:09 +02:00
Tirsvad deleted branch test-tools-coverage 2026-10-11 05:27:09 +02:00
Sign in to join this conversation.