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:
+6
-1
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user