Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion tests/control_plane/test_cold_source_disposition_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,23 @@ 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())",
"--registry", str(fixture.registry), "--runtime-root", str(fixture.runtime),
"--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)
Expand Down
Loading