Skip to content

The agent that grows with you

test(tools): ffmpeg round-trip test skips when the ffmpeg on PATH cannot run

teknium1a05000810ab6
diff --git a/tests/tools/test_tts_container_repair.py b/tests/tools/test_tts_container_repair.py
index d4f898fc1bb..35c266efc42 100644
--- a/tests/tools/test_tts_container_repair.py
+++ b/tests/tools/test_tts_container_repair.py
@@ -67,13 +67,16 @@ class TestRepairOggContainer:
if not _shutil.which("ffmpeg"):
pytest.skip("ffmpeg not installed")
- # Synthesize a real tiny mp3 with ffmpeg, misname it .ogg
+ # Synthesize a real tiny mp3 with ffmpeg, misname it .ogg. "Available" means the binary
+ # runs AND carries the encoder: CI runners have shipped an ffmpeg on PATH that exits 127.
p = tmp_path / "v.ogg"
- _sp.run(
+ synth = _sp.run(
["ffmpeg", "-f", "lavfi", "-i", "sine=frequency=440:duration=0.3",
"-acodec", "libmp3lame", "-f", "mp3", str(p), "-y"],
- capture_output=True, check=True,
+ capture_output=True, check=False,
)
+ if synth.returncode != 0:
+ pytest.skip(f"ffmpeg on PATH cannot synthesize mp3 (exit {synth.returncode})")
assert _sniff_audio_container(str(p)) == "mp3"
result = _repair_ogg_container(str(p))
assert result == str(p)