test(drone): isolate cwd in test_pr_no_branch_dir + test_pr_no_args. Both called handle_command('pr', ...) expecting exit 1 (auth error) but lacked monkeypatch.chdir(tmp_path) — a real checkout's findable passport made auth PASS -> exit 0, failing only when run from the repo root (full-suite run). Added chdir(tmp_path) isolation matching sibling test_status_no_branch_dir; assertions unchanged. drone 864 pass / 0 fail. Pre-existing flake surfaced by the night-shift full-repo run.

This commit is contained in:
AIOSAI
2026-07-11 03:42:04 -07:00
parent 84177485ce
commit c244b7bf3f
2 changed files with 10 additions and 3 deletions
+6 -1
View File
@@ -25,7 +25,12 @@ PyPI version — not the changelog header.
aipass, commons — all 14 offenders now at 100%. **Fleet: 17/17 branches at
100% seedgo compliance** (hooks, skills, devpulse were already compliant).
Owners self-audited and self-fixed; devpulse verified every diff, re-ran each
branch's full test suite, and committed per wave.
branch's full test suite, and committed per wave. A full 17-branch test run
(~10,349 tests) surfaced one pre-existing flaky test in drone
(`test_pr_no_branch_dir` / `test_pr_no_args` lacked cwd isolation, so a real
checkout's findable passport made the auth path pass unexpectedly) — given
`monkeypatch.chdir(tmp_path)` isolation to match its sibling test, so the full
suite is now deterministically green.
### Fixed
+4 -2
View File
@@ -857,13 +857,15 @@ class TestGitModuleRouting:
assert result["exit_code"] == 1
assert "cannot detect" in result["stderr"].lower()
def test_pr_no_args(self) -> None:
def test_pr_no_args(self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
"""pr command without args fails (auth or usage)."""
monkeypatch.chdir(tmp_path)
result = handle_command("pr")
assert result["exit_code"] == 1
def test_pr_no_branch_dir(self) -> None:
def test_pr_no_branch_dir(self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
"""pr command without passport returns auth error."""
monkeypatch.chdir(tmp_path)
result = handle_command("pr", ["some description"])
assert result["exit_code"] == 1