@@ -280,21 +280,67 @@ jobs:
280280 echo "Transcript: $result"
281281 echo "$result" | grep -qi "fox\|lazy\|dog"
282282
283- - name : Server — health + transcription
283+ - name : Server — start, health check, transcription, stop
284284 if : steps.sve.outputs.available == 'true'
285285 run : |
286+ # Start server in background
286287 ./target/release/transcribe-server \
287- --model-dir "$MODEL_DIR" --port 18080 &
288+ --model-dir "$MODEL_DIR" \
289+ --port 18080 \
290+ --verbose &
288291 SERVER_PID=$!
292+ echo "Server PID: $SERVER_PID"
293+
294+ # Wait for server ready (up to 120 s — model loading takes time)
289295 for i in $(seq 1 120); do
290- curl -sf http://localhost:18080/health > /dev/null 2>&1 && break; sleep 1
296+ if curl -sf http://localhost:18080/health > /dev/null 2>&1; then
297+ echo "Server ready after ${i}s"; break
298+ fi
299+ sleep 1
291300 done
301+
302+ # Health endpoint
292303 curl -sf http://localhost:18080/health | grep -q '"ok"'
304+ echo "Health OK"
305+
306+ # JSON response
307+ json_resp=$(curl -sf \
308+ -X POST http://localhost:18080/v1/audio/transcriptions \
309+ -F "file=@tests/fixtures/sample2.wav;type=audio/wav" \
310+ -F "model=cohere-transcribe" \
311+ -F "language=en" \
312+ -F "response_format=json")
313+ echo "JSON: $json_resp"
314+ echo "$json_resp" | python3 -c "
315+ import sys,json
316+ d=json.load(sys.stdin)
317+ assert 'text' in d, 'Missing text'
318+ print('text:', d['text'])
319+ "
320+
321+ # Text response
293322 curl -sf \
294323 -X POST http://localhost:18080/v1/audio/transcriptions \
295324 -F "file=@tests/fixtures/sample2.wav;type=audio/wav" \
296- -F "model=cohere-transcribe" | python3 -c "import sys,json; assert 'text' in json.load(sys.stdin)"
325+ -F "model=cohere-transcribe" \
326+ -F "response_format=text"
327+ echo
328+
329+ # verbose_json response
330+ curl -sf \
331+ -X POST http://localhost:18080/v1/audio/transcriptions \
332+ -F "file=@tests/fixtures/sample2.wav;type=audio/wav" \
333+ -F "model=cohere-transcribe" \
334+ -F "response_format=verbose_json" | python3 -c "
335+ import sys,json
336+ d=json.load(sys.stdin)
337+ assert d['task']=='transcribe'
338+ assert 'text' in d and 'duration' in d and 'segments' in d
339+ print('verbose_json OK — duration:', d['duration'])
340+ "
341+
297342 kill $SERVER_PID
343+ echo "All server integration tests passed"
298344
299345 # ─────────────────────────────────────────────────────────────────────────────
300346 # Integration test — macOS Apple Silicon, mlx backend
@@ -340,6 +386,12 @@ jobs:
340386 env :
341387 MACOSX_DEPLOYMENT_TARGET : " 14.0"
342388
389+ - name : Copy mlx.metallib next to binaries
390+ run : |
391+ # MLX runtime looks for mlx.metallib in the same directory as the binary
392+ find target/release/build -name "mlx.metallib" -exec cp {} target/release/ \;
393+ ls -lh target/release/mlx.metallib
394+
343395 - name : CLI — transcribe sample2.wav
344396 run : |
345397 result=$(./target/release/transcribe \
@@ -349,17 +401,63 @@ jobs:
349401 echo "Transcript: $result"
350402 echo "$result" | grep -qi "fox\|lazy\|dog"
351403
352- - name : Server — health + transcription
404+ - name : Server — start, health check, transcription, stop
353405 run : |
406+ # Start server in background
354407 ./target/release/transcribe-server \
355- --model-dir "$MODEL_DIR" --port 18080 &
408+ --model-dir "$MODEL_DIR" \
409+ --port 18080 \
410+ --verbose &
356411 SERVER_PID=$!
412+ echo "Server PID: $SERVER_PID"
413+
414+ # Wait for server ready (up to 120 s — model loading takes time)
357415 for i in $(seq 1 120); do
358- curl -sf http://localhost:18080/health > /dev/null 2>&1 && break; sleep 1
416+ if curl -sf http://localhost:18080/health > /dev/null 2>&1; then
417+ echo "Server ready after ${i}s"; break
418+ fi
419+ sleep 1
359420 done
421+
422+ # Health endpoint
360423 curl -sf http://localhost:18080/health | grep -q '"ok"'
424+ echo "Health OK"
425+
426+ # JSON response
427+ json_resp=$(curl -sf \
428+ -X POST http://localhost:18080/v1/audio/transcriptions \
429+ -F "file=@tests/fixtures/sample2.wav;type=audio/wav" \
430+ -F "model=cohere-transcribe" \
431+ -F "language=en" \
432+ -F "response_format=json")
433+ echo "JSON: $json_resp"
434+ echo "$json_resp" | python3 -c "
435+ import sys,json
436+ d=json.load(sys.stdin)
437+ assert 'text' in d, 'Missing text'
438+ print('text:', d['text'])
439+ "
440+
441+ # Text response
361442 curl -sf \
362443 -X POST http://localhost:18080/v1/audio/transcriptions \
363444 -F "file=@tests/fixtures/sample2.wav;type=audio/wav" \
364- -F "model=cohere-transcribe" | python3 -c "import sys,json; assert 'text' in json.load(sys.stdin)"
445+ -F "model=cohere-transcribe" \
446+ -F "response_format=text"
447+ echo
448+
449+ # verbose_json response
450+ curl -sf \
451+ -X POST http://localhost:18080/v1/audio/transcriptions \
452+ -F "file=@tests/fixtures/sample2.wav;type=audio/wav" \
453+ -F "model=cohere-transcribe" \
454+ -F "response_format=verbose_json" | python3 -c "
455+ import sys,json
456+ d=json.load(sys.stdin)
457+ assert d['task']=='transcribe'
458+ assert 'text' in d and 'duration' in d and 'segments' in d
459+ print('verbose_json OK — duration:', d['duration'])
460+ "
461+
365462 kill $SERVER_PID
463+ echo "All server integration tests passed"
0 commit comments