forked from warpdotdev/warp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_warpctrl_early_dispatch
More file actions
executable file
·49 lines (46 loc) · 1.12 KB
/
Copy pathtest_warpctrl_early_dispatch
File metadata and controls
executable file
·49 lines (46 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env bash
set -e
workspace_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
discovery_dir="$(mktemp -d)"
trap 'rm -rf "$discovery_dir"' EXIT
python3 - "$workspace_root" "$discovery_dir" <<'PY'
import os
import pathlib
import subprocess
import sys
workspace_root = pathlib.Path(sys.argv[1])
discovery_dir = sys.argv[2]
environment = os.environ.copy()
environment["WARP_LOCAL_CONTROL_DISCOVERY_DIR"] = discovery_dir
result = subprocess.run(
[
"cargo",
"run",
"-p",
"warp",
"--bin",
"warp",
"--features",
"warp_control_cli",
"--",
"--warpctrl",
"--output-format",
"json",
"instance",
"list",
],
cwd=workspace_root,
env=environment,
capture_output=True,
text=True,
timeout=180,
)
if result.returncode != 0:
sys.stderr.write(result.stderr)
sys.stderr.write(result.stdout)
raise SystemExit(result.returncode)
if result.stdout.strip() != "[]":
sys.stderr.write(result.stderr)
sys.stderr.write(f"unexpected warpctrl output: {result.stdout!r}\n")
raise SystemExit(1)
PY