Skip to content

Commit 5cb9e7d

Browse files
Dan-Floresfacebook-github-bot
authored andcommitted
Disable ffprobe test internally (meta-pytorch#900)
Summary: Tests related to `custom_frame_mappings` that utilize ffprobe should be skipped internally as ffprobe is not available. In addition to adding the `pytest.skip` decorator to these tests, I removed `custom_frame_mapping` generation from `pytest.mark.parametrize` in `test_custom_frame_mappings_init_fails` to allow tests to run. Reviewed By: scotts Differential Revision: D82378431
1 parent ab026c8 commit 5cb9e7d

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

test/test_decoders.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,9 @@ def test_get_frame_at_av1(self, device):
577577
if device == "cuda" and get_ffmpeg_major_version() == 4:
578578
return
579579

580+
if device == "cuda" and in_fbcode():
581+
pytest.skip("AV1 decoding on CUDA is not supported internally")
582+
580583
decoder = VideoDecoder(AV1_VIDEO.path, device=device)
581584
ref_frame10 = AV1_VIDEO.get_frame_data_by_index(10)
582585
ref_frame_info10 = AV1_VIDEO.get_frame_info(10)
@@ -1292,6 +1295,10 @@ def setup_frame_mappings(tmp_path, file, stream_index):
12921295
# Return the custom frame mappings as a JSON string
12931296
return custom_frame_mappings
12941297

1298+
@pytest.mark.skipif(
1299+
in_fbcode(),
1300+
reason="ffprobe not available internally",
1301+
)
12951302
@pytest.mark.parametrize("device", all_supported_devices())
12961303
@pytest.mark.parametrize("stream_index", [0, 3])
12971304
@pytest.mark.parametrize(
@@ -1338,12 +1345,16 @@ def test_custom_frame_mappings_json_and_bytes(
13381345
),
13391346
)
13401347

1348+
@pytest.mark.skipif(
1349+
in_fbcode(),
1350+
reason="ffprobe not available internally",
1351+
)
13411352
@pytest.mark.parametrize("device", all_supported_devices())
13421353
@pytest.mark.parametrize(
13431354
"custom_frame_mappings,expected_match",
13441355
[
13451356
pytest.param(
1346-
NASA_VIDEO.generate_custom_frame_mappings(0),
1357+
None,
13471358
"seek_mode",
13481359
id="valid_content_approximate",
13491360
),
@@ -1361,6 +1372,8 @@ def test_custom_frame_mappings_json_and_bytes(
13611372
def test_custom_frame_mappings_init_fails(
13621373
self, device, custom_frame_mappings, expected_match
13631374
):
1375+
if custom_frame_mappings is None:
1376+
custom_frame_mappings = NASA_VIDEO.generate_custom_frame_mappings(0)
13641377
with pytest.raises(ValueError, match=expected_match):
13651378
VideoDecoder(
13661379
NASA_VIDEO.path,

test/test_ops.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import io
99
import os
1010
from functools import partial
11+
from .utils import in_fbcode
1112

1213
os.environ["TORCH_LOGS"] = "output_code"
1314
import json
@@ -480,6 +481,10 @@ def test_frame_pts_equality(self):
480481
)
481482
assert pts_is_equal
482483

484+
@pytest.mark.skipif(
485+
in_fbcode(),
486+
reason="ffprobe not available internally",
487+
)
483488
def test_seek_mode_custom_frame_mappings_fails(self):
484489
decoder = create_from_file(
485490
str(NASA_VIDEO.path), seek_mode="custom_frame_mappings"

0 commit comments

Comments
 (0)