From 386872a86fd263d2aba35ae54cd4a7d8bf53a128 Mon Sep 17 00:00:00 2001 From: voluntas Date: Tue, 3 Sep 2024 20:25:09 +0900 Subject: [PATCH 01/45] =?UTF-8?q?pytest=20=E3=81=AE=E6=BA=96=E5=82=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +++ test/.python-version | 1 + test/pyproject.toml | 17 +++++++++++++++++ test/requirements-dev.lock | 19 +++++++++++++++++++ test/requirements.lock | 18 ++++++++++++++++++ 5 files changed, 58 insertions(+) create mode 100644 test/.python-version create mode 100644 test/pyproject.toml create mode 100644 test/requirements-dev.lock create mode 100644 test/requirements.lock diff --git a/.gitignore b/.gitignore index d9bb54c3..75e6dac2 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,6 @@ webrtc_logs_0 /_source /_install /_package + +# python +.venv diff --git a/test/.python-version b/test/.python-version new file mode 100644 index 00000000..871f80a3 --- /dev/null +++ b/test/.python-version @@ -0,0 +1 @@ +3.12.3 diff --git a/test/pyproject.toml b/test/pyproject.toml new file mode 100644 index 00000000..bbf5b8ba --- /dev/null +++ b/test/pyproject.toml @@ -0,0 +1,17 @@ +[project] +name = "momo-e2e-test" +version = "2013.3.8" +requires-python = ">= 3.12" +dependencies = ["pytest>=8.3.2"] + +[tool.rye] +virtual = true +managed = true +dev-dependencies = ["ruff>=0.6.3"] + +[tool.pytest.ini_options] +timeout = 45 + +[tool.ruff] +target-version = "py312" +line-length = 100 diff --git a/test/requirements-dev.lock b/test/requirements-dev.lock new file mode 100644 index 00000000..3c9ab33c --- /dev/null +++ b/test/requirements-dev.lock @@ -0,0 +1,19 @@ +# generated by rye +# use `rye lock` or `rye sync` to update this lockfile +# +# last locked with the following flags: +# pre: false +# features: [] +# all-features: false +# with-sources: false +# generate-hashes: false +# universal: false + +iniconfig==2.0.0 + # via pytest +packaging==24.1 + # via pytest +pluggy==1.5.0 + # via pytest +pytest==8.3.2 +ruff==0.6.3 diff --git a/test/requirements.lock b/test/requirements.lock new file mode 100644 index 00000000..dc9f4d01 --- /dev/null +++ b/test/requirements.lock @@ -0,0 +1,18 @@ +# generated by rye +# use `rye lock` or `rye sync` to update this lockfile +# +# last locked with the following flags: +# pre: false +# features: [] +# all-features: false +# with-sources: false +# generate-hashes: false +# universal: false + +iniconfig==2.0.0 + # via pytest +packaging==24.1 + # via pytest +pluggy==1.5.0 + # via pytest +pytest==8.3.2 From f13755492b8e446db43d6f6bead649f60bcb9729 Mon Sep 17 00:00:00 2001 From: voluntas Date: Tue, 3 Sep 2024 20:38:03 +0900 Subject: [PATCH 02/45] =?UTF-8?q?=E4=B8=80=E6=97=A6=E9=9B=91=E3=81=AB?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/momo.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 test/momo.py diff --git a/test/momo.py b/test/momo.py new file mode 100644 index 00000000..29cfe161 --- /dev/null +++ b/test/momo.py @@ -0,0 +1,31 @@ +import subprocess +import threading +import time +from pathlib import Path + +RELEASE_DIR = Path(__file__).resolve().parent.parent / Path("_build/") + + +class Momo: + def __init__(self): + pass + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + self.stop() + + def run_app(self, args): + self.process = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + self.process.wait() + self.is_running = False + + def start(self): + self.thread = threading.Thread(target=self.run_app, args=()) + self.thread.start() + self.is_running = True + time.sleep(1) # アプリケーションの起動を待つ + + def stop(self): + pass From 6feafbcd4410fe99402db7b719bee6694ea3275d Mon Sep 17 00:00:00 2001 From: voluntas Date: Tue, 3 Sep 2024 21:06:18 +0900 Subject: [PATCH 03/45] =?UTF-8?q?e2e=20test=20=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ただし、カメラデバイスが掴めずエラーになる可能性あり。 --- .github/workflows/e2e-test.yml | 31 ++++++++++++++++ .gitignore | 5 +++ test/momo.py | 66 +++++++++++++++++++++++++++++----- test/pyproject.toml | 5 ++- test/requirements-dev.lock | 2 ++ test/requirements.lock | 2 ++ test/test_momo.py | 12 +++++++ 7 files changed, 113 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/e2e-test.yml create mode 100644 test/test_momo.py diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml new file mode 100644 index 00000000..0c926737 --- /dev/null +++ b/.github/workflows/e2e-test.yml @@ -0,0 +1,31 @@ +name: e2e-test + +on: + push: + paths-ignore: + - "doc/**" + - "html/**" + - "**.md" + - "THANKS" + - "LICENSE" + - "NOTICE" + +jobs: + e2e-test-macos: + strategy: + fail-fast: false + matrix: + name: + - macos_arm64 + name: Build momo for ${{ matrix.name }} + runs-on: macos-14 + steps: + - uses: actions/checkout@v4 + - run: python3 run.py ${{ matrix.name }} + - uses: eifinger/setup-rye@v3 + with: + version: 'latest' + - run: rye sync + working-directory: ./test + - run: rye run pytest test/test_momo.py + working-directory: ./test \ No newline at end of file diff --git a/.gitignore b/.gitignore index 75e6dac2..6bf4759f 100644 --- a/.gitignore +++ b/.gitignore @@ -46,3 +46,8 @@ webrtc_logs_0 # python .venv +.pytest_cache +__pycache__ + +# vscode +build diff --git a/test/momo.py b/test/momo.py index 29cfe161..95de196d 100644 --- a/test/momo.py +++ b/test/momo.py @@ -1,14 +1,31 @@ +import platform +import signal import subprocess +import sys import threading import time from pathlib import Path +# プラットフォームに応じたリリースディレクトリの設定 RELEASE_DIR = Path(__file__).resolve().parent.parent / Path("_build/") +if platform.system() == "Darwin": + if platform.machine() == "arm64": + RELEASE_DIR = RELEASE_DIR / "macos_arm64/release/momo" +elif platform.system() == "Linux": + # ubuntu 24.04 かどうかの確認が必要 + # ubuntu 22.04 と 24.04 がある + RELEASE_DIR = RELEASE_DIR / "ubuntu-24.04_x86_64/release/momo" +else: + raise OSError(f"Unsupported platform: {platform.system()}") class Momo: - def __init__(self): - pass + def __init__(self, port=5000): + self.executable = RELEASE_DIR / "momo" + self.port = port + self.process = None + self.thread = None + self.is_running = False def __enter__(self): return self @@ -16,16 +33,47 @@ def __enter__(self): def __exit__(self, exc_type, exc_val, exc_tb): self.stop() - def run_app(self, args): - self.process = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - self.process.wait() - self.is_running = False + def run_app(self): + # test モードでポートだけ指定してあげる + args = [str(self.executable), "test", "--port", str(self.port)] + try: + self.process = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + self.process.wait() + except Exception as e: + print(f"Error running momo: {e}", file=sys.stderr) + finally: + self.is_running = False def start(self): - self.thread = threading.Thread(target=self.run_app, args=()) + if not self.executable.exists(): + raise FileNotFoundError(f"Momo executable not found: {self.executable}") + + self.thread = threading.Thread(target=self.run_app) self.thread.start() self.is_running = True - time.sleep(1) # アプリケーションの起動を待つ + + # momoの起動を確認 + start_time = time.time() + while time.time() - start_time < 10: # 10秒のタイムアウト + if self.process and self.process.poll() is None: + print(f"Momo started on port {self.port}") + return + time.sleep(0.1) + + raise TimeoutError("Momo failed to start within the timeout period") def stop(self): - pass + if self.is_running and self.process: + # SIGINT を送信 (Ctrl+C と同等) + self.process.send_signal(signal.SIGINT) + try: + # プロセスが終了するのを最大5秒間待つ + self.process.wait(timeout=5) + except subprocess.TimeoutExpired: + # タイムアウトした場合、強制終了 + print("Momo did not terminate gracefully. Forcing termination.", file=sys.stderr) + self.process.kill() + + self.thread.join() + self.is_running = False + print("Momo stopped") diff --git a/test/pyproject.toml b/test/pyproject.toml index bbf5b8ba..9234b572 100644 --- a/test/pyproject.toml +++ b/test/pyproject.toml @@ -2,7 +2,10 @@ name = "momo-e2e-test" version = "2013.3.8" requires-python = ">= 3.12" -dependencies = ["pytest>=8.3.2"] +dependencies = [ + "pytest>=8.3.2", + "pytest-timeout>=2.3.1", +] [tool.rye] virtual = true diff --git a/test/requirements-dev.lock b/test/requirements-dev.lock index 3c9ab33c..6e74b0c4 100644 --- a/test/requirements-dev.lock +++ b/test/requirements-dev.lock @@ -16,4 +16,6 @@ packaging==24.1 pluggy==1.5.0 # via pytest pytest==8.3.2 + # via pytest-timeout +pytest-timeout==2.3.1 ruff==0.6.3 diff --git a/test/requirements.lock b/test/requirements.lock index dc9f4d01..fcb9ce45 100644 --- a/test/requirements.lock +++ b/test/requirements.lock @@ -16,3 +16,5 @@ packaging==24.1 pluggy==1.5.0 # via pytest pytest==8.3.2 + # via pytest-timeout +pytest-timeout==2.3.1 diff --git a/test/test_momo.py b/test/test_momo.py new file mode 100644 index 00000000..5b7d6ac5 --- /dev/null +++ b/test/test_momo.py @@ -0,0 +1,12 @@ +import time + +from momo import Momo + + +def test_start_and_stop(): + with Momo() as momo: + momo.start() + + time.sleep(3) + + momo.stop() From b703b77ab5fbe64d8856808fd12741f770ac8102 Mon Sep 17 00:00:00 2001 From: voluntas Date: Tue, 3 Sep 2024 21:16:28 +0900 Subject: [PATCH 04/45] =?UTF-8?q?build-workflow=20=E3=82=92=E4=B8=80?= =?UTF-8?q?=E6=99=82=E7=9A=84=E3=81=AB=E7=84=A1=E5=8A=B9=E3=81=AB=E3=81=99?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e7929a71..d2f59237 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,14 +1,15 @@ name: build-workflow on: - push: - paths-ignore: - - "doc/**" - - "html/**" - - "**.md" - - "THANKS" - - "LICENSE" - - "NOTICE" + workflow_dispatch: + # push: + # paths-ignore: + # - "doc/**" + # - "html/**" + # - "**.md" + # - "THANKS" + # - "LICENSE" + # - "NOTICE" jobs: build-windows: From fc0afbed94865aca5ebf1b709721938e025a66f2 Mon Sep 17 00:00:00 2001 From: voluntas Date: Tue, 3 Sep 2024 21:16:44 +0900 Subject: [PATCH 05/45] =?UTF-8?q?test=5Fmomo.py=20=E3=81=AE=E3=83=91?= =?UTF-8?q?=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/e2e-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 0c926737..365a47c1 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -27,5 +27,5 @@ jobs: version: 'latest' - run: rye sync working-directory: ./test - - run: rye run pytest test/test_momo.py + - run: rye run pytest test_momo.py working-directory: ./test \ No newline at end of file From 76a16d77f2d270fefdd7f433c26b1e7d523c72e1 Mon Sep 17 00:00:00 2001 From: voluntas Date: Tue, 3 Sep 2024 21:43:29 +0900 Subject: [PATCH 06/45] =?UTF-8?q?=E3=81=8A=E3=81=9F=E3=82=81=E3=81=97=20v4?= =?UTF-8?q?l2loopback-dkms?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/e2e-test.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 365a47c1..5f1a7f79 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -21,6 +21,11 @@ jobs: runs-on: macos-14 steps: - uses: actions/checkout@v4 + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y v4l2loopback-dkms + sudo modprobe v4l2loopback devices=1 video_nr=0 exclusive_caps=1 card_label='VCamera' - run: python3 run.py ${{ matrix.name }} - uses: eifinger/setup-rye@v3 with: From 0f50d72d599127f1db8829581c0f02c98526b07d Mon Sep 17 00:00:00 2001 From: voluntas Date: Tue, 3 Sep 2024 21:45:31 +0900 Subject: [PATCH 07/45] apt --- .github/workflows/e2e-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 5f1a7f79..e692b004 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -23,8 +23,8 @@ jobs: - uses: actions/checkout@v4 - name: Install dependencies run: | - sudo apt-get update - sudo apt-get install -y v4l2loopback-dkms + sudo apt update + sudo apt install -y v4l2loopback-dkms sudo modprobe v4l2loopback devices=1 video_nr=0 exclusive_caps=1 card_label='VCamera' - run: python3 run.py ${{ matrix.name }} - uses: eifinger/setup-rye@v3 From 19441f674631faec6a660874ea7a67aa775cb6e7 Mon Sep 17 00:00:00 2001 From: voluntas Date: Tue, 3 Sep 2024 21:48:19 +0900 Subject: [PATCH 08/45] =?UTF-8?q?ubuntu=20=E3=81=A7=E3=81=AE=E3=81=8A?= =?UTF-8?q?=E8=A9=A6=E3=81=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/e2e-test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index e692b004..1e3c1e37 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -11,14 +11,14 @@ on: - "NOTICE" jobs: - e2e-test-macos: + e2e-test-ubuntu: strategy: fail-fast: false matrix: name: - macos_arm64 name: Build momo for ${{ matrix.name }} - runs-on: macos-14 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - name: Install dependencies @@ -26,7 +26,7 @@ jobs: sudo apt update sudo apt install -y v4l2loopback-dkms sudo modprobe v4l2loopback devices=1 video_nr=0 exclusive_caps=1 card_label='VCamera' - - run: python3 run.py ${{ matrix.name }} + - run: python3 run.py ubuntu-24.04_x86_64 - uses: eifinger/setup-rye@v3 with: version: 'latest' From f96e684d14814b96079a67d4a8a333bf25ee9490 Mon Sep 17 00:00:00 2001 From: voluntas Date: Tue, 3 Sep 2024 21:54:16 +0900 Subject: [PATCH 09/45] =?UTF-8?q?=E3=81=8A=E8=A9=A6=E3=81=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/e2e-test.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 1e3c1e37..b36b70b8 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -24,13 +24,14 @@ jobs: - name: Install dependencies run: | sudo apt update - sudo apt install -y v4l2loopback-dkms - sudo modprobe v4l2loopback devices=1 video_nr=0 exclusive_caps=1 card_label='VCamera' + sudo apt install -y ffmpeg v4l2loopback-dkms v4l2loopback-utils linux-modules-extra-$(uname -r) - run: python3 run.py ubuntu-24.04_x86_64 - uses: eifinger/setup-rye@v3 with: version: 'latest' - run: rye sync working-directory: ./test - - run: rye run pytest test_momo.py + - run: | + sudo modprobe v4l2loopback devices=1 video_nr=0 exclusive_caps=1 card_label='VCamera' + rye run pytest test_momo.py working-directory: ./test \ No newline at end of file From 752256c29668447d6c844431bb46c0428f4820ff Mon Sep 17 00:00:00 2001 From: voluntas Date: Tue, 3 Sep 2024 21:54:38 +0900 Subject: [PATCH 10/45] =?UTF-8?q?=E4=B8=80=E6=97=A6=E4=B8=8D=E8=A6=81?= =?UTF-8?q?=E3=81=AA=E3=82=B3=E3=83=BC=E3=83=89=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/e2e-test.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index b36b70b8..69482a5c 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -12,12 +12,6 @@ on: jobs: e2e-test-ubuntu: - strategy: - fail-fast: false - matrix: - name: - - macos_arm64 - name: Build momo for ${{ matrix.name }} runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 From 36290bc6dcc07d41f5eb86a880911701e9f62137 Mon Sep 17 00:00:00 2001 From: voluntas Date: Tue, 3 Sep 2024 22:01:55 +0900 Subject: [PATCH 11/45] =?UTF-8?q?=E3=83=93=E3=83=AB=E3=83=89=E6=BA=96?= =?UTF-8?q?=E5=82=99=E3=81=8C=E8=B6=B3=E3=82=8A=E3=81=A6=E3=81=AA=E3=81=8B?= =?UTF-8?q?=E3=81=A3=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/e2e-test.yml | 55 ++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 69482a5c..76c536cd 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -19,6 +19,61 @@ jobs: run: | sudo apt update sudo apt install -y ffmpeg v4l2loopback-dkms v4l2loopback-utils linux-modules-extra-$(uname -r) + - name: Disk cleanup + run: | + set -x + df -h + sudo du -h -d1 /usr/local + sudo du -h -d1 /usr/local/share + sudo du -h -d1 /usr/local/lib + sudo du -h -d1 /usr/share + RMI=`docker images -q -a` + if [ -n "$RMI" ]; then + docker rmi $RMI + fi + # 4.6G + sudo rm -rf /usr/local/.ghcup + # 1.7G + sudo rm -rf /usr/share/swift + # 1.4G + sudo rm -rf /usr/share/dotnet + df -h + # Ubuntu 24.04 だと libtinfo5 が見つからない問題があるので、その修正 + # ref: https://qiita.com/gengen16k/items/88cf3c18a40a94205fab + - name: Fix CUDA issues for Ubuntu 24.04 + run: | + sudo tee /etc/apt/sources.list.d/jammy.list << EOF + deb http://archive.ubuntu.com/ubuntu/ jammy universe + EOF + + sudo tee /etc/apt/preferences.d/pin-jammy < Date: Tue, 3 Sep 2024 22:26:50 +0900 Subject: [PATCH 12/45] =?UTF-8?q?=E3=81=8A=E8=A9=A6=E3=81=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/e2e-test.yml | 63 ++++------------------------------ test/momo.py | 11 ++++-- 2 files changed, 15 insertions(+), 59 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 76c536cd..89dca94c 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -15,66 +15,15 @@ jobs: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - - name: Install dependencies - run: | + - run: | sudo apt update sudo apt install -y ffmpeg v4l2loopback-dkms v4l2loopback-utils linux-modules-extra-$(uname -r) - - name: Disk cleanup - run: | - set -x - df -h - sudo du -h -d1 /usr/local - sudo du -h -d1 /usr/local/share - sudo du -h -d1 /usr/local/lib - sudo du -h -d1 /usr/share - RMI=`docker images -q -a` - if [ -n "$RMI" ]; then - docker rmi $RMI - fi - # 4.6G - sudo rm -rf /usr/local/.ghcup - # 1.7G - sudo rm -rf /usr/share/swift - # 1.4G - sudo rm -rf /usr/share/dotnet - df -h - # Ubuntu 24.04 だと libtinfo5 が見つからない問題があるので、その修正 - # ref: https://qiita.com/gengen16k/items/88cf3c18a40a94205fab - - name: Fix CUDA issues for Ubuntu 24.04 - run: | - sudo tee /etc/apt/sources.list.d/jammy.list << EOF - deb http://archive.ubuntu.com/ubuntu/ jammy universe - EOF - - sudo tee /etc/apt/preferences.d/pin-jammy < Date: Tue, 3 Sep 2024 22:37:40 +0900 Subject: [PATCH 13/45] =?UTF-8?q?=E3=81=93=E3=82=8C=E3=81=A7=E3=81=A9?= =?UTF-8?q?=E3=81=86=E3=81=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/e2e-test.yml | 4 ++-- test/momo.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 89dca94c..78fd7dab 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -23,7 +23,7 @@ jobs: tar -xzf momo-2023.1.0_ubuntu-22.04_x86_64.tar.gz mkdir -p _build/ubuntu-22.04_x86_64/release chmod 755 momo-2023.1.0_ubuntu-22.04_x86_64/momo - mv momo-2023.1.0_ubuntu-22.04_x86_64/momo _build/ubuntu-22.04_x86_64/release/ + mv momo-2023.1.0_ubuntu-22.04_x86_64/momo ${{ github.workspace }}/_build/ubuntu-22.04_x86_64/release/ - uses: eifinger/setup-rye@v3 with: version: 'latest' @@ -31,5 +31,5 @@ jobs: working-directory: ./test - run: | sudo modprobe v4l2loopback devices=1 video_nr=0 exclusive_caps=1 card_label='VCamera' - rye run pytest test_momo.py + rye run pytest test_momo.py -s working-directory: ./test \ No newline at end of file diff --git a/test/momo.py b/test/momo.py index 8c1f8388..671f4cd5 100644 --- a/test/momo.py +++ b/test/momo.py @@ -8,6 +8,7 @@ # プラットフォームに応じたリリースディレクトリの設定 RELEASE_DIR = Path(__file__).resolve().parent.parent / Path("_build/") + if platform.system() == "Darwin": if platform.machine() == "arm64": RELEASE_DIR = RELEASE_DIR / "macos_arm64/release/momo" @@ -52,6 +53,7 @@ def run_app(self): self.is_running = False def start(self): + print(Path(__file__).resolve().parent.parent / Path("_build/")) if not self.executable.exists(): raise FileNotFoundError(f"Momo executable not found: {self.executable}") From f0892e6366f34325cb395cb36950c5702a6c7688 Mon Sep 17 00:00:00 2001 From: voluntas Date: Tue, 3 Sep 2024 22:39:06 +0900 Subject: [PATCH 14/45] =?UTF-8?q?=E3=83=87=E3=83=90=E3=83=83=E3=82=B0?= =?UTF-8?q?=E3=83=AD=E3=82=B0=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/momo.py | 1 - 1 file changed, 1 deletion(-) diff --git a/test/momo.py b/test/momo.py index 671f4cd5..99e94115 100644 --- a/test/momo.py +++ b/test/momo.py @@ -53,7 +53,6 @@ def run_app(self): self.is_running = False def start(self): - print(Path(__file__).resolve().parent.parent / Path("_build/")) if not self.executable.exists(): raise FileNotFoundError(f"Momo executable not found: {self.executable}") From 4efa01b2b5e339a4e44add194dd21fc0bd3e1936 Mon Sep 17 00:00:00 2001 From: voluntas Date: Tue, 3 Sep 2024 22:39:19 +0900 Subject: [PATCH 15/45] ubuntu 22.04 --- .github/workflows/e2e-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 78fd7dab..265be67f 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -12,7 +12,7 @@ on: jobs: e2e-test-ubuntu: - runs-on: ubuntu-24.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - run: | From 501c4e5df6ed7aef6b57b46904502233ec2fa166 Mon Sep 17 00:00:00 2001 From: voluntas Date: Tue, 3 Sep 2024 22:40:04 +0900 Subject: [PATCH 16/45] momo --- .github/workflows/e2e-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 265be67f..e5914733 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -21,9 +21,9 @@ jobs: - run: | curl -LO https://github.com/shiguredo/momo/releases/download/2023.1.0/momo-2023.1.0_ubuntu-22.04_x86_64.tar.gz tar -xzf momo-2023.1.0_ubuntu-22.04_x86_64.tar.gz - mkdir -p _build/ubuntu-22.04_x86_64/release + mkdir -p _build/ubuntu-22.04_x86_64/release/momo chmod 755 momo-2023.1.0_ubuntu-22.04_x86_64/momo - mv momo-2023.1.0_ubuntu-22.04_x86_64/momo ${{ github.workspace }}/_build/ubuntu-22.04_x86_64/release/ + mv momo-2023.1.0_ubuntu-22.04_x86_64/momo ${{ github.workspace }}/_build/ubuntu-22.04_x86_64/release/momo/ - uses: eifinger/setup-rye@v3 with: version: 'latest' From 625603981d4d761d0a9abe0a38b4266c01adccb4 Mon Sep 17 00:00:00 2001 From: voluntas Date: Tue, 3 Sep 2024 22:45:35 +0900 Subject: [PATCH 17/45] =?UTF-8?q?no-audio-device=20=E3=81=8C=E9=87=8D?= =?UTF-8?q?=E8=A4=87=E3=81=97=E3=81=A6=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/momo.py | 1 - 1 file changed, 1 deletion(-) diff --git a/test/momo.py b/test/momo.py index 99e94115..797f5000 100644 --- a/test/momo.py +++ b/test/momo.py @@ -39,7 +39,6 @@ def run_app(self): args = [ str(self.executable), "--no-audio-device", - "--no-audio-device", "test", "--port", str(self.port), From d3650998dde9cc7ec85ed8d7fec5eee13f43f6a2 Mon Sep 17 00:00:00 2001 From: voluntas Date: Tue, 3 Sep 2024 22:54:44 +0900 Subject: [PATCH 18/45] =?UTF-8?q?=E7=92=B0=E5=A2=83=E5=A4=89=E6=95=B0?= =?UTF-8?q?=E5=8C=96=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/e2e-test.yml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index e5914733..63d49a97 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -12,18 +12,27 @@ on: jobs: e2e-test-ubuntu: - runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + os: + - ubuntu-22.04 + # - ubuntu-24.04 + env: + MOMO_VERSION: "2023.1.0" + MOMO_ARCH: "x86_64" + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - run: | sudo apt update sudo apt install -y ffmpeg v4l2loopback-dkms v4l2loopback-utils linux-modules-extra-$(uname -r) - run: | - curl -LO https://github.com/shiguredo/momo/releases/download/2023.1.0/momo-2023.1.0_ubuntu-22.04_x86_64.tar.gz - tar -xzf momo-2023.1.0_ubuntu-22.04_x86_64.tar.gz - mkdir -p _build/ubuntu-22.04_x86_64/release/momo - chmod 755 momo-2023.1.0_ubuntu-22.04_x86_64/momo - mv momo-2023.1.0_ubuntu-22.04_x86_64/momo ${{ github.workspace }}/_build/ubuntu-22.04_x86_64/release/momo/ + curl -LO https://github.com/shiguredo/momo/releases/download/${{ env.MOMO_VERSION}}/momo-${{ env.MOMO_VERSION }}_${{ matrix.os }}_${{ env.MOMO_ARCH }}.tar.gz + tar -xzf momo-${{ env.MOMO_VERSION }}_${{ matrix.os }}_${{ env.MOMO_ARCH }}.tar.gz + mkdir -p _build/${{ matrix.os }}_${{ env.MOMO_ARCH }}/release/momo + chmod 755 momo-${{ env.MOMO_VERSION }}_${{ matrix.os }}_${{ env.MOMO_ARCH }}/momo + mv momo-${{ env.MOMO_VERSION }}_${{ matrix.os }}_${{ env.MOMO_ARCH }}/momo ${{ github.workspace }}/_build/${{ matrix.os }}_${{ env.MOMO_ARCH }}/release/momo/ - uses: eifinger/setup-rye@v3 with: version: 'latest' From 118476c7f394487eb8e865d67a5090d8c40b7935 Mon Sep 17 00:00:00 2001 From: voluntas Date: Tue, 3 Sep 2024 22:59:17 +0900 Subject: [PATCH 19/45] =?UTF-8?q?=E3=83=81=E3=83=A3=E3=83=AC=E3=83=B3?= =?UTF-8?q?=E3=82=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/momo.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/momo.py b/test/momo.py index 797f5000..44d2fc23 100644 --- a/test/momo.py +++ b/test/momo.py @@ -9,6 +9,7 @@ # プラットフォームに応じたリリースディレクトリの設定 RELEASE_DIR = Path(__file__).resolve().parent.parent / Path("_build/") +# TODO: 環境変数で CI か Local で見に行くパスを変えるようにする if platform.system() == "Darwin": if platform.machine() == "arm64": RELEASE_DIR = RELEASE_DIR / "macos_arm64/release/momo" @@ -21,8 +22,9 @@ class Momo: - def __init__(self, port=5000): + def __init__(self, mode="test", port=5000): self.executable = RELEASE_DIR / "momo" + self.mode = mode self.port = port self.process = None self.thread = None @@ -35,11 +37,11 @@ def __exit__(self, exc_type, exc_val, exc_tb): self.stop() def run_app(self): - # test モードでポートだけ指定してあげる args = [ str(self.executable), "--no-audio-device", - "test", + "--no-video-device", + self.mode, "--port", str(self.port), ] From fc09a83a23671af8c80026d043ca80b5eaccde9d Mon Sep 17 00:00:00 2001 From: voluntas Date: Tue, 3 Sep 2024 23:01:23 +0900 Subject: [PATCH 20/45] =?UTF-8?q?no-video-device=20=E3=82=92=E5=89=8A?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/momo.py | 1 - 1 file changed, 1 deletion(-) diff --git a/test/momo.py b/test/momo.py index 44d2fc23..129b3de3 100644 --- a/test/momo.py +++ b/test/momo.py @@ -40,7 +40,6 @@ def run_app(self): args = [ str(self.executable), "--no-audio-device", - "--no-video-device", self.mode, "--port", str(self.port), From cfbf2a3408a5b8cd217c274ef680097aaf37cbbb Mon Sep 17 00:00:00 2001 From: voluntas Date: Tue, 3 Sep 2024 23:02:05 +0900 Subject: [PATCH 21/45] =?UTF-8?q?/dev/video0=20=E3=81=8C=E3=81=82=E3=82=8B?= =?UTF-8?q?=E3=81=AF=E3=81=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/momo.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/momo.py b/test/momo.py index 129b3de3..5bb32751 100644 --- a/test/momo.py +++ b/test/momo.py @@ -40,6 +40,7 @@ def run_app(self): args = [ str(self.executable), "--no-audio-device", + "--video-device /dev/video0", self.mode, "--port", str(self.port), From 2b1a34141a6fad9e1bb96f60f4b81141f342bf1e Mon Sep 17 00:00:00 2001 From: voluntas Date: Tue, 3 Sep 2024 23:06:46 +0900 Subject: [PATCH 22/45] =?UTF-8?q?=E7=A2=BA=E8=AA=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/e2e-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 63d49a97..43bda4d9 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -40,5 +40,6 @@ jobs: working-directory: ./test - run: | sudo modprobe v4l2loopback devices=1 video_nr=0 exclusive_caps=1 card_label='VCamera' + ls -l /dev/video0 rye run pytest test_momo.py -s working-directory: ./test \ No newline at end of file From b90580699cfa1f4f5ffbfd434ae517d00e37174a Mon Sep 17 00:00:00 2001 From: voluntas Date: Tue, 3 Sep 2024 23:15:31 +0900 Subject: [PATCH 23/45] =?UTF-8?q?=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/e2e-test.yml | 1 + test/momo.py | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 43bda4d9..e5fbc115 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -41,5 +41,6 @@ jobs: - run: | sudo modprobe v4l2loopback devices=1 video_nr=0 exclusive_caps=1 card_label='VCamera' ls -l /dev/video0 + - run: | rye run pytest test_momo.py -s working-directory: ./test \ No newline at end of file diff --git a/test/momo.py b/test/momo.py index 5bb32751..25c5a292 100644 --- a/test/momo.py +++ b/test/momo.py @@ -39,8 +39,6 @@ def __exit__(self, exc_type, exc_val, exc_tb): def run_app(self): args = [ str(self.executable), - "--no-audio-device", - "--video-device /dev/video0", self.mode, "--port", str(self.port), From 6d1e548d7a43e79dd847ad9a1cfb64c0884d7c4e Mon Sep 17 00:00:00 2001 From: voluntas Date: Mon, 16 Sep 2024 17:03:31 +0900 Subject: [PATCH 24/45] =?UTF-8?q?uv=20=E3=81=AB=E5=A4=89=E6=9B=B4=E3=81=99?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/e2e-test.yml | 11 +++-- test/requirements-dev.lock | 21 --------- test/requirements.lock | 20 --------- test/uv.lock | 80 ++++++++++++++++++++++++++++++++++ 4 files changed, 85 insertions(+), 47 deletions(-) delete mode 100644 test/requirements-dev.lock delete mode 100644 test/requirements.lock create mode 100644 test/uv.lock diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index e5fbc115..fe10a2d4 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -33,14 +33,13 @@ jobs: mkdir -p _build/${{ matrix.os }}_${{ env.MOMO_ARCH }}/release/momo chmod 755 momo-${{ env.MOMO_VERSION }}_${{ matrix.os }}_${{ env.MOMO_ARCH }}/momo mv momo-${{ env.MOMO_VERSION }}_${{ matrix.os }}_${{ env.MOMO_ARCH }}/momo ${{ github.workspace }}/_build/${{ matrix.os }}_${{ env.MOMO_ARCH }}/release/momo/ - - uses: eifinger/setup-rye@v3 - with: - version: 'latest' - - run: rye sync + - uses: astral-sh/setup-uv@v2 + - run: uv sync working-directory: ./test - - run: | + - name: setup v4l2loopback + run: | sudo modprobe v4l2loopback devices=1 video_nr=0 exclusive_caps=1 card_label='VCamera' ls -l /dev/video0 - run: | - rye run pytest test_momo.py -s + uv run pytest test_momo.py -s working-directory: ./test \ No newline at end of file diff --git a/test/requirements-dev.lock b/test/requirements-dev.lock deleted file mode 100644 index 6e74b0c4..00000000 --- a/test/requirements-dev.lock +++ /dev/null @@ -1,21 +0,0 @@ -# generated by rye -# use `rye lock` or `rye sync` to update this lockfile -# -# last locked with the following flags: -# pre: false -# features: [] -# all-features: false -# with-sources: false -# generate-hashes: false -# universal: false - -iniconfig==2.0.0 - # via pytest -packaging==24.1 - # via pytest -pluggy==1.5.0 - # via pytest -pytest==8.3.2 - # via pytest-timeout -pytest-timeout==2.3.1 -ruff==0.6.3 diff --git a/test/requirements.lock b/test/requirements.lock deleted file mode 100644 index fcb9ce45..00000000 --- a/test/requirements.lock +++ /dev/null @@ -1,20 +0,0 @@ -# generated by rye -# use `rye lock` or `rye sync` to update this lockfile -# -# last locked with the following flags: -# pre: false -# features: [] -# all-features: false -# with-sources: false -# generate-hashes: false -# universal: false - -iniconfig==2.0.0 - # via pytest -packaging==24.1 - # via pytest -pluggy==1.5.0 - # via pytest -pytest==8.3.2 - # via pytest-timeout -pytest-timeout==2.3.1 diff --git a/test/uv.lock b/test/uv.lock new file mode 100644 index 00000000..ec09c17b --- /dev/null +++ b/test/uv.lock @@ -0,0 +1,80 @@ +version = 1 +requires-python = ">=3.12" + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335 }, +] + +[[package]] +name = "iniconfig" +version = "2.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d7/4b/cbd8e699e64a6f16ca3a8220661b5f83792b3017d0f79807cb8708d33913/iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3", size = 4646 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374", size = 5892 }, +] + +[[package]] +name = "momo-e2e-test" +version = "2013.3.8" +source = { virtual = "." } +dependencies = [ + { name = "pytest" }, + { name = "pytest-timeout" }, +] + +[package.metadata] +requires-dist = [ + { name = "pytest", specifier = ">=8.3.2" }, + { name = "pytest-timeout", specifier = ">=2.3.1" }, +] + +[[package]] +name = "packaging" +version = "24.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/51/65/50db4dda066951078f0a96cf12f4b9ada6e4b811516bf0262c0f4f7064d4/packaging-24.1.tar.gz", hash = "sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002", size = 148788 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/08/aa/cc0199a5f0ad350994d660967a8efb233fe0416e4639146c089643407ce6/packaging-24.1-py3-none-any.whl", hash = "sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124", size = 53985 }, +] + +[[package]] +name = "pluggy" +version = "1.5.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/96/2d/02d4312c973c6050a18b314a5ad0b3210edb65a906f868e31c111dede4a6/pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1", size = 67955 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/5f/e351af9a41f866ac3f1fac4ca0613908d9a41741cfcf2228f4ad853b697d/pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669", size = 20556 }, +] + +[[package]] +name = "pytest" +version = "8.3.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/8b/6c/62bbd536103af674e227c41a8f3dcd022d591f6eed5facb5a0f31ee33bbc/pytest-8.3.3.tar.gz", hash = "sha256:70b98107bd648308a7952b06e6ca9a50bc660be218d53c257cc1fc94fda10181", size = 1442487 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/6b/77/7440a06a8ead44c7757a64362dd22df5760f9b12dc5f11b6188cd2fc27a0/pytest-8.3.3-py3-none-any.whl", hash = "sha256:a6853c7375b2663155079443d2e45de913a911a11d669df02a50814944db57b2", size = 342341 }, +] + +[[package]] +name = "pytest-timeout" +version = "2.3.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pytest" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/93/0d/04719abc7a4bdb3a7a1f968f24b0f5253d698c9cc94975330e9d3145befb/pytest-timeout-2.3.1.tar.gz", hash = "sha256:12397729125c6ecbdaca01035b9e5239d4db97352320af155b3f5de1ba5165d9", size = 17697 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/03/27/14af9ef8321f5edc7527e47def2a21d8118c6f329a9342cc61387a0c0599/pytest_timeout-2.3.1-py3-none-any.whl", hash = "sha256:68188cb703edfc6a18fad98dc25a3c61e9f24d644b0b70f33af545219fc7813e", size = 14148 }, +] From 4a0200fe4421a5f27424d629dee2baa71b454f68 Mon Sep 17 00:00:00 2001 From: voluntas Date: Mon, 16 Sep 2024 17:04:19 +0900 Subject: [PATCH 25/45] =?UTF-8?q?=E5=A4=89=E6=9B=B4=E5=B1=A5=E6=AD=B4?= =?UTF-8?q?=E3=82=92=E6=9B=B4=E6=96=B0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index c4931f6a..01d7c8b7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -87,6 +87,9 @@ ### misc +- [ADD] pytest を利用した E2E テストを追加 + + - @voluntas - [UPDATE] Github Actions の actions/download-artifact をアップデート - Node.js 16 の Deprecated に伴うアップデート - actions/download-artifact@v3 から actions/download-artifact@v4 にアップデート From 1179788744128710c85ec8ad437bac2fe28591e8 Mon Sep 17 00:00:00 2001 From: voluntas Date: Mon, 16 Sep 2024 17:08:13 +0900 Subject: [PATCH 26/45] [e2e] uv sync --- test/pyproject.toml | 11 ++++------- test/uv.lock | 37 +++++++++++++++++++++++++++++++++++-- 2 files changed, 39 insertions(+), 9 deletions(-) diff --git a/test/pyproject.toml b/test/pyproject.toml index 9234b572..49344935 100644 --- a/test/pyproject.toml +++ b/test/pyproject.toml @@ -2,15 +2,12 @@ name = "momo-e2e-test" version = "2013.3.8" requires-python = ">= 3.12" -dependencies = [ - "pytest>=8.3.2", - "pytest-timeout>=2.3.1", -] +dependencies = ["pytest>=8.3", "pytest-timeout>=2.3"] -[tool.rye] -virtual = true +[tool.uv] +package = false managed = true -dev-dependencies = ["ruff>=0.6.3"] +dev-dependencies = ["ruff>=0.6"] [tool.pytest.ini_options] timeout = 45 diff --git a/test/uv.lock b/test/uv.lock index ec09c17b..57a874a9 100644 --- a/test/uv.lock +++ b/test/uv.lock @@ -28,12 +28,20 @@ dependencies = [ { name = "pytest-timeout" }, ] +[package.dev-dependencies] +dev = [ + { name = "ruff" }, +] + [package.metadata] requires-dist = [ - { name = "pytest", specifier = ">=8.3.2" }, - { name = "pytest-timeout", specifier = ">=2.3.1" }, + { name = "pytest", specifier = ">=8.3" }, + { name = "pytest-timeout", specifier = ">=2.3" }, ] +[package.metadata.requires-dev] +dev = [{ name = "ruff", specifier = ">=0.6" }] + [[package]] name = "packaging" version = "24.1" @@ -78,3 +86,28 @@ sdist = { url = "https://files.pythonhosted.org/packages/93/0d/04719abc7a4bdb3a7 wheels = [ { url = "https://files.pythonhosted.org/packages/03/27/14af9ef8321f5edc7527e47def2a21d8118c6f329a9342cc61387a0c0599/pytest_timeout-2.3.1-py3-none-any.whl", hash = "sha256:68188cb703edfc6a18fad98dc25a3c61e9f24d644b0b70f33af545219fc7813e", size = 14148 }, ] + +[[package]] +name = "ruff" +version = "0.6.5" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/96/3f/29b2d3d90f811f6fb5b90242309f4668cd8c2482aab86ffc23099000545b/ruff-0.6.5.tar.gz", hash = "sha256:4d32d87fab433c0cf285c3683dd4dae63be05fd7a1d65b3f5bf7cdd05a6b96fb", size = 2476127 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/64/05/cc62df44b5a0271b29f11d687aa89e85943e0d26e5bb773dbc1456d9885d/ruff-0.6.5-py3-none-linux_armv6l.whl", hash = "sha256:7e4e308f16e07c95fc7753fc1aaac690a323b2bb9f4ec5e844a97bb7fbebd748", size = 9770988 }, + { url = "https://files.pythonhosted.org/packages/09/3d/89dac56ab7053d5b7cba723c9cae1a29b7a2978174c67e2441525ee00343/ruff-0.6.5-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:932cd69eefe4daf8c7d92bd6689f7e8182571cb934ea720af218929da7bd7d69", size = 9423303 }, + { url = "https://files.pythonhosted.org/packages/70/76/dc04654d26beace866a3c9e0c87112304e3d6406e1ee8ca0d9bebbd82d91/ruff-0.6.5-py3-none-macosx_11_0_arm64.whl", hash = "sha256:3a8d42d11fff8d3143ff4da41742a98f8f233bf8890e9fe23077826818f8d680", size = 9134078 }, + { url = "https://files.pythonhosted.org/packages/da/52/6a492cffcd2c6e243043937ab52811b6ebb10cb5b77a68cc98e7676ceaef/ruff-0.6.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a50af6e828ee692fb10ff2dfe53f05caecf077f4210fae9677e06a808275754f", size = 10105094 }, + { url = "https://files.pythonhosted.org/packages/59/7c/fd76a583ae59a276537d71921d616a83ec7774027d0812049afb6af8a07f/ruff-0.6.5-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:794ada3400a0d0b89e3015f1a7e01f4c97320ac665b7bc3ade24b50b54cb2972", size = 9542751 }, + { url = "https://files.pythonhosted.org/packages/56/5b/4e8928fa11412b16ecf7d7755fe45db6dfa7abce32841f6aec33bae3a7da/ruff-0.6.5-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:381413ec47f71ce1d1c614f7779d88886f406f1fd53d289c77e4e533dc6ea200", size = 10358844 }, + { url = "https://files.pythonhosted.org/packages/bd/a8/315ea8f71b111c8fb2b681c88a3e7a707d74308eb1435dc6ee3e6637a286/ruff-0.6.5-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:52e75a82bbc9b42e63c08d22ad0ac525117e72aee9729a069d7c4f235fc4d276", size = 11075199 }, + { url = "https://files.pythonhosted.org/packages/d9/1c/3a3728d42db52bfe418d8c913b453531766be1383719573f2458e8b59990/ruff-0.6.5-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:09c72a833fd3551135ceddcba5ebdb68ff89225d30758027280968c9acdc7810", size = 10661186 }, + { url = "https://files.pythonhosted.org/packages/d4/0c/ae25e213461aab274822081923d747f02929d71843c42b8f56018a7ec636/ruff-0.6.5-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:800c50371bdcb99b3c1551d5691e14d16d6f07063a518770254227f7f6e8c178", size = 11747444 }, + { url = "https://files.pythonhosted.org/packages/c4/e3/9d0ff218c7663ab9d53abe02911bec03d32b8ced7f78c1c49c2af84903a2/ruff-0.6.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8e25ddd9cd63ba1f3bd51c1f09903904a6adf8429df34f17d728a8fa11174253", size = 10266302 }, + { url = "https://files.pythonhosted.org/packages/ac/03/f158cc24120bf277b0cd7906ba509a2db74531003663500a0d1781cd7448/ruff-0.6.5-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:7291e64d7129f24d1b0c947ec3ec4c0076e958d1475c61202497c6aced35dd19", size = 10104976 }, + { url = "https://files.pythonhosted.org/packages/91/d0/0bacdffc234e588ec05834186ad11ec8281a6ca598d0106892497bbcfa44/ruff-0.6.5-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:9ad7dfbd138d09d9a7e6931e6a7e797651ce29becd688be8a0d4d5f8177b4b0c", size = 9625374 }, + { url = "https://files.pythonhosted.org/packages/1a/ad/721003cde8abd9f50bff74acbcb21852531036451d48a1abddba4dd84025/ruff-0.6.5-py3-none-musllinux_1_2_i686.whl", hash = "sha256:005256d977021790cc52aa23d78f06bb5090dc0bfbd42de46d49c201533982ae", size = 9959661 }, + { url = "https://files.pythonhosted.org/packages/37/84/8d70a3eacaacb65b4bb1461fc1a59e37ff165152b7e507692109117c877f/ruff-0.6.5-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:482c1e6bfeb615eafc5899127b805d28e387bd87db38b2c0c41d271f5e58d8cc", size = 10327408 }, + { url = "https://files.pythonhosted.org/packages/54/7e/6b0a9ab30428a9e3d9607f6dd2e4fb743594d42bd1b6ba7b7b239acda921/ruff-0.6.5-py3-none-win32.whl", hash = "sha256:cf4d3fa53644137f6a4a27a2b397381d16454a1566ae5335855c187fbf67e4f5", size = 8012512 }, + { url = "https://files.pythonhosted.org/packages/d8/88/176f50162a219e3039f21e9e4323869fc62bf8d3afb4147a390d6c744bd8/ruff-0.6.5-py3-none-win_amd64.whl", hash = "sha256:3e42a57b58e3612051a636bc1ac4e6b838679530235520e8f095f7c44f706ff9", size = 8804438 }, + { url = "https://files.pythonhosted.org/packages/67/a0/1b488bbe35a7ff8296fdea1ec1a9c2676cecc7e42bda63860f9397d59140/ruff-0.6.5-py3-none-win_arm64.whl", hash = "sha256:51935067740773afdf97493ba9b8231279e9beef0f2a8079188c4776c25688e0", size = 8179780 }, +] From d872ce849e0c83520a579415d1b93cbfa131c6c3 Mon Sep 17 00:00:00 2001 From: voluntas Date: Mon, 16 Sep 2024 17:09:52 +0900 Subject: [PATCH 27/45] =?UTF-8?q?=E7=A7=BB=E5=8B=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/e2e-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index fe10a2d4..fde14e70 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -34,12 +34,12 @@ jobs: chmod 755 momo-${{ env.MOMO_VERSION }}_${{ matrix.os }}_${{ env.MOMO_ARCH }}/momo mv momo-${{ env.MOMO_VERSION }}_${{ matrix.os }}_${{ env.MOMO_ARCH }}/momo ${{ github.workspace }}/_build/${{ matrix.os }}_${{ env.MOMO_ARCH }}/release/momo/ - uses: astral-sh/setup-uv@v2 - - run: uv sync - working-directory: ./test - name: setup v4l2loopback run: | sudo modprobe v4l2loopback devices=1 video_nr=0 exclusive_caps=1 card_label='VCamera' ls -l /dev/video0 + - run: uv sync + working-directory: ./test - run: | uv run pytest test_momo.py -s working-directory: ./test \ No newline at end of file From 32f3a6a14dc5c2d06e41901df473e72ce1a2b2ca Mon Sep 17 00:00:00 2001 From: voluntas Date: Mon, 16 Sep 2024 17:29:50 +0900 Subject: [PATCH 28/45] =?UTF-8?q?[e2e]=20Momo=20=E3=81=AE=E3=83=90?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E3=82=92=E4=B8=8A=E3=81=92?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/e2e-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index fde14e70..45efa5f1 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -19,7 +19,7 @@ jobs: - ubuntu-22.04 # - ubuntu-24.04 env: - MOMO_VERSION: "2023.1.0" + MOMO_VERSION: "2024.1.0-canary.0" MOMO_ARCH: "x86_64" runs-on: ${{ matrix.os }} steps: From d2484b03ef806221a20e79ff6103b978ae8f3097 Mon Sep 17 00:00:00 2001 From: voluntas Date: Mon, 16 Sep 2024 17:34:59 +0900 Subject: [PATCH 29/45] =?UTF-8?q?momo/momo=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 --- .github/workflows/e2e-test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 45efa5f1..73b6c94d 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -31,7 +31,8 @@ jobs: curl -LO https://github.com/shiguredo/momo/releases/download/${{ env.MOMO_VERSION}}/momo-${{ env.MOMO_VERSION }}_${{ matrix.os }}_${{ env.MOMO_ARCH }}.tar.gz tar -xzf momo-${{ env.MOMO_VERSION }}_${{ matrix.os }}_${{ env.MOMO_ARCH }}.tar.gz mkdir -p _build/${{ matrix.os }}_${{ env.MOMO_ARCH }}/release/momo - chmod 755 momo-${{ env.MOMO_VERSION }}_${{ matrix.os }}_${{ env.MOMO_ARCH }}/momo + # chmod 755 momo-${{ env.MOMO_VERSION }}_${{ matrix.os }}_${{ env.MOMO_ARCH }}/momo + chmod 755 momo/momo mv momo-${{ env.MOMO_VERSION }}_${{ matrix.os }}_${{ env.MOMO_ARCH }}/momo ${{ github.workspace }}/_build/${{ matrix.os }}_${{ env.MOMO_ARCH }}/release/momo/ - uses: astral-sh/setup-uv@v2 - name: setup v4l2loopback From f00544b649ad9a9989fc0ad1ac25379259ab0fd4 Mon Sep 17 00:00:00 2001 From: voluntas Date: Mon, 16 Sep 2024 17:43:40 +0900 Subject: [PATCH 30/45] mv --- .github/workflows/e2e-test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 73b6c94d..d37dd964 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -33,7 +33,8 @@ jobs: mkdir -p _build/${{ matrix.os }}_${{ env.MOMO_ARCH }}/release/momo # chmod 755 momo-${{ env.MOMO_VERSION }}_${{ matrix.os }}_${{ env.MOMO_ARCH }}/momo chmod 755 momo/momo - mv momo-${{ env.MOMO_VERSION }}_${{ matrix.os }}_${{ env.MOMO_ARCH }}/momo ${{ github.workspace }}/_build/${{ matrix.os }}_${{ env.MOMO_ARCH }}/release/momo/ + # mv momo-${{ env.MOMO_VERSION }}_${{ matrix.os }}_${{ env.MOMO_ARCH }}/momo ${{ github.workspace }}/_build/${{ matrix.os }}_${{ env.MOMO_ARCH }}/release/momo/ + mv momo/momo ${{ github.workspace }}/_build/${{ matrix.os }}_${{ env.MOMO_ARCH }}/release/momo/ - uses: astral-sh/setup-uv@v2 - name: setup v4l2loopback run: | From 98bd6799d0a4e0d31c56735b8a2e79e873699181 Mon Sep 17 00:00:00 2001 From: voluntas Date: Mon, 16 Sep 2024 17:47:50 +0900 Subject: [PATCH 31/45] =?UTF-8?q?--video-device=20=E3=82=92=E6=98=8E?= =?UTF-8?q?=E7=A4=BA=E7=9A=84=E3=81=AB=E3=81=97=E3=81=A6=E3=81=84=E3=81=97?= =?UTF-8?q?=E3=81=A6=E3=81=BF=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/momo.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/momo.py b/test/momo.py index 25c5a292..a0c3464a 100644 --- a/test/momo.py +++ b/test/momo.py @@ -42,6 +42,9 @@ def run_app(self): self.mode, "--port", str(self.port), + "--video-device", + # これは GitHub Actions 用 + "VCamera", ] try: self.process = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) From e1ec3d4191229fc03eceada2e1c7ee1b7fde55ff Mon Sep 17 00:00:00 2001 From: voluntas Date: Mon, 16 Sep 2024 17:56:53 +0900 Subject: [PATCH 32/45] =?UTF-8?q?=E3=83=87=E3=83=90=E3=83=83=E3=82=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/momo.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/momo.py b/test/momo.py index a0c3464a..33c6739a 100644 --- a/test/momo.py +++ b/test/momo.py @@ -37,6 +37,7 @@ def __exit__(self, exc_type, exc_val, exc_tb): self.stop() def run_app(self): + print(self.executable) args = [ str(self.executable), self.mode, From f8960a2ff87582f4685bebcd0d19062f65e44de6 Mon Sep 17 00:00:00 2001 From: voluntas Date: Sun, 20 Oct 2024 22:44:55 +0900 Subject: [PATCH 33/45] setup-uv@3 --- .github/workflows/e2e-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index d37dd964..a7c3e53c 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -35,7 +35,7 @@ jobs: chmod 755 momo/momo # mv momo-${{ env.MOMO_VERSION }}_${{ matrix.os }}_${{ env.MOMO_ARCH }}/momo ${{ github.workspace }}/_build/${{ matrix.os }}_${{ env.MOMO_ARCH }}/release/momo/ mv momo/momo ${{ github.workspace }}/_build/${{ matrix.os }}_${{ env.MOMO_ARCH }}/release/momo/ - - uses: astral-sh/setup-uv@v2 + - uses: astral-sh/setup-uv@v3 - name: setup v4l2loopback run: | sudo modprobe v4l2loopback devices=1 video_nr=0 exclusive_caps=1 card_label='VCamera' From 4d0ba3982c22a5fccd7d729a788b868e61c9182b Mon Sep 17 00:00:00 2001 From: voluntas Date: Sun, 20 Oct 2024 22:46:43 +0900 Subject: [PATCH 34/45] =?UTF-8?q?build=20=E3=81=AF=E3=81=97=E3=81=AA?= =?UTF-8?q?=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 33dddb93..d2f59237 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,14 +2,14 @@ name: build-workflow on: workflow_dispatch: - push: - paths-ignore: - - "doc/**" - - "html/**" - - "**.md" - - "THANKS" - - "LICENSE" - - "NOTICE" + # push: + # paths-ignore: + # - "doc/**" + # - "html/**" + # - "**.md" + # - "THANKS" + # - "LICENSE" + # - "NOTICE" jobs: build-windows: From 9a973e196d3634ad40978dc72477396889e703c9 Mon Sep 17 00:00:00 2001 From: voluntas Date: Sun, 20 Oct 2024 22:48:44 +0900 Subject: [PATCH 35/45] 2024.1.0 --- .github/workflows/e2e-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index a7c3e53c..4823cb95 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -19,7 +19,7 @@ jobs: - ubuntu-22.04 # - ubuntu-24.04 env: - MOMO_VERSION: "2024.1.0-canary.0" + MOMO_VERSION: "2024.1.0" MOMO_ARCH: "x86_64" runs-on: ${{ matrix.os }} steps: From 8274e4e7b9a26e04ba0e94264803e6ffb4549450 Mon Sep 17 00:00:00 2001 From: voluntas Date: Sun, 20 Oct 2024 23:06:35 +0900 Subject: [PATCH 36/45] momo --version --- .github/workflows/e2e-test.yml | 1 + test/.python-version | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 4823cb95..e7d4a562 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -40,6 +40,7 @@ jobs: run: | sudo modprobe v4l2loopback devices=1 video_nr=0 exclusive_caps=1 card_label='VCamera' ls -l /dev/video0 + - run: /home/runner/work/momo/momo/_build/ubuntu-22.04_x86_64/release/momo/momo --version - run: uv sync working-directory: ./test - run: | diff --git a/test/.python-version b/test/.python-version index 871f80a3..24ee5b1b 100644 --- a/test/.python-version +++ b/test/.python-version @@ -1 +1 @@ -3.12.3 +3.13 From 3486a5ea1741d3546dd9fbb4e7b7dc4529e3ccc6 Mon Sep 17 00:00:00 2001 From: voluntas Date: Wed, 6 Nov 2024 21:21:09 +0900 Subject: [PATCH 37/45] uv sync --upgrade --- test/uv.lock | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/test/uv.lock b/test/uv.lock index 57a874a9..3319dd38 100644 --- a/test/uv.lock +++ b/test/uv.lock @@ -89,25 +89,25 @@ wheels = [ [[package]] name = "ruff" -version = "0.6.5" +version = "0.7.2" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/96/3f/29b2d3d90f811f6fb5b90242309f4668cd8c2482aab86ffc23099000545b/ruff-0.6.5.tar.gz", hash = "sha256:4d32d87fab433c0cf285c3683dd4dae63be05fd7a1d65b3f5bf7cdd05a6b96fb", size = 2476127 } +sdist = { url = "https://files.pythonhosted.org/packages/95/51/231bb3790e5b0b9fd4131f9a231d73d061b3667522e3f406fd9b63334d0e/ruff-0.7.2.tar.gz", hash = "sha256:2b14e77293380e475b4e3a7a368e14549288ed2931fce259a6f99978669e844f", size = 3210036 } wheels = [ - { url = "https://files.pythonhosted.org/packages/64/05/cc62df44b5a0271b29f11d687aa89e85943e0d26e5bb773dbc1456d9885d/ruff-0.6.5-py3-none-linux_armv6l.whl", hash = "sha256:7e4e308f16e07c95fc7753fc1aaac690a323b2bb9f4ec5e844a97bb7fbebd748", size = 9770988 }, - { url = "https://files.pythonhosted.org/packages/09/3d/89dac56ab7053d5b7cba723c9cae1a29b7a2978174c67e2441525ee00343/ruff-0.6.5-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:932cd69eefe4daf8c7d92bd6689f7e8182571cb934ea720af218929da7bd7d69", size = 9423303 }, - { url = "https://files.pythonhosted.org/packages/70/76/dc04654d26beace866a3c9e0c87112304e3d6406e1ee8ca0d9bebbd82d91/ruff-0.6.5-py3-none-macosx_11_0_arm64.whl", hash = "sha256:3a8d42d11fff8d3143ff4da41742a98f8f233bf8890e9fe23077826818f8d680", size = 9134078 }, - { url = "https://files.pythonhosted.org/packages/da/52/6a492cffcd2c6e243043937ab52811b6ebb10cb5b77a68cc98e7676ceaef/ruff-0.6.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a50af6e828ee692fb10ff2dfe53f05caecf077f4210fae9677e06a808275754f", size = 10105094 }, - { url = "https://files.pythonhosted.org/packages/59/7c/fd76a583ae59a276537d71921d616a83ec7774027d0812049afb6af8a07f/ruff-0.6.5-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:794ada3400a0d0b89e3015f1a7e01f4c97320ac665b7bc3ade24b50b54cb2972", size = 9542751 }, - { url = "https://files.pythonhosted.org/packages/56/5b/4e8928fa11412b16ecf7d7755fe45db6dfa7abce32841f6aec33bae3a7da/ruff-0.6.5-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:381413ec47f71ce1d1c614f7779d88886f406f1fd53d289c77e4e533dc6ea200", size = 10358844 }, - { url = "https://files.pythonhosted.org/packages/bd/a8/315ea8f71b111c8fb2b681c88a3e7a707d74308eb1435dc6ee3e6637a286/ruff-0.6.5-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:52e75a82bbc9b42e63c08d22ad0ac525117e72aee9729a069d7c4f235fc4d276", size = 11075199 }, - { url = "https://files.pythonhosted.org/packages/d9/1c/3a3728d42db52bfe418d8c913b453531766be1383719573f2458e8b59990/ruff-0.6.5-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:09c72a833fd3551135ceddcba5ebdb68ff89225d30758027280968c9acdc7810", size = 10661186 }, - { url = "https://files.pythonhosted.org/packages/d4/0c/ae25e213461aab274822081923d747f02929d71843c42b8f56018a7ec636/ruff-0.6.5-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:800c50371bdcb99b3c1551d5691e14d16d6f07063a518770254227f7f6e8c178", size = 11747444 }, - { url = "https://files.pythonhosted.org/packages/c4/e3/9d0ff218c7663ab9d53abe02911bec03d32b8ced7f78c1c49c2af84903a2/ruff-0.6.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8e25ddd9cd63ba1f3bd51c1f09903904a6adf8429df34f17d728a8fa11174253", size = 10266302 }, - { url = "https://files.pythonhosted.org/packages/ac/03/f158cc24120bf277b0cd7906ba509a2db74531003663500a0d1781cd7448/ruff-0.6.5-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:7291e64d7129f24d1b0c947ec3ec4c0076e958d1475c61202497c6aced35dd19", size = 10104976 }, - { url = "https://files.pythonhosted.org/packages/91/d0/0bacdffc234e588ec05834186ad11ec8281a6ca598d0106892497bbcfa44/ruff-0.6.5-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:9ad7dfbd138d09d9a7e6931e6a7e797651ce29becd688be8a0d4d5f8177b4b0c", size = 9625374 }, - { url = "https://files.pythonhosted.org/packages/1a/ad/721003cde8abd9f50bff74acbcb21852531036451d48a1abddba4dd84025/ruff-0.6.5-py3-none-musllinux_1_2_i686.whl", hash = "sha256:005256d977021790cc52aa23d78f06bb5090dc0bfbd42de46d49c201533982ae", size = 9959661 }, - { url = "https://files.pythonhosted.org/packages/37/84/8d70a3eacaacb65b4bb1461fc1a59e37ff165152b7e507692109117c877f/ruff-0.6.5-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:482c1e6bfeb615eafc5899127b805d28e387bd87db38b2c0c41d271f5e58d8cc", size = 10327408 }, - { url = "https://files.pythonhosted.org/packages/54/7e/6b0a9ab30428a9e3d9607f6dd2e4fb743594d42bd1b6ba7b7b239acda921/ruff-0.6.5-py3-none-win32.whl", hash = "sha256:cf4d3fa53644137f6a4a27a2b397381d16454a1566ae5335855c187fbf67e4f5", size = 8012512 }, - { url = "https://files.pythonhosted.org/packages/d8/88/176f50162a219e3039f21e9e4323869fc62bf8d3afb4147a390d6c744bd8/ruff-0.6.5-py3-none-win_amd64.whl", hash = "sha256:3e42a57b58e3612051a636bc1ac4e6b838679530235520e8f095f7c44f706ff9", size = 8804438 }, - { url = "https://files.pythonhosted.org/packages/67/a0/1b488bbe35a7ff8296fdea1ec1a9c2676cecc7e42bda63860f9397d59140/ruff-0.6.5-py3-none-win_arm64.whl", hash = "sha256:51935067740773afdf97493ba9b8231279e9beef0f2a8079188c4776c25688e0", size = 8179780 }, + { url = "https://files.pythonhosted.org/packages/5c/56/0caa2b5745d66a39aa239c01059f6918fc76ed8380033d2f44bf297d141d/ruff-0.7.2-py3-none-linux_armv6l.whl", hash = "sha256:b73f873b5f52092e63ed540adefc3c36f1f803790ecf2590e1df8bf0a9f72cb8", size = 10373973 }, + { url = "https://files.pythonhosted.org/packages/1a/33/cad6ff306731f335d481c50caa155b69a286d5b388e87ff234cd2a4b3557/ruff-0.7.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:5b813ef26db1015953daf476202585512afd6a6862a02cde63f3bafb53d0b2d4", size = 10171140 }, + { url = "https://files.pythonhosted.org/packages/97/f5/6a2ca5c9ba416226eac9cf8121a1baa6f06655431937e85f38ffcb9d0d01/ruff-0.7.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:853277dbd9675810c6826dad7a428d52a11760744508340e66bf46f8be9701d9", size = 9809333 }, + { url = "https://files.pythonhosted.org/packages/16/83/e3e87f13d1a1dc205713632978cd7bc287a59b08bc95780dbe359b9aefcb/ruff-0.7.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:21aae53ab1490a52bf4e3bf520c10ce120987b047c494cacf4edad0ba0888da2", size = 10622987 }, + { url = "https://files.pythonhosted.org/packages/22/16/97ccab194480e99a2e3c77ae132b3eebfa38c2112747570c403a4a13ba3a/ruff-0.7.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ccc7e0fc6e0cb3168443eeadb6445285abaae75142ee22b2b72c27d790ab60ba", size = 10184640 }, + { url = "https://files.pythonhosted.org/packages/97/1b/82ff05441b036f68817296c14f24da47c591cb27acfda473ee571a5651ac/ruff-0.7.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:fd77877a4e43b3a98e5ef4715ba3862105e299af0c48942cc6d51ba3d97dc859", size = 11210203 }, + { url = "https://files.pythonhosted.org/packages/a6/96/7ecb30a7ef7f942e2d8e0287ad4c1957dddc6c5097af4978c27cfc334f97/ruff-0.7.2-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:e00163fb897d35523c70d71a46fbaa43bf7bf9af0f4534c53ea5b96b2e03397b", size = 11870894 }, + { url = "https://files.pythonhosted.org/packages/06/6a/c716bb126218227f8e604a9c484836257708a05ee3d2ebceb666ff3d3867/ruff-0.7.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f3c54b538633482dc342e9b634d91168fe8cc56b30a4b4f99287f4e339103e88", size = 11449533 }, + { url = "https://files.pythonhosted.org/packages/e6/2f/3a5f9f9478904e5ae9506ea699109070ead1e79aac041e872cbaad8a7458/ruff-0.7.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7b792468e9804a204be221b14257566669d1db5c00d6bb335996e5cd7004ba80", size = 12607919 }, + { url = "https://files.pythonhosted.org/packages/a0/57/4642e57484d80d274750dcc872ea66655bbd7e66e986fede31e1865b463d/ruff-0.7.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dba53ed84ac19ae4bfb4ea4bf0172550a2285fa27fbb13e3746f04c80f7fa088", size = 11016915 }, + { url = "https://files.pythonhosted.org/packages/4d/6d/59be6680abee34c22296ae3f46b2a3b91662b8b18ab0bf388b5eb1355c97/ruff-0.7.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:b19fafe261bf741bca2764c14cbb4ee1819b67adb63ebc2db6401dcd652e3748", size = 10625424 }, + { url = "https://files.pythonhosted.org/packages/82/e7/f6a643683354c9bc7879d2f228ee0324fea66d253de49273a0814fba1927/ruff-0.7.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:28bd8220f4d8f79d590db9e2f6a0674f75ddbc3847277dd44ac1f8d30684b828", size = 10233692 }, + { url = "https://files.pythonhosted.org/packages/d7/48/b4e02fc835cd7ed1ee7318d9c53e48bcf6b66301f55925a7dcb920e45532/ruff-0.7.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:9fd67094e77efbea932e62b5d2483006154794040abb3a5072e659096415ae1e", size = 10751825 }, + { url = "https://files.pythonhosted.org/packages/1e/06/6c5ee6ab7bb4cbad9e8bb9b2dd0d818c759c90c1c9e057c6ed70334b97f4/ruff-0.7.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:576305393998b7bd6c46018f8104ea3a9cb3fa7908c21d8580e3274a3b04b691", size = 11074811 }, + { url = "https://files.pythonhosted.org/packages/a1/16/8969304f25bcd0e4af1778342e63b715e91db8a2dbb51807acd858cba915/ruff-0.7.2-py3-none-win32.whl", hash = "sha256:fa993cfc9f0ff11187e82de874dfc3611df80852540331bc85c75809c93253a8", size = 8650268 }, + { url = "https://files.pythonhosted.org/packages/d9/18/c4b00d161def43fe5968e959039c8f6ce60dca762cec4a34e4e83a4210a0/ruff-0.7.2-py3-none-win_amd64.whl", hash = "sha256:dd8800cbe0254e06b8fec585e97554047fb82c894973f7ff18558eee33d1cb88", size = 9433693 }, + { url = "https://files.pythonhosted.org/packages/7f/7b/c920673ac01c19814dd15fc617c02301c522f3d6812ca2024f4588ed4549/ruff-0.7.2-py3-none-win_arm64.whl", hash = "sha256:bb8368cd45bba3f57bb29cbb8d64b4a33f8415d0149d2655c5c8539452ce7760", size = 8735845 }, ] From c905b2da29931893aa698adbc422b2f28bbfe882 Mon Sep 17 00:00:00 2001 From: voluntas Date: Wed, 6 Nov 2024 22:38:19 +0900 Subject: [PATCH 38/45] =?UTF-8?q?=E8=89=B2=E3=80=85=E6=83=85=E5=A0=B1?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/momo.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/momo.py b/test/momo.py index 33c6739a..ac88643c 100644 --- a/test/momo.py +++ b/test/momo.py @@ -24,6 +24,7 @@ class Momo: def __init__(self, mode="test", port=5000): self.executable = RELEASE_DIR / "momo" + assert self.executable.exists() self.mode = mode self.port = port self.process = None @@ -38,6 +39,7 @@ def __exit__(self, exc_type, exc_val, exc_tb): def run_app(self): print(self.executable) + args = [ str(self.executable), self.mode, @@ -57,7 +59,7 @@ def run_app(self): def start(self): if not self.executable.exists(): - raise FileNotFoundError(f"Momo executable not found: {self.executable}") + raise FileNotFoundError(f"Executable file not found: {self.executable}") self.thread = threading.Thread(target=self.run_app) self.thread.start() @@ -85,6 +87,6 @@ def stop(self): print("Momo did not terminate gracefully. Forcing termination.", file=sys.stderr) self.process.kill() - self.thread.join() + self.thread.join(timeout=5) self.is_running = False print("Momo stopped") From d6f8604aaaa6e2ad4711b26a751679b81c0b84e4 Mon Sep 17 00:00:00 2001 From: voluntas Date: Wed, 6 Nov 2024 22:44:24 +0900 Subject: [PATCH 39/45] =?UTF-8?q?=E7=A2=BA=E8=AA=8D=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/e2e-test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index e7d4a562..3405d1a8 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -40,6 +40,9 @@ jobs: run: | sudo modprobe v4l2loopback devices=1 video_nr=0 exclusive_caps=1 card_label='VCamera' ls -l /dev/video0 + - run: | + v4l2-ctl --device /dev/video0 --all + v4l2-ctl --device /dev/video0 --list-formats-ext - run: /home/runner/work/momo/momo/_build/ubuntu-22.04_x86_64/release/momo/momo --version - run: uv sync working-directory: ./test From 9f32cfde51aacf163ce49f5c160aaec59a987ba3 Mon Sep 17 00:00:00 2001 From: voluntas Date: Wed, 6 Nov 2024 22:46:23 +0900 Subject: [PATCH 40/45] sudo --- .github/workflows/e2e-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 3405d1a8..c62f3015 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -41,8 +41,8 @@ jobs: sudo modprobe v4l2loopback devices=1 video_nr=0 exclusive_caps=1 card_label='VCamera' ls -l /dev/video0 - run: | - v4l2-ctl --device /dev/video0 --all - v4l2-ctl --device /dev/video0 --list-formats-ext + sudo v4l2-ctl --device /dev/video0 --all + sudo v4l2-ctl --device /dev/video0 --list-formats-ext - run: /home/runner/work/momo/momo/_build/ubuntu-22.04_x86_64/release/momo/momo --version - run: uv sync working-directory: ./test From 91e8add5552a7c3b6aafc47fe81ebf77edcdbff2 Mon Sep 17 00:00:00 2001 From: voluntas Date: Wed, 6 Nov 2024 23:01:47 +0900 Subject: [PATCH 41/45] =?UTF-8?q?sudo=20=E4=BB=98=E3=81=91=E3=81=A6?= =?UTF-8?q?=E3=81=BF=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/momo.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/momo.py b/test/momo.py index ac88643c..1418a888 100644 --- a/test/momo.py +++ b/test/momo.py @@ -41,6 +41,7 @@ def run_app(self): print(self.executable) args = [ + "sudo", str(self.executable), self.mode, "--port", From 5a6629980de936668fed6fc8d908a958592a55e3 Mon Sep 17 00:00:00 2001 From: voluntas Date: Wed, 6 Nov 2024 23:41:26 +0900 Subject: [PATCH 42/45] =?UTF-8?q?=E8=89=B2=E3=80=85=E5=A4=89=E3=81=88?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 ++++ test/.env.template | 4 ++++ test/conftest.py | 36 ++++++++++++++++++++++++++++++++++ test/{momo.py => momo_sora.py} | 33 +++++++++++++++++++++++++------ test/pyproject.toml | 8 ++++++-- test/test_momo.py | 6 +++--- test/uv.lock | 13 +++++++++++- 7 files changed, 92 insertions(+), 12 deletions(-) create mode 100644 test/.env.template create mode 100644 test/conftest.py rename test/{momo.py => momo_sora.py} (80%) diff --git a/.gitignore b/.gitignore index 6bf4759f..d9ea684a 100644 --- a/.gitignore +++ b/.gitignore @@ -51,3 +51,7 @@ __pycache__ # vscode build + +# .env +.env +!.env.template diff --git a/test/.env.template b/test/.env.template new file mode 100644 index 00000000..8a764035 --- /dev/null +++ b/test/.env.template @@ -0,0 +1,4 @@ +TEST_SIGNALING_URLS=wss://sora.example.com/signaling +TEST_CHANNEL_ID_PREFIX=momo_ +TEST_SECRET_KEY=secret +TEST_API_URL=https://sora.example.com/api diff --git a/test/conftest.py b/test/conftest.py new file mode 100644 index 00000000..914df6d9 --- /dev/null +++ b/test/conftest.py @@ -0,0 +1,36 @@ +import os + +import pytest +from dotenv import load_dotenv + + +@pytest.fixture +def setup(): + # 環境変数読み込み + load_dotenv() + + # signaling_url 単体か複数かをランダムで決めてテストする + if (test_signaling_urls := os.environ.get("TEST_SIGNALING_URLS")) is None: + raise ValueError("TEST_SIGNALING_URLS is required.") + + # , で区切って ['wss://...', ...] に変換 + test_signaling_urls = test_signaling_urls.split(",") + + if (test_channel_id_prefix := os.environ.get("TEST_CHANNEL_ID_PREFIX")) is None: + raise ValueError("TEST_CHANNEL_ID_PREFIX is required.") + + if (test_secret_key := os.environ.get("TEST_SECRET_KEY")) is None: + raise ValueError("TEST_SECRET_KEY is required.") + + # if (test_api_url := os.environ.get("TEST_API_URL")) is None: + # raise ValueError("TEST_API_URL is required.") + + return { + "signaling_urls": test_signaling_urls, + "channel_id_prefix": test_channel_id_prefix, + # "secret": test_secret_key, + # "api_url": test_api_url, + "metadata": {"access_token": test_secret_key}, + # openh264_path は str | None でよい + # "openh264_path": os.environ.get("OPENH264_PATH"), + } diff --git a/test/momo.py b/test/momo_sora.py similarity index 80% rename from test/momo.py rename to test/momo_sora.py index 1418a888..9ba8d0e4 100644 --- a/test/momo.py +++ b/test/momo_sora.py @@ -4,6 +4,7 @@ import sys import threading import time +import uuid from pathlib import Path # プラットフォームに応じたリリースディレクトリの設定 @@ -22,11 +23,27 @@ class Momo: - def __init__(self, mode="test", port=5000): + signaling_urls: list[str] + channel_id_prefix: str + secret_key: str + port: int + + def __init__( + self, + signaling_urls: list[str], + channel_id_prefix: str, + metadata: dict[str, str], + ): + self.signaling_urls = signaling_urls + self.channel_id_prefix = channel_id_prefix + self.metadata = metadata + + self.channel_id = f"{self.channel_id_prefix}_{uuid.uuid4()}" + + self.port = 5000 + self.executable = RELEASE_DIR / "momo" assert self.executable.exists() - self.mode = mode - self.port = port self.process = None self.thread = None self.is_running = False @@ -38,14 +55,18 @@ def __exit__(self, exc_type, exc_val, exc_tb): self.stop() def run_app(self): - print(self.executable) - args = [ "sudo", str(self.executable), - self.mode, + "sora", "--port", str(self.port), + "--signaling-urls", + ",".join(self.signaling_urls), + "--channel-id", + self.channel_id_prefix, + "--secret-key", + self.secret_key, "--video-device", # これは GitHub Actions 用 "VCamera", diff --git a/test/pyproject.toml b/test/pyproject.toml index 49344935..3a615da8 100644 --- a/test/pyproject.toml +++ b/test/pyproject.toml @@ -2,12 +2,16 @@ name = "momo-e2e-test" version = "2013.3.8" requires-python = ">= 3.12" -dependencies = ["pytest>=8.3", "pytest-timeout>=2.3"] +dependencies = [ + "pytest>=8.3", + "pytest-timeout>=2.3", + "python-dotenv>=1.0", +] [tool.uv] package = false managed = true -dev-dependencies = ["ruff>=0.6"] +dev-dependencies = ["ruff"] [tool.pytest.ini_options] timeout = 45 diff --git a/test/test_momo.py b/test/test_momo.py index 5b7d6ac5..2fc442e7 100644 --- a/test/test_momo.py +++ b/test/test_momo.py @@ -1,10 +1,10 @@ import time -from momo import Momo +from momo_sora import Momo -def test_start_and_stop(): - with Momo() as momo: +def test_start_and_stop(setup): + with Momo(**setup) as momo: momo.start() time.sleep(3) diff --git a/test/uv.lock b/test/uv.lock index 3319dd38..0ad4f555 100644 --- a/test/uv.lock +++ b/test/uv.lock @@ -26,6 +26,7 @@ source = { virtual = "." } dependencies = [ { name = "pytest" }, { name = "pytest-timeout" }, + { name = "python-dotenv" }, ] [package.dev-dependencies] @@ -37,10 +38,11 @@ dev = [ requires-dist = [ { name = "pytest", specifier = ">=8.3" }, { name = "pytest-timeout", specifier = ">=2.3" }, + { name = "python-dotenv", specifier = ">=1.0" }, ] [package.metadata.requires-dev] -dev = [{ name = "ruff", specifier = ">=0.6" }] +dev = [{ name = "ruff" }] [[package]] name = "packaging" @@ -87,6 +89,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/03/27/14af9ef8321f5edc7527e47def2a21d8118c6f329a9342cc61387a0c0599/pytest_timeout-2.3.1-py3-none-any.whl", hash = "sha256:68188cb703edfc6a18fad98dc25a3c61e9f24d644b0b70f33af545219fc7813e", size = 14148 }, ] +[[package]] +name = "python-dotenv" +version = "1.0.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/bc/57/e84d88dfe0aec03b7a2d4327012c1627ab5f03652216c63d49846d7a6c58/python-dotenv-1.0.1.tar.gz", hash = "sha256:e324ee90a023d808f1959c46bcbc04446a10ced277783dc6ee09987c37ec10ca", size = 39115 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/6a/3e/b68c118422ec867fa7ab88444e1274aa40681c606d59ac27de5a5588f082/python_dotenv-1.0.1-py3-none-any.whl", hash = "sha256:f7b63ef50f1b690dddf550d03497b66d609393b40b564ed0d674909a68ebf16a", size = 19863 }, +] + [[package]] name = "ruff" version = "0.7.2" From 0489e247e131dd0015b0d7f7275e750162141659 Mon Sep 17 00:00:00 2001 From: voluntas Date: Wed, 6 Nov 2024 23:47:21 +0900 Subject: [PATCH 43/45] =?UTF-8?q?env=20=E8=A8=AD=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/e2e-test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index c62f3015..9b387639 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -19,6 +19,9 @@ jobs: - ubuntu-22.04 # - ubuntu-24.04 env: + TEST_SIGNALING_URLS: ${{ secrets.TEST_SIGNALING_URLS }} + TEST_CHANNEL_ID_PREFIX: ${{ secrets.TEST_CHANNEL_ID_PREFIX }} + TEST_SECRET_KEY: ${{ secrets.TEST_SECRET_KEY }} MOMO_VERSION: "2024.1.0" MOMO_ARCH: "x86_64" runs-on: ${{ matrix.os }} From 75b2f83c61d57f3a5531a6a0cddd342bc5342211 Mon Sep 17 00:00:00 2001 From: voluntas Date: Wed, 6 Nov 2024 23:54:07 +0900 Subject: [PATCH 44/45] metadata --- test/momo_sora.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/momo_sora.py b/test/momo_sora.py index 9ba8d0e4..8c6e652a 100644 --- a/test/momo_sora.py +++ b/test/momo_sora.py @@ -1,3 +1,4 @@ +import json import platform import signal import subprocess @@ -25,7 +26,7 @@ class Momo: signaling_urls: list[str] channel_id_prefix: str - secret_key: str + metadata: dict[str, str] port: int def __init__( @@ -65,11 +66,11 @@ def run_app(self): ",".join(self.signaling_urls), "--channel-id", self.channel_id_prefix, - "--secret-key", - self.secret_key, "--video-device", # これは GitHub Actions 用 "VCamera", + "--metadata", + json.dumps(self.metadata), ] try: self.process = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) From 5dc9403da6ecb9f406e6725ee4e05330d376a039 Mon Sep 17 00:00:00 2001 From: voluntas Date: Thu, 7 Nov 2024 00:08:05 +0900 Subject: [PATCH 45/45] =?UTF-8?q?=E3=81=A6=E3=81=99=E3=81=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/momo_sora.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/test/momo_sora.py b/test/momo_sora.py index 8c6e652a..7b5567e4 100644 --- a/test/momo_sora.py +++ b/test/momo_sora.py @@ -56,19 +56,17 @@ def __exit__(self, exc_type, exc_val, exc_tb): self.stop() def run_app(self): + print(self.executable) args = [ - "sudo", str(self.executable), "sora", - "--port", - str(self.port), "--signaling-urls", ",".join(self.signaling_urls), "--channel-id", self.channel_id_prefix, - "--video-device", + # "--video-device", # これは GitHub Actions 用 - "VCamera", + # "VCamera", "--metadata", json.dumps(self.metadata), ] @@ -92,7 +90,7 @@ def start(self): start_time = time.time() while time.time() - start_time < 10: # 10秒のタイムアウト if self.process and self.process.poll() is None: - print(f"Momo started on port {self.port}") + print("Momo started") return time.sleep(0.1)