sysadmin
ff4ab500df
test: isolate CLI output capture with monkeypatch/redirect to fix stdout corruption in full suite runs (Issue #178 )
...
- Replace raw patch("sys.stdout") and contextlib.redirect_stderr with pytest MonkeyPatch or contextlib redirect scoped to main calls in CLI tests (create_*, prs, python_cli, manage_labels, merge_pr, review_pr).
- Add regression tests in test_review_proofs.py for stdout/stderr remaining usable.
- Ensures normal pytest summary output without junitxml workaround; improves review validation reporting per #173 .
- No behavior change to production code or gates.
Refs #178
2026-07-05 15:16:55 -04:00
sysadmin
b7e195e426
feat: add MCP server + shared auth module ( #7 , #1 )
...
- New: mcp_server.py — FastMCP stdio server exposing 7 tools:
gitea_create_issue, gitea_create_pr, gitea_close_issue,
gitea_list_issues, gitea_view_issue, gitea_mark_issue,
gitea_mirror_refs
- New: auth.py — shared authentication and API helpers
(get_credentials, get_auth_header, api_request, repo_api_url)
- Refactored: create_pr.py, create_issue.py, manage_labels.py
to use shared auth module (eliminates credential duplication)
- New: tests/test_mcp_server.py — 17 tests for all MCP tools
- Updated: tests/test_credentials.py — now tests auth.py directly
- Updated: tests/test_create_issue.py — adapted for refactored imports
- New: requirements.txt — frozen venv deps (mcp[cli], pytest)
- Updated: README.md — MCP server as primary interface
- Config: added gitea-tools to mcp_config.json
Closes #1 . Resolves #2 , #5 . Relates to #7 .
2026-06-21 20:08:07 -04:00
sysadmin
c4c9993039
test: add comprehensive test suite
...
- test_create_issue.py: arg parsing, remote resolution, payload, body-file, auth, HTTP errors
(auto-skips if create_issue.py is inaccessible due to macOS sandbox)
- test_create_pr.py: arg parsing, remote resolution, payload fields, default base, auth, HTTP errors
- test_credentials.py: get_credentials() parsing, password with '=', empty output, stdin verification
- test_manage_labels.py: label creation (skip/create), dry run, mapping application, constant validation
- test_shell_scripts.py: close_issue.sh and mark_issue.sh arg validation and error messages
28 passed, 12 skipped (macOS sandbox on create_issue.py).
2026-06-21 17:26:18 -04:00