docs: add developer testing guidelines (#70) #81

Merged
sysadmin merged 2 commits from docs/issue-70-developer-testing-guidelines into master 2026-07-02 12:14:05 -05:00
Owner

Implements #70.

Adds docs/developer-testing-guidelines.md and links it from the README Tests section.

What's covered

  • Standard test commands; full-suite and targeted runs (file / class / node-id / -k)
  • Syntax + formatting checks (py_compile, bash -n, git diff --check)
  • Adding MCP tool tests (real repo pattern: patch mcp_server.api_request + get_auth_header)
  • Mocking API/auth safely (no network, no keychain, fake credentials only)
  • Testing profile / allowed-operation failures (fail-closed, forbidden overrides allowed)
  • Testing self-review / self-merge gates (mutating endpoint never reached when blocked)
  • No-secret / no-token regression expectations (gitea_audit.redact, test_audit.py)
  • Unit tests vs. future Docker integration tests (see #66)
  • Read-only vs. mutating tool expectations

Grounded in current repo behavior and the existing docs/ safety model.

Checks

  • python3 -m py_compile mcp_server.py — OK
  • python3 -m py_compile manage_labels.py — OK
  • bash -n scripts/clear-provenance — OK
  • git diff --check — clean
  • pytest tests/ -q — 327 passed
  • Manual secret sweep on staged diff — clean

Scope

Documentation only — README.md (+7 lines) and one new doc. No code behavior changed. No Jenkins/GlitchTip, no #65 refactor, no #67 API work.

🤖 Generated with Claude Code

Implements #70. Adds `docs/developer-testing-guidelines.md` and links it from the README **Tests** section. ## What's covered - Standard test commands; full-suite and targeted runs (file / class / node-id / `-k`) - Syntax + formatting checks (`py_compile`, `bash -n`, `git diff --check`) - Adding MCP tool tests (real repo pattern: patch `mcp_server.api_request` + `get_auth_header`) - Mocking API/auth safely (no network, no keychain, fake credentials only) - Testing profile / allowed-operation failures (fail-closed, forbidden overrides allowed) - Testing self-review / self-merge gates (mutating endpoint never reached when blocked) - No-secret / no-token regression expectations (`gitea_audit.redact`, `test_audit.py`) - Unit tests vs. future Docker integration tests (see #66) - Read-only vs. mutating tool expectations Grounded in current repo behavior and the existing `docs/` safety model. ## Checks - `python3 -m py_compile mcp_server.py` — OK - `python3 -m py_compile manage_labels.py` — OK - `bash -n scripts/clear-provenance` — OK - `git diff --check` — clean - `pytest tests/ -q` — 327 passed - Manual secret sweep on staged diff — clean ## Scope Documentation only — `README.md` (+7 lines) and one new doc. No code behavior changed. No Jenkins/GlitchTip, no #65 refactor, no #67 API work. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
jcwalker3 added 1 commit 2026-07-02 11:55:03 -05:00
Add docs/developer-testing-guidelines.md covering test commands, targeted
runs, syntax/diff checks, adding MCP tool tests, safe API/auth mocking,
profile/allowed-operation gate tests, self-review/self-merge gate tests,
no-secret regression expectations, unit vs future Docker integration tests,
and read-only vs mutating tool expectations. Link it from the README Tests
section and note the suite table is non-exhaustive.

Documentation only; no code behavior changed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
sysadmin requested changes 2026-07-02 12:02:30 -05:00
sysadmin left a comment
Owner

Blocking review for PR #81 at be4cd82c37.

I am not merging this yet. Findings:

  1. The new guide documents targeted pytest node IDs that do not exist in the current test suite:

    • tests/test_merge_pr.py::TestMergeGate fails because the file currently defines TestMergeDisabled, not TestMergeGate.
    • tests/test_review_pr.py::TestReview::test_payload_fields_and_workflow fails because test_payload_fields_and_workflow is module-level in tests/test_review_pr.py, not under TestReview.

    Please update the examples to use real node IDs from the repo, for example existing classes/tests in tests/test_mcp_server.py, tests/test_merge_pr.py, or the module-level test in tests/test_review_pr.py.

  2. The required full-suite check ./venv/bin/python -m pytest tests/ -q did not complete in my isolated review worktree after several minutes and had to be interrupted, so the required verification gate is not passed in this review.

Other checks completed before stopping: changed files matched the expected docs-only set (README.md, docs/developer-testing-guidelines.md), python3 -m py_compile mcp_server.py passed, python3 -m py_compile manage_labels.py passed, bash -n scripts/clear-provenance passed, and git diff --check passed.

Blocking review for PR #81 at be4cd82c37ff853580d07153522ace9d08bedef0. I am not merging this yet. Findings: 1. The new guide documents targeted pytest node IDs that do not exist in the current test suite: - `tests/test_merge_pr.py::TestMergeGate` fails because the file currently defines `TestMergeDisabled`, not `TestMergeGate`. - `tests/test_review_pr.py::TestReview::test_payload_fields_and_workflow` fails because `test_payload_fields_and_workflow` is module-level in `tests/test_review_pr.py`, not under `TestReview`. Please update the examples to use real node IDs from the repo, for example existing classes/tests in `tests/test_mcp_server.py`, `tests/test_merge_pr.py`, or the module-level test in `tests/test_review_pr.py`. 2. The required full-suite check `./venv/bin/python -m pytest tests/ -q` did not complete in my isolated review worktree after several minutes and had to be interrupted, so the required verification gate is not passed in this review. Other checks completed before stopping: changed files matched the expected docs-only set (`README.md`, `docs/developer-testing-guidelines.md`), `python3 -m py_compile mcp_server.py` passed, `python3 -m py_compile manage_labels.py` passed, `bash -n scripts/clear-provenance` passed, and `git diff --check` passed.
jcwalker3 added 1 commit 2026-07-02 12:06:35 -05:00
sysadmin reviewed 2026-07-02 12:11:11 -05:00
sysadmin left a comment
Owner

Re-reviewed PR #81 at 625f835aa7. Prior blockers are fixed: corrected pytest node IDs collect and run, changed files remain docs-only, README links to the guide, the guide accurately states there is no third-party secret scanner, and required checks pass including 327 tests.

Re-reviewed PR #81 at 625f835aa7bd7b33feb2c2554fc1b77f68efd838. Prior blockers are fixed: corrected pytest node IDs collect and run, changed files remain docs-only, README links to the guide, the guide accurately states there is no third-party secret scanner, and required checks pass including 327 tests.
sysadmin merged commit 093945254d into master 2026-07-02 12:14:05 -05:00
Sign in to join this conversation.