1 Commits
Author SHA1 Message Date
jaredandClaude Opus 5.5 c798d8fd8f test: local-drafter flow tests run as a normal user under a root CI
tests / unittest (push) Successful in 28s
CI runs the suite as root, where the drafter refuses to run pi without an unprivileged
user, so every local flow test exited 1 there and passed on a workstation. The flow tests
now patch geteuid to a normal user; the root refusal keeps its own test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 18:35:36 -05:00
+6
View File
@@ -30,6 +30,12 @@ class LocalSetup:
self.env.update({"INPUT_DRAFTER": "local", "INPUT_LOCAL_URL": URL,
"LOCAL_MODEL_API_KEY": KEY, "DOCS_REVIEW_PI_BIN": str(self.fake_pi)})
self.argv_file = tmp / "pi-argv"
# CI runs the suite as root, where the drafter refuses to run pi without an
# unprivileged user. These tests are about the flow, so they run as a normal user;
# the root refusal has its own test, which patches geteuid back to 0.
not_root = mock.patch.object(local.os, "geteuid", return_value=1000)
not_root.start()
self.addCleanup(not_root.stop)
def pi(self, **config):
config = {"sentinel": str(self.sentinel), "env_file": str(self.env_file),