test: smoke worker with speechbrain force on local livekit
This commit is contained in:
+18
-8
@@ -12,18 +12,23 @@ sys.path.insert(0, str(HERE))
|
||||
from discovery import discover_cameras
|
||||
from tokens import make_token
|
||||
|
||||
cam = discover_cameras()[0]
|
||||
tok = make_token("ws://localhost:7880", "devkey", "devsecret", "smoke", "smoke-test")
|
||||
cams = discover_cameras()
|
||||
if not cams:
|
||||
raise SystemExit("no cameras discovered")
|
||||
cam = cams[0]
|
||||
url = "ws://127.0.0.1:7880"
|
||||
tok = make_token(url, "devkey", "devsecret", "smoke", cam.identity)
|
||||
|
||||
p = subprocess.Popen(
|
||||
[str(HERE / ".venv/bin/python"), str(HERE / "run_worker.py"),
|
||||
"--camera-json", json.dumps({
|
||||
"index": 0, "identity": "smoke-test",
|
||||
"index": cam.index, "identity": cam.identity,
|
||||
"video_device": cam.video_device, "audio_card": cam.audio_card,
|
||||
"usb_port": cam.usb_port}),
|
||||
"--room", "smoke", "--url", "ws://localhost:7880", "--token", tok,
|
||||
"--width", "640", "--height", "480", "--fps", "30",
|
||||
"--audio-rate", "16000", "--enhance-mode", "off"],
|
||||
"usb_port": cam.usb_port, "serial": cam.serial}),
|
||||
"--room", "smoke", "--url", url, "--token", tok,
|
||||
"--width", "640", "--height", "480", "--fps", "15",
|
||||
"--audio-rate", "16000", "--enhance-mode", "force",
|
||||
"--enhance-chunk-s", "1.0", "--enhance-hop-s", "0.2"],
|
||||
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, bufsize=1,
|
||||
)
|
||||
t0 = time.time()
|
||||
@@ -40,4 +45,9 @@ except subprocess.TimeoutExpired:
|
||||
p.kill()
|
||||
rc = "killed"
|
||||
print(f"--- smoke test done: rc={rc}")
|
||||
print("published markers:", [l for l in lines if "published" in l or "status" in l or "UP" in l])
|
||||
print("published markers:",
|
||||
[l for l in lines if "published" in l or "status" in l or "UP" in l
|
||||
or "backend" in l])
|
||||
ok = any("audio backend: model" in l for l in lines) and any(
|
||||
"published video+audio" in l or "status: UP" in l for l in lines)
|
||||
sys.exit(0 if ok else 1)
|
||||
|
||||
Reference in New Issue
Block a user