From 32f48682de20c396d27dc07d25d4714751fcff12 Mon Sep 17 00:00:00 2001 From: Felix Uhl Date: Fri, 17 Apr 2026 21:36:17 +0200 Subject: [PATCH] Fix test_doctor_shows_trust on macOS outside sandbox Change-Id: I1fd456a8c5563ba63f795bc4e41811ebeaec9c73 --- tests/functional2/testlib/fixtures/env.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/functional2/testlib/fixtures/env.py b/tests/functional2/testlib/fixtures/env.py index 0012a1e79..4a80023fe 100644 --- a/tests/functional2/testlib/fixtures/env.py +++ b/tests/functional2/testlib/fixtures/env.py @@ -221,8 +221,12 @@ class ManagedEnv: if platform.system() == "Darwin": # Darwin / Apple behaves differently and requires _NIX_TEST_NO_SANDBOX to be set for whatever reason self._env |= {"_NIX_TEST_NO_SANDBOX": "1"} - # copy global path to maintain features usually provided by busybox - [self.path.append(p) for p in global_path.split(":") if Path(p).exists()] + # Copy coreutils from the global path to maintain availability of commands that are not part of + # XCode Developer Tools and provided by busybox on Linux, which does not build on Darwin + for p in global_path.split(":"): + if Path(p).exists() and "coreutils" in p: + self.path.append(p) + break def set_env(self, name: str, value: str): if name in self.dirs.get_env_keys():