From 0e750759912befa35048df89f9c9a99f7c429f8c Mon Sep 17 00:00:00 2001 From: voluntas Date: Tue, 14 Jan 2025 14:33:53 +0900 Subject: [PATCH 1/7] =?UTF-8?q?[e2e]=20540p=20=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_degradation_preference.py | 51 +++++++++++++++------------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/tests/test_degradation_preference.py b/tests/test_degradation_preference.py index fb115da..b99b8cb 100644 --- a/tests/test_degradation_preference.py +++ b/tests/test_degradation_preference.py @@ -4,6 +4,11 @@ from client import SoraClient, SoraDegradationPreference, SoraRole +VIDEO_CODEC_TYPE = "VP8" +VIDEO_BIT_RATE = 100 +VIDEO_WIDTH = 960 +VIDEO_HEIGHT = 540 + def test_degradation_preference_maintain_framerate(setup): signaling_urls = setup.get("signaling_urls") @@ -18,11 +23,11 @@ def test_degradation_preference_maintain_framerate(setup): channel_id, audio=False, video=True, - video_codec_type="VP8", - video_bit_rate=100, + video_codec_type=VIDEO_CODEC_TYPE, + video_bit_rate=VIDEO_BIT_RATE, metadata=metadata, - video_width=1280, - video_height=720, + video_width=VIDEO_WIDTH, + video_height=VIDEO_HEIGHT, degradation_preference=SoraDegradationPreference.MAINTAIN_FRAMERATE, ) sendonly.connect(fake_video=True) @@ -72,11 +77,11 @@ def test_degradation_preference_maintain_resolution(setup): channel_id, audio=False, video=True, - video_codec_type="VP8", - video_bit_rate=100, + video_codec_type=VIDEO_CODEC_TYPE, + video_bit_rate=VIDEO_BIT_RATE, metadata=metadata, - video_width=1280, - video_height=720, + video_width=VIDEO_WIDTH, + video_height=VIDEO_HEIGHT, degradation_preference=SoraDegradationPreference.MAINTAIN_RESOLUTION, ) sendonly.connect(fake_video=True) @@ -89,15 +94,15 @@ def test_degradation_preference_maintain_resolution(setup): # codec が無かったら StopIteration 例外が上がる sendonly_codec_stats = next(s for s in sendonly_stats if s.get("type") == "codec") - assert sendonly_codec_stats["mimeType"] == "video/VP8" + assert sendonly_codec_stats["mimeType"] == f"video/{VIDEO_CODEC_TYPE}" # outbound-rtp が無かったら StopIteration 例外が上がる outbound_rtp_stats = next(s for s in sendonly_stats if s.get("type") == "outbound-rtp") assert outbound_rtp_stats["bytesSent"] > 0 assert outbound_rtp_stats["packetsSent"] > 0 # 解像度が維持されてる - assert outbound_rtp_stats["frameWidth"] == 1280 - assert outbound_rtp_stats["frameHeight"] == 720 + assert outbound_rtp_stats["frameWidth"] == VIDEO_WIDTH + assert outbound_rtp_stats["frameHeight"] == VIDEO_HEIGHT # ビットレートが 100 kbps 以下 assert outbound_rtp_stats["targetBitrate"] < 100_000 @@ -125,11 +130,11 @@ def test_degradation_preference_balanced(setup): channel_id, audio=False, video=True, - video_codec_type="VP8", - video_bit_rate=100, + video_codec_type=VIDEO_CODEC_TYPE, + video_bit_rate=VIDEO_BIT_RATE, metadata=metadata, - video_width=1280, - video_height=720, + video_width=VIDEO_WIDTH, + video_height=VIDEO_HEIGHT, degradation_preference=SoraDegradationPreference.BALANCED, ) sendonly.connect(fake_video=True) @@ -142,7 +147,7 @@ def test_degradation_preference_balanced(setup): # codec が無かったら StopIteration 例外が上がる sendonly_codec_stats = next(s for s in sendonly_stats if s.get("type") == "codec") - assert sendonly_codec_stats["mimeType"] == "video/VP8" + assert sendonly_codec_stats["mimeType"] == f"video/{VIDEO_CODEC_TYPE}" # outbound-rtp が無かったら StopIteration 例外が上がる outbound_rtp_stats = next(s for s in sendonly_stats if s.get("type") == "outbound-rtp") @@ -179,11 +184,11 @@ def test_degradation_preference_disabled(setup): channel_id, audio=False, video=True, - video_codec_type="VP8", - video_bit_rate=100, + video_codec_type=VIDEO_CODEC_TYPE, + video_bit_rate=VIDEO_BIT_RATE, metadata=metadata, - video_width=1280, - video_height=720, + video_width=VIDEO_WIDTH, + video_height=VIDEO_HEIGHT, degradation_preference=SoraDegradationPreference.DISABLED, ) sendonly.connect(fake_video=True) @@ -196,14 +201,14 @@ def test_degradation_preference_disabled(setup): # codec が無かったら StopIteration 例外が上がる sendonly_codec_stats = next(s for s in sendonly_stats if s.get("type") == "codec") - assert sendonly_codec_stats["mimeType"] == "video/VP8" + assert sendonly_codec_stats["mimeType"] == f"video/{VIDEO_CODEC_TYPE}" # outbound-rtp が無かったら StopIteration 例外が上がる outbound_rtp_stats = next(s for s in sendonly_stats if s.get("type") == "outbound-rtp") assert outbound_rtp_stats["bytesSent"] > 0 assert outbound_rtp_stats["packetsSent"] > 0 - assert outbound_rtp_stats["frameWidth"] == 1280 - assert outbound_rtp_stats["frameHeight"] == 720 + assert outbound_rtp_stats["frameWidth"] == VIDEO_WIDTH + assert outbound_rtp_stats["frameHeight"] == VIDEO_HEIGHT # ビットレートが 100 kbps 以下 assert outbound_rtp_stats["targetBitrate"] < 100_000 # フレームレートが 20 以上 From 68189c62c4685760f5b77686c895fd697f8c1aca Mon Sep 17 00:00:00 2001 From: voluntas Date: Tue, 14 Jan 2025 14:38:10 +0900 Subject: [PATCH 2/7] =?UTF-8?q?=E3=83=93=E3=83=83=E3=83=88=E3=83=AC?= =?UTF-8?q?=E3=83=BC=E3=83=88=E3=81=8C=E4=BD=8E=E3=81=99=E3=81=8E=E3=82=8B?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E6=80=A7=E3=81=8C=E3=81=82=E3=82=8B=E3=81=AE?= =?UTF-8?q?=E3=81=A7=20500=20=E3=81=AB=E4=B8=8A=E3=81=92=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_degradation_preference.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_degradation_preference.py b/tests/test_degradation_preference.py index b99b8cb..69c9b4d 100644 --- a/tests/test_degradation_preference.py +++ b/tests/test_degradation_preference.py @@ -5,7 +5,7 @@ from client import SoraClient, SoraDegradationPreference, SoraRole VIDEO_CODEC_TYPE = "VP8" -VIDEO_BIT_RATE = 100 +VIDEO_BIT_RATE = 500 VIDEO_WIDTH = 960 VIDEO_HEIGHT = 540 From 1cd6697639ce09565bb1df1f22c7247c89fedb12 Mon Sep 17 00:00:00 2001 From: voluntas Date: Tue, 14 Jan 2025 16:24:23 +0900 Subject: [PATCH 3/7] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E6=95=B4?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_degradation_preference.py | 36 ++++++++++++++-------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/test_degradation_preference.py b/tests/test_degradation_preference.py index 69c9b4d..ced4fcc 100644 --- a/tests/test_degradation_preference.py +++ b/tests/test_degradation_preference.py @@ -5,9 +5,9 @@ from client import SoraClient, SoraDegradationPreference, SoraRole VIDEO_CODEC_TYPE = "VP8" -VIDEO_BIT_RATE = 500 +VIDEO_BIT_RATE = 300 VIDEO_WIDTH = 960 -VIDEO_HEIGHT = 540 +VIDEO_HEIGHT = 528 def test_degradation_preference_maintain_framerate(setup): @@ -46,10 +46,10 @@ def test_degradation_preference_maintain_framerate(setup): outbound_rtp_stats = next(s for s in sendonly_stats if s.get("type") == "outbound-rtp") assert outbound_rtp_stats["bytesSent"] > 0 assert outbound_rtp_stats["packetsSent"] > 0 - assert outbound_rtp_stats["frameWidth"] <= 320 - assert outbound_rtp_stats["frameHeight"] <= 180 - # ビットレートが 100 kbps 以下 - assert outbound_rtp_stats["targetBitrate"] < 100_000 + assert outbound_rtp_stats["frameWidth"] <= 640 + assert outbound_rtp_stats["frameHeight"] <= 360 + # ビットレートが 500 kbps 以下 + assert outbound_rtp_stats["targetBitrate"] < VIDEO_BIT_RATE * 1000 # 20 以上を維持してる assert outbound_rtp_stats["framesPerSecond"] > 20 @@ -103,8 +103,8 @@ def test_degradation_preference_maintain_resolution(setup): # 解像度が維持されてる assert outbound_rtp_stats["frameWidth"] == VIDEO_WIDTH assert outbound_rtp_stats["frameHeight"] == VIDEO_HEIGHT - # ビットレートが 100 kbps 以下 - assert outbound_rtp_stats["targetBitrate"] < 100_000 + # ビットレートが 500 kbps 以下 + assert outbound_rtp_stats["targetBitrate"] < VIDEO_BIT_RATE * 1000 print( outbound_rtp_stats["frameWidth"], @@ -153,12 +153,12 @@ def test_degradation_preference_balanced(setup): outbound_rtp_stats = next(s for s in sendonly_stats if s.get("type") == "outbound-rtp") assert outbound_rtp_stats["bytesSent"] > 0 assert outbound_rtp_stats["packetsSent"] > 0 - assert outbound_rtp_stats["frameWidth"] <= 320 - assert outbound_rtp_stats["frameHeight"] <= 180 - # ビットレートが 100 kbps 以下 - assert outbound_rtp_stats["targetBitrate"] < 100_000 - # フレームレートが 20 未満 - assert outbound_rtp_stats["framesPerSecond"] < 20 + assert outbound_rtp_stats["frameWidth"] <= 640 + assert outbound_rtp_stats["frameHeight"] <= 360 + # ビットレートが 500 kbps 未満 + assert outbound_rtp_stats["targetBitrate"] < VIDEO_BIT_RATE * 1000 + # フレームレートが 30 未満 + assert outbound_rtp_stats["framesPerSecond"] < 30 print( outbound_rtp_stats["frameWidth"], @@ -209,10 +209,10 @@ def test_degradation_preference_disabled(setup): assert outbound_rtp_stats["packetsSent"] > 0 assert outbound_rtp_stats["frameWidth"] == VIDEO_WIDTH assert outbound_rtp_stats["frameHeight"] == VIDEO_HEIGHT - # ビットレートが 100 kbps 以下 - assert outbound_rtp_stats["targetBitrate"] < 100_000 - # フレームレートが 20 以上 - assert outbound_rtp_stats["framesPerSecond"] >= 20 + # ビットレートが 500 kbps 未満 + assert outbound_rtp_stats["targetBitrate"] < VIDEO_BIT_RATE * 1000 + # フレームレートが 30 未満 + assert outbound_rtp_stats["framesPerSecond"] < 30 print( outbound_rtp_stats["frameWidth"], From 40905a8a27c6d990c043b5dedada33c34b966184 Mon Sep 17 00:00:00 2001 From: voluntas Date: Tue, 14 Jan 2025 16:36:58 +0900 Subject: [PATCH 4/7] =?UTF-8?q?degradation=5Fpreference=20=E3=81=AF=20maco?= =?UTF-8?q?s=20=E3=81=A7=E3=81=AF=20skip=20=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_degradation_preference.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_degradation_preference.py b/tests/test_degradation_preference.py index ced4fcc..7a3b53a 100644 --- a/tests/test_degradation_preference.py +++ b/tests/test_degradation_preference.py @@ -2,6 +2,7 @@ import time import uuid +import pytest from client import SoraClient, SoraDegradationPreference, SoraRole VIDEO_CODEC_TYPE = "VP8" @@ -10,6 +11,7 @@ VIDEO_HEIGHT = 528 +@pytest.mark.skipif(sys.platform == "darwin", reason="macOS では性能がでないためスキップする") def test_degradation_preference_maintain_framerate(setup): signaling_urls = setup.get("signaling_urls") channel_id_prefix = setup.get("channel_id_prefix") @@ -61,6 +63,7 @@ def test_degradation_preference_maintain_framerate(setup): ) +@pytest.mark.skipif(sys.platform == "darwin", reason="macOS では性能がでないためスキップする") def test_degradation_preference_maintain_resolution(setup): """ フレームレートがあまり変わらない @@ -114,6 +117,7 @@ def test_degradation_preference_maintain_resolution(setup): ) +@pytest.mark.skipif(sys.platform == "darwin", reason="macOS では性能がでないためスキップする") def test_degradation_preference_balanced(setup): """ バランス思った以上に両方悪くなる @@ -168,6 +172,7 @@ def test_degradation_preference_balanced(setup): ) +@pytest.mark.skipif(sys.platform == "darwin", reason="macOS では性能がでないためスキップする") def test_degradation_preference_disabled(setup): """ 無効にする From de5d221cd9a3ce2f400a10084386bddb15eeb1b7 Mon Sep 17 00:00:00 2001 From: voluntas Date: Tue, 14 Jan 2025 16:49:22 +0900 Subject: [PATCH 5/7] =?UTF-8?q?CI=20macos=20=E3=81=AF=20skip=20=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_degradation_preference.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/tests/test_degradation_preference.py b/tests/test_degradation_preference.py index 7a3b53a..21204a4 100644 --- a/tests/test_degradation_preference.py +++ b/tests/test_degradation_preference.py @@ -1,3 +1,4 @@ +import os import sys import time import uuid @@ -11,7 +12,10 @@ VIDEO_HEIGHT = 528 -@pytest.mark.skipif(sys.platform == "darwin", reason="macOS では性能がでないためスキップする") +@pytest.mark.skipif( + os.getenv("CI") == "true" and sys.platform == "darwin", + reason="CI の macOS では性能がでないためスキップする", +) def test_degradation_preference_maintain_framerate(setup): signaling_urls = setup.get("signaling_urls") channel_id_prefix = setup.get("channel_id_prefix") @@ -63,7 +67,10 @@ def test_degradation_preference_maintain_framerate(setup): ) -@pytest.mark.skipif(sys.platform == "darwin", reason="macOS では性能がでないためスキップする") +@pytest.mark.skipif( + os.getenv("CI") == "true" and sys.platform == "darwin", + reason="CI の macOS では性能がでないためスキップする", +) def test_degradation_preference_maintain_resolution(setup): """ フレームレートがあまり変わらない @@ -117,7 +124,10 @@ def test_degradation_preference_maintain_resolution(setup): ) -@pytest.mark.skipif(sys.platform == "darwin", reason="macOS では性能がでないためスキップする") +@pytest.mark.skipif( + os.getenv("CI") == "true" and sys.platform == "darwin", + reason="CI の macOS では性能がでないためスキップする", +) def test_degradation_preference_balanced(setup): """ バランス思った以上に両方悪くなる @@ -172,7 +182,10 @@ def test_degradation_preference_balanced(setup): ) -@pytest.mark.skipif(sys.platform == "darwin", reason="macOS では性能がでないためスキップする") +@pytest.mark.skipif( + os.getenv("CI") == "true" and sys.platform == "darwin", + reason="CI の macOS では性能がでないためスキップする", +) def test_degradation_preference_disabled(setup): """ 無効にする From 5bceb84390f299ef5a7d1fe6d08fc7e463e94cf3 Mon Sep 17 00:00:00 2001 From: voluntas Date: Tue, 14 Jan 2025 16:49:33 +0900 Subject: [PATCH 6/7] =?UTF-8?q?CI=20=E3=81=A7=20linux=20=E3=81=98=E3=82=83?= =?UTF-8?q?=E3=81=AA=E3=81=84=E5=A0=B4=E5=90=88=E3=81=AF=20skip=20?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_sora_disconnect.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/test_sora_disconnect.py b/tests/test_sora_disconnect.py index 518250d..d922c23 100644 --- a/tests/test_sora_disconnect.py +++ b/tests/test_sora_disconnect.py @@ -1,3 +1,4 @@ +import os import sys import time import uuid @@ -10,7 +11,10 @@ from sora_sdk import SoraSignalingErrorCode -@pytest.mark.skipif(sys.platform != "linux", reason="linux でのみ実行する") +@pytest.mark.skipif( + os.getenv("CI") == "true" and sys.platform != "linux", + reason="CI では linux でのみ実行する", +) def test_websocket_signaling_only_disconnect_api(setup): signaling_urls = setup.get("signaling_urls") channel_id_prefix = setup.get("channel_id_prefix") @@ -84,7 +88,9 @@ def test_websocket_signaling_only_lifetime_expired(setup): assert conn.ws_close_reason == "LIFETIME-EXPIRED" -@pytest.mark.skipif(sys.platform != "linux", reason="linux でのみ実行する") +@pytest.mark.skipif( + os.getenv("CI") == "true" and sys.platform != "linux", reason="linux でのみ実行する" +) def test_websocket_datachannel_signaling_disconnect_api(setup): signaling_urls = setup.get("signaling_urls") channel_id_prefix = setup.get("channel_id_prefix") @@ -158,7 +164,9 @@ def test_websocket_datachannel_signaling_lifetime_expired(setup): assert conn.ws_close_reason == "LIFETIME-EXPIRED" -@pytest.mark.skipif(sys.platform != "linux", reason="linux でのみ実行する") +@pytest.mark.skipif( + os.getenv("CI") == "true" and sys.platform != "linux", reason="linux でのみ実行する" +) def test_datachannel_only_signaling_disconnect_api(setup): signaling_urls = setup.get("signaling_urls") channel_id_prefix = setup.get("channel_id_prefix") From 097c3b2321692a488fac134d650a4d1818174b28 Mon Sep 17 00:00:00 2001 From: voluntas Date: Tue, 14 Jan 2025 17:03:48 +0900 Subject: [PATCH 7/7] =?UTF-8?q?macOS=20=E3=82=A4=E3=83=B3=E3=82=B9?= =?UTF-8?q?=E3=82=BF=E3=83=B3=E3=82=B9=E3=81=A7=E3=81=AF=E5=AE=9F=E8=A1=8C?= =?UTF-8?q?=E3=81=97=E3=81=AA=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_simulcast.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_simulcast.py b/tests/test_simulcast.py index 6399bbb..3a93a67 100644 --- a/tests/test_simulcast.py +++ b/tests/test_simulcast.py @@ -1,3 +1,4 @@ +import os import sys import time import uuid @@ -6,6 +7,9 @@ from client import SoraClient, SoraRole +@pytest.mark.skipif( + os.getenv("CI") == "true" and sys.platform == "darwin", reason="darwin では実行しない" +) @pytest.mark.parametrize( ( "video_codec_type", @@ -113,7 +117,7 @@ def test_simulcast( assert encoder_implementation in s["encoderImplementation"] assert s["bytesSent"] > 1000 - assert s["packetsSent"] > 20 + assert s["packetsSent"] > 10 # targetBitrate が指定したビットレートの 90% 以上、100% 以下に収まることを確認 expected_bitrate = video_bit_rate * 1000 print(