From c244b7bf3f6736269fcf02458df4b03c3a360ce8 Mon Sep 17 00:00:00 2001 From: AIOSAI Date: Sat, 11 Jul 2026 03:42:04 -0700 Subject: [PATCH] =?UTF-8?q?test(drone):=20isolate=20cwd=20in=20test=5Fpr?= =?UTF-8?q?=5Fno=5Fbranch=5Fdir=20+=20test=5Fpr=5Fno=5Fargs.=20Both=20call?= =?UTF-8?q?ed=20handle=5Fcommand('pr',=20...)=20expecting=20exit=201=20(au?= =?UTF-8?q?th=20error)=20but=20lacked=20monkeypatch.chdir(tmp=5Fpath)=20?= =?UTF-8?q?=E2=80=94=20a=20real=20checkout's=20findable=20passport=20made?= =?UTF-8?q?=20auth=20PASS=20->=20exit=200,=20failing=20only=20when=20run?= =?UTF-8?q?=20from=20the=20repo=20root=20(full-suite=20run).=20Added=20chd?= =?UTF-8?q?ir(tmp=5Fpath)=20isolation=20matching=20sibling=20test=5Fstatus?= =?UTF-8?q?=5Fno=5Fbranch=5Fdir;=20assertions=20unchanged.=20drone=20864?= =?UTF-8?q?=20pass=20/=200=20fail.=20Pre-existing=20flake=20surfaced=20by?= =?UTF-8?q?=20the=20night-shift=20full-repo=20run.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 7 ++++++- src/aipass/drone/tests/test_git_module.py | 6 ++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2700b137..cfbc593a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/aipass/drone/tests/test_git_module.py b/src/aipass/drone/tests/test_git_module.py index 035d307b..21a0a95c 100644 --- a/src/aipass/drone/tests/test_git_module.py +++ b/src/aipass/drone/tests/test_git_module.py @@ -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