Skip to content

Commit 612b97b

Browse files
committed
Apple Video Toolbox を専用テストにする
1 parent 3ddeb7d commit 612b97b

File tree

2 files changed

+96
-10
lines changed

2 files changed

+96
-10
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: e2e-test-apple-video-toolbox
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
paths:
7+
- ".github/workflows/e2e-test-apple-video-toolbox.yml"
8+
- "tests/test_apple_video_toolbox.py"
9+
# C++ SDK のアップデートしたときテストするため
10+
- "VERSION"
11+
schedule:
12+
# UTC の 01:00 は JST だと 10:00 。
13+
# 1-5 で 月曜日から金曜日
14+
- cron: "0 1 * * 1-5"
15+
16+
env:
17+
TEST_SIGNALING_URLS: ${{ secrets.TEST_SIGNALING_URLS }}
18+
TEST_CHANNEL_ID_PREFIX: ${{ secrets.TEST_CHANNEL_ID_PREFIX }}
19+
TEST_SECRET_KEY: ${{ secrets.TEST_SECRET_KEY }}
20+
TEST_API_URL: ${{ secrets.TEST_API_URL }}
21+
APPLE_VIDEO_TOOLBOX: true
22+
23+
jobs:
24+
e2e_test_apple_video_toolbox:
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
python_version:
29+
- "3.11"
30+
- "3.12"
31+
- "3.13"
32+
runs-on:
33+
group: Self
34+
labels: [self-hosted, self-hosted, macOS, ARM64, M2Pro]
35+
timeout-minutes: 15
36+
if: >-
37+
${{
38+
contains(github.event.head_commit.message, '[e2e]') ||
39+
contains(github.ref, 'feature/e2e-test') ||
40+
github.event_name == 'workflow_dispatch' ||
41+
github.event_name == 'push' ||
42+
github.event_name == 'schedule'
43+
}}
44+
steps:
45+
- uses: actions/checkout@v4
46+
- uses: astral-sh/setup-uv@v5
47+
with:
48+
enable-cache: false
49+
- run: uv python pin ${{ matrix.python_version }}
50+
- run: uv sync
51+
- run: uv run python run.py macos_arm64
52+
- run: uv run pytest tests/test_apple_video_toolbox.py -v
53+
54+
# slack_notify_succeeded:
55+
# needs: [e2e_test_ubuntu, e2e_test_macos, e2e_test_windows]
56+
# runs-on: ubuntu-24.04
57+
# if: success()
58+
# steps:
59+
# - name: Slack Notification
60+
# uses: rtCamp/action-slack-notify@v2
61+
# env:
62+
# SLACK_CHANNEL: sora-python-sdk
63+
# SLACK_COLOR: good
64+
# SLACK_TITLE: SUCCEEDED
65+
# SLACK_ICON_EMOJI: ":star-struck:"
66+
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
67+
68+
slack_notify_failed:
69+
needs: [e2e_test_apple_video_toolbox]
70+
runs-on: ubuntu-24.04
71+
if: failure()
72+
steps:
73+
- name: Slack Notification
74+
uses: rtCamp/action-slack-notify@v2
75+
env:
76+
SLACK_CHANNEL: sora-python-sdk
77+
SLACK_COLOR: danger
78+
SLACK_TITLE: "FAILED"
79+
SLACK_ICON_EMOJI: ":japanese_ogre:"
80+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

tests/test_apple_video_toolbox.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import sys
23
import time
34
import uuid
@@ -6,13 +7,10 @@
67
import pytest
78
from client import SoraClient, SoraRole
89

9-
"""
10-
GitHub Actions で Video Toolbox を送受信で利用しようとするとエラーになるので、
11-
テストを sendonly のみに絞っている
12-
"""
1310

14-
15-
@pytest.mark.skipif(sys.platform != "darwin", reason="macOS でのみ実行する")
11+
@pytest.mark.skipif(
12+
os.environ.get("APPLE_VIDEO_TOOLBOX") is None, reason="Apple Video Toolbox でのみ実行する"
13+
)
1614
@pytest.mark.parametrize(
1715
"video_codec_type",
1816
["H264", "H265"],
@@ -58,7 +56,9 @@ def test_macos_video_hwa_sendonly(setup, video_codec_type):
5856
assert outbound_rtp_stats["packetsSent"] > 0
5957

6058

61-
@pytest.mark.skipif(sys.platform != "darwin", reason="macOS でのみ実行する")
59+
@pytest.mark.skipif(
60+
os.environ.get("APPLE_VIDEO_TOOLBOX") is None, reason="Apple Video Toolbox でのみ実行する"
61+
)
6262
@pytest.mark.parametrize(
6363
(
6464
"video_codec_type",
@@ -187,7 +187,9 @@ def test_macos_simulcast(
187187
)
188188

189189

190-
@pytest.mark.skip(reason="ローカルでは成功する")
190+
@pytest.mark.skipif(
191+
os.environ.get("APPLE_VIDEO_TOOLBOX") is None, reason="Apple Video Toolbox でのみ実行する"
192+
)
191193
def test_macos_h264_sendonly_recvonly(setup):
192194
signaling_urls = setup.get("signaling_urls")
193195
channel_id_prefix = setup.get("channel_id_prefix")
@@ -245,7 +247,9 @@ def test_macos_h264_sendonly_recvonly(setup):
245247
assert inbound_rtp_stats["packetsReceived"] > 0
246248

247249

248-
@pytest.mark.skip(reason="ローカルでは成功する")
250+
@pytest.mark.skipif(
251+
os.environ.get("APPLE_VIDEO_TOOLBOX") is None, reason="Apple Video Toolbox でのみ実行する"
252+
)
249253
def test_macos_h265_sendonly_recvonly(setup):
250254
signaling_urls = setup.get("signaling_urls")
251255
channel_id_prefix = setup.get("channel_id_prefix")
@@ -301,7 +305,9 @@ def test_macos_h265_sendonly_recvonly(setup):
301305
assert inbound_rtp_stats["packetsReceived"] > 0
302306

303307

304-
@pytest.mark.skipif(sys.platform != "darwin", reason="macOS でのみ実行する")
308+
@pytest.mark.skipif(
309+
os.environ.get("APPLE_VIDEO_TOOLBOX") is None, reason="Apple Video Toolbox でのみ実行する"
310+
)
305311
@pytest.mark.parametrize(
306312
(
307313
"video_codec_type",

0 commit comments

Comments
 (0)