Add root-level run-tests.sh convenience runner for full validation #473

Closed
opened 2026-07-07 16:39:57 -05:00 by jcwalker3 · 2 comments
Owner

Problem

LLM sessions repeatedly need a canonical command for full validation, but there is no root-level runner. Sessions guess between pytest, python -m pytest, focused subsets, or ad hoc scripts, which leads to inconsistent validation (wrong interpreter, partial suites).

Evidence

  • No current root-level test runner exists. Root-level .sh on master = only mirror_refs.sh and sync_repos.sh (confirmed via git ls-tree prgs/master).
  • Prior names dev.sh / manage.sh were not deleted from Gitea-Tools master; they belong to inherited history from another project and were never on this repo's master.
  • Current full-suite command is direct pytest: venv/bin/python -m pytest.

Acceptance criteria

  1. Add a root-level executable script, preferably run-tests.sh, that runs the full test suite.
  2. The script must use the project virtual environment when available: venv/bin/python -m pytest.
  3. If venv/ is missing, fail with a clear setup message rather than silently using the wrong Python.
  4. Support passing extra pytest arguments, e.g. ./run-tests.sh tests/test_mcp_server.py -q.
  5. Include set -euo pipefail.
  6. Keep the script simple and repo-local; no network calls and no Gitea mutations.
  7. Update README or workflow docs to name ./run-tests.sh as the canonical full-validation command.
  8. Add a lightweight test or documentation check if this repo already has script/documentation validation patterns (e.g. assert the script exists, is executable, and references venv/bin/python -m pytest).

Non-goals

  • No CI wiring changes here (web UI CI gating is #436).
  • No change to test contents or interpreter beyond invoking the existing venv.

Notes

Keep behavior identical to venv/bin/python -m pytest — the script is a discoverable, guessing-free entry point, not a new test policy.

## Problem LLM sessions repeatedly need a canonical command for full validation, but there is no root-level runner. Sessions guess between `pytest`, `python -m pytest`, focused subsets, or ad hoc scripts, which leads to inconsistent validation (wrong interpreter, partial suites). ## Evidence - No current root-level test runner exists. Root-level `.sh` on `master` = only `mirror_refs.sh` and `sync_repos.sh` (confirmed via `git ls-tree prgs/master`). - Prior names `dev.sh` / `manage.sh` were **not** deleted from Gitea-Tools `master`; they belong to inherited history from another project and were never on this repo's `master`. - Current full-suite command is direct pytest: `venv/bin/python -m pytest`. ## Acceptance criteria 1. Add a root-level executable script, preferably `run-tests.sh`, that runs the full test suite. 2. The script must use the project virtual environment when available: `venv/bin/python -m pytest`. 3. If `venv/` is missing, fail with a clear setup message rather than silently using the wrong Python. 4. Support passing extra pytest arguments, e.g. `./run-tests.sh tests/test_mcp_server.py -q`. 5. Include `set -euo pipefail`. 6. Keep the script simple and repo-local; no network calls and no Gitea mutations. 7. Update README or workflow docs to name `./run-tests.sh` as the canonical full-validation command. 8. Add a lightweight test or documentation check if this repo already has script/documentation validation patterns (e.g. assert the script exists, is executable, and references `venv/bin/python -m pytest`). ## Non-goals - No CI wiring changes here (web UI CI gating is #436). - No change to test contents or interpreter beyond invoking the existing venv. ## Notes Keep behavior identical to `venv/bin/python -m pytest` — the script is a discoverable, guessing-free entry point, not a new test policy.
Author
Owner

Confirmed live #440-class deadlock while implementing #473.

Implementation completed and was pushed successfully:

  • Branch: feat/issue-473-run-tests-runner
  • Head: b15494deb9

PR creation is blocked on current master because:

  1. Initial issue lock succeeded.
  2. Implementation was committed and pushed.
  3. A concurrent session clobbered the single-slot global lock.
  4. create_pr then failed closed because the lock was missing.
  5. Re-lock recovery failed because the worktree was ahead of master.
  6. After reset, re-lock still failed because issue #473 already has a matching branch.
  7. Own-branch adoption recovery is not available on master yet.

No destructive recovery was performed:

  • no branch deletion
  • no force-push
  • no raw API bypass
  • no manual lock-file seeding

This branch should be recovered after the lock subsystem lands:

Expected recovery: once the lock subsystem is merged, gitea_lock_issue #473 should adopt the existing branch and create_pr should open the PR from b15494deb9.

Confirmed live #440-class deadlock while implementing #473. Implementation completed and was pushed successfully: - Branch: feat/issue-473-run-tests-runner - Head: b15494deb974af205a5d2eb898de4a14d10a1e41 PR creation is blocked on current master because: 1. Initial issue lock succeeded. 2. Implementation was committed and pushed. 3. A concurrent session clobbered the single-slot global lock. 4. create_pr then failed closed because the lock was missing. 5. Re-lock recovery failed because the worktree was ahead of master. 6. After reset, re-lock still failed because issue #473 already has a matching branch. 7. Own-branch adoption recovery is not available on master yet. No destructive recovery was performed: - no branch deletion - no force-push - no raw API bypass - no manual lock-file seeding This branch should be recovered after the lock subsystem lands: - #465 / #443 durable keyed locks - #461 / #442 own-branch adoption - #464 / #438 lock clobber hazard Expected recovery: once the lock subsystem is merged, gitea_lock_issue #473 should adopt the existing branch and create_pr should open the PR from b15494deb974af205a5d2eb898de4a14d10a1e41.
Owner

Canonical Issue State

STATE:
ready-for-merge

NEXT_ACTOR:
merger

NEXT_ACTION:
Merge PR #476 after fresh merger preflight confirms approval still applies at head b15494d.

NEXT_PROMPT:

You are the merger LLM for Scaled-Tech-Consulting/Gitea-Tools on prgs.

Target issue #473 via PR #476 (feat/issue-473-run-tests-runner @ b15494deb974af205a5d2eb898de4a14d10a1e41).

Preflight:
1. gitea_activate_profile → prgs-merger
2. gitea_whoami + gitea_resolve_task_capability(task="merge_pr")
3. gitea_get_pr_review_feedback(476) — approval_at_current_head must be true
4. gitea_check_pr_eligibility(476, action="merge") — must be eligible
5. gitea_merge_pr(476)
6. Update canonical state comments on #476 and #473 to merged/closed

Mutation ledger required. Do not touch /private/tmp/gitea_issue_lock.json.

SUMMARY:
Add a canonical repository-root test runner (./run-tests.sh) wrapping venv/bin/python -m pytest "$@" with fail-closed missing-venv handling and docs/tests. Implementation landed on branch feat/issue-473-run-tests-runner @ b15494d. PR #476 is open. Initial PR creation hit a #440-class lock deadlock (documented in issue comment 6244); branch was recovered and PR opened. Reviewer sysadmin approved at current head on 2026-07-07.

RELATED_DISCUSSION:
none

RELATED_PRS:

BRANCH:
feat/issue-473-run-tests-runner

HEAD_SHA:
b15494deb9

VALIDATION:
Author and reviewer validation documented in PR #476 body and review comments (focused pytest + missing-venv contract tests; git diff --check clean)

BLOCKERS:
none for merge — requires prgs-merger session (not author/reconciler). Optional author rebase for linear history does not block merge.

DUPLICATES_OR_SUPERSEDES:
none

LAST_UPDATED_BY:
sysadmin / prgs-merger / queue-controller / 2026-07-08

## Canonical Issue State STATE: ready-for-merge NEXT_ACTOR: merger NEXT_ACTION: Merge PR #476 after fresh merger preflight confirms approval still applies at head `b15494d`. NEXT_PROMPT: ```text You are the merger LLM for Scaled-Tech-Consulting/Gitea-Tools on prgs. Target issue #473 via PR #476 (feat/issue-473-run-tests-runner @ b15494deb974af205a5d2eb898de4a14d10a1e41). Preflight: 1. gitea_activate_profile → prgs-merger 2. gitea_whoami + gitea_resolve_task_capability(task="merge_pr") 3. gitea_get_pr_review_feedback(476) — approval_at_current_head must be true 4. gitea_check_pr_eligibility(476, action="merge") — must be eligible 5. gitea_merge_pr(476) 6. Update canonical state comments on #476 and #473 to merged/closed Mutation ledger required. Do not touch /private/tmp/gitea_issue_lock.json. ``` SUMMARY: Add a canonical repository-root test runner (`./run-tests.sh`) wrapping `venv/bin/python -m pytest "$@"` with fail-closed missing-venv handling and docs/tests. Implementation landed on branch `feat/issue-473-run-tests-runner` @ `b15494d`. PR #476 is open. Initial PR creation hit a #440-class lock deadlock (documented in issue comment 6244); branch was recovered and PR opened. Reviewer `sysadmin` approved at current head on 2026-07-07. RELATED_DISCUSSION: none RELATED_PRS: - #476 BRANCH: feat/issue-473-run-tests-runner HEAD_SHA: b15494deb974af205a5d2eb898de4a14d10a1e41 VALIDATION: Author and reviewer validation documented in PR #476 body and review comments (focused pytest + missing-venv contract tests; `git diff --check` clean) BLOCKERS: none for merge — requires `prgs-merger` session (not author/reconciler). Optional author rebase for linear history does not block merge. DUPLICATES_OR_SUPERSEDES: none LAST_UPDATED_BY: sysadmin / prgs-merger / queue-controller / 2026-07-08
Sign in to join this conversation.
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Scaled-Tech-Consulting/Gitea-Tools#473