Repository navigation
test(gh-issues): add unit, integration, and smoke tests for gh_issues.py (#99) - #129
Merged
Merged
Conversation
…to PR table Refs: #99
57 tests covering all 9 pure-logic functions: _styled, _extract_label, _extract_type, _extract_scope, _clean_title, _format_assignees, _infer_review, _extract_reviewers, _build_cross_refs. Refs: #99
Verify rich importability and gh_issues.py importability inside the container image, catching missing dependencies and syntax errors. Refs: #99
Runs `just gh-issues` inside the devcontainer and verifies it produces output with issues and pull requests sections. Skips gracefully when gh auth is not available. Refs: #99
The gh_issues.py script requires rich at runtime. When invoked via `uv run python` (as justfile.gh does), the project venv doesn't include system-installed packages, causing ModuleNotFoundError. Refs: #99
The image tests used bare python3 to verify rich importability, but rich is installed in the workspace venv (via pyproject.toml), not system-wide. Switch to uv run python from the workspace template directory, matching the actual runtime invocation in justfile.gh. Refs: #99
c-vigo
reviewed
Feb 20, 2026
The image tests used uv run which re-parses pyproject.toml, but the
template still contains {{SHORT_NAME}} placeholders (replaced only at
workspace init time). Use the pre-built .venv/bin/python directly,
which already has rich installed from the Containerfile uv sync step.
Refs: #99
c-vigo
approved these changes
Feb 21, 2026
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.
Pull Request
Description
Add comprehensive test coverage for
scripts/gh_issues.pyacross three layers: unit tests for pure-logic functions, container integration tests for runtime dependency verification, and an integration smoke test for thejust gh-issuesrecipe. The smoke test uncovered a missingrichdependency in the workspace templatepyproject.toml, which is also fixed here.Related Issue(s)
Closes #99
Type of Change
Changes Made
tests/test_gh_issues.py) covering all 9 pure-logic functions:_styled,_extract_label,_extract_type,_extract_scope,_clean_title,_format_assignees,_infer_review,_extract_reviewers,_build_cross_refstests/test_image.py) verifyingrichimportability andgh_issues.pyimportability inside the container imagetests/test_integration.py) runningjust gh-issuesin a devcontainer, validating the full recipe wiring end-to-endrich>=13.0toassets/workspace/pyproject.tomldependencies —uv run pythonin the project venv couldn't findrich(only installed system-wide), causingModuleNotFoundErrorChangelog Entry
No changelog needed — tests-only change with no user-visible impact. The
richdependency fix affects the workspace template for new projects only.Testing
just test)Manual Testing Details
uv run pytest tests/test_gh_issues.py -v— 57/57 passeduv run pytest tests/test_integration.py::TestGhIssuesSmoke -v -s— skipped (expected: test workspace has no GitHub repo context)just build devto verifyrichdependency fixChecklist
docs/templates/, then runjust docs)CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Additional Notes
ghCLI calls fail (no repo context in test workspace or no auth). It would fully pass in a workspace with a real GitHub repo and authentication.test_manifest_filesalready covers file existence and checksum verification for the deployedgh_issues.pyvia the sync manifest.