From 0bab19d5e77f36c6129f37d26440a2489905aee4 Mon Sep 17 00:00:00 2001 From: Lihua <1017343802@qq.com> Date: Fri, 9 Oct 2026 19:45:51 -0700 Subject: [PATCH] test(stage2c): bind original CLI child to checkout source Signed-off-by: Lihua <1017343802@qq.com> --- .../control_plane/test_cold_source_disposition_e2e.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/control_plane/test_cold_source_disposition_e2e.py b/tests/control_plane/test_cold_source_disposition_e2e.py index ae741e4ab0..f0848c8857 100644 --- a/tests/control_plane/test_cold_source_disposition_e2e.py +++ b/tests/control_plane/test_cold_source_disposition_e2e.py @@ -110,6 +110,13 @@ def cold_cli(fixture, receiver_package, action, *args, success=True): def backup(fixture, name): + # The Stage2c job installs a wheel, while pytest imports the checkout. + # Keep this original-producer child on the same source as its parent; + # cold_cli separately binds the copied receiver through PYTHONPATH. + source_root = Path(loopx.__file__).resolve().parent.parent + source_pythonpath = os.pathsep.join(filter(None, ( + str(source_root), os.environ.get("PYTHONPATH", ""), + ))) child = subprocess.run([sys.executable, "-c", "import loopx,sys;print(loopx.__file__,file=sys.stderr);" "from loopx.entrypoint import main;raise SystemExit(main())", @@ -117,7 +124,9 @@ def backup(fixture, name): "--format", "json", "backup-state", "--project", str(fixture.state.parent), "--output-dir", str(fixture.state.parent.parent / "backups"), "--backup-id", name, "--current-project-only", "--no-skills", "--no-automations", "--execute"], - cwd=fixture.state.parent.parent, capture_output=True, text=True, timeout=60) + cwd=fixture.state.parent.parent, + env={**os.environ, "PYTHONPATH": source_pythonpath}, + capture_output=True, text=True, timeout=60) assert str(Path(loopx.__file__).resolve()) in child.stderr assert child.returncode == 0, child.stdout + child.stderr result = json.loads(child.stdout)