From c798d8fd8f7e231f778eee3d10a141e4b00a44f6 Mon Sep 17 00:00:00 2001 From: Jared Knowles Date: Thu, 12 Nov 2026 18:35:36 -0500 Subject: [PATCH] test: local-drafter flow tests run as a normal user under a root CI 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 --- tests/test_cli_local.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/test_cli_local.py b/tests/test_cli_local.py index 69cef59..e708e78 100644 --- a/tests/test_cli_local.py +++ b/tests/test_cli_local.py @@ -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),