From b4918d77c09730ca2853321ecc1a7f7bd1433e80 Mon Sep 17 00:00:00 2001 From: Yong Tang Date: Thu, 10 Feb 2022 10:58:57 -0800 Subject: [PATCH] Disable failing test on macOS Recently brew upgraded ffmpeg to 5.0 and as such some tests are failing on macOS. This PR disables failing tests on macOS. In order to fix the issue, we will need to upgrade the ffmpeg dependency to 5.0 (a follow up). Signed-off-by: Yong Tang --- tests/test_audio.py | 12 ++++++++++++ tests/test_ffmpeg.py | 16 ++++++++++++++++ tests/test_video.py | 8 ++++++++ 3 files changed, 36 insertions(+) diff --git a/tests/test_audio.py b/tests/test_audio.py index 849674de8..8fa634300 100644 --- a/tests/test_audio.py +++ b/tests/test_audio.py @@ -146,6 +146,10 @@ def test_audio_io_tensor(audio_data, io_tensor_func): assert np.all(audio_tensor_value == audio_value_value) +@pytest.mark.skipif( + sys.platform == "darwin", + reason="TODO: macOS on GitHub use ffmpeg 5.0, needs update", +) @pytest.mark.parametrize( ("io_dataset_func"), [ @@ -176,6 +180,10 @@ def test_audio_io_dataset(audio_data, io_dataset_func): assert i == 5760 +@pytest.mark.skipif( + sys.platform == "darwin", + reason="TODO: macOS on GitHub use ffmpeg 5.0, needs update", +) @pytest.mark.parametrize( ("io_tensor_func", "num_parallel_calls"), [ @@ -220,6 +228,10 @@ def func(filename, position): assert item == 2 +@pytest.mark.skipif( + sys.platform == "darwin", + reason="TODO: macOS on GitHub use ffmpeg 5.0, needs update", +) @pytest.mark.parametrize( ("io_dataset_func"), [ diff --git a/tests/test_ffmpeg.py b/tests/test_ffmpeg.py index 2353f1c5b..b9b543617 100644 --- a/tests/test_ffmpeg.py +++ b/tests/test_ffmpeg.py @@ -37,6 +37,10 @@ def fixture_audio_path(): ) +@pytest.mark.skipif( + sys.platform == "darwin", + reason="TODO: macOS on GitHub use ffmpeg 5.0, needs update", +) def test_ffmpeg_io_tensor_audio(audio_path): """test_ffmpeg_io_tensor_audio""" audio = tfio.IOTensor.from_audio(audio_path) @@ -78,6 +82,10 @@ def _test_ffmpeg_io_tensor_mkv(video_path): assert video("v:0").to_tensor().shape == [166, 320, 560, 3] +@pytest.mark.skipif( + sys.platform == "darwin", + reason="TODO: macOS on GitHub use ffmpeg 5.0, needs update", +) def test_ffmpeg_decode_video(video_path): """test_ffmpeg_decode_video""" content = tf.io.read_file(video_path) @@ -87,6 +95,10 @@ def test_ffmpeg_decode_video(video_path): assert np.abs(video[0] - video[-1]).sum() > 0 +@pytest.mark.skipif( + sys.platform == "darwin", + reason="TODO: macOS on GitHub use ffmpeg 5.0, needs update", +) def test_ffmpeg_decode_video_invalid_content(): """test_ffmpeg_decode_video_invalid_content""" content = tf.constant(b"bad-video") @@ -94,6 +106,10 @@ def test_ffmpeg_decode_video_invalid_content(): tfio.experimental.ffmpeg.decode_video(content, 0) +@pytest.mark.skipif( + sys.platform == "darwin", + reason="TODO: macOS on GitHub use ffmpeg 5.0, needs update", +) def test_ffmpeg_decode_video_invalid_index(video_path): """test_ffmpeg_decode_video_invalid_index""" content = tf.io.read_file(video_path) diff --git a/tests/test_video.py b/tests/test_video.py index 29e493ea3..0154631b7 100644 --- a/tests/test_video.py +++ b/tests/test_video.py @@ -33,6 +33,10 @@ def fixture_video_data(): return path, value +@pytest.mark.skipif( + sys.platform == "darwin", + reason="TODO: macOS on GitHub use ffmpeg 5.0, needs update", +) @pytest.mark.parametrize( ("io_dataset_func"), [ @@ -62,6 +66,10 @@ def test_video_io_dataset(video_data, io_dataset_func): assert i == 166 +@pytest.mark.skipif( + sys.platform == "darwin", + reason="TODO: macOS on GitHub use ffmpeg 5.0, needs update", +) @pytest.mark.parametrize( ("io_dataset_func"), [