From 7f3db2f82ce70886abfc542325c097f3edf7ff27 Mon Sep 17 00:00:00 2001 From: misyaguziya <53165965+misyaguziya@users.noreply.github.com> Date: Wed, 29 Oct 2025 23:37:12 +0900 Subject: [PATCH 1/2] =?UTF-8?q?test=5Fclient.py=E3=82=92=E6=94=B9=E5=96=84?= =?UTF-8?q?:=20/set/data/=20=E3=81=AE=E3=83=A2=E3=83=87=E3=83=AB/=E8=AA=8D?= =?UTF-8?q?=E8=A8=BC=E3=82=AD=E3=83=BC/URL=E7=B3=BB=E3=82=A8=E3=83=B3?= =?UTF-8?q?=E3=83=89=E3=83=9D=E3=82=A4=E3=83=B3=E3=83=88(plamo,gemini,open?= =?UTF-8?q?ai,lmstudio,ollama)=E3=81=A7=20expected=20=E3=81=AB=20[200,400]?= =?UTF-8?q?=20=E3=82=92=E8=BF=BD=E5=8A=A0=E3=80=82=E3=83=87=E3=83=BC?= =?UTF-8?q?=E3=82=BF=E3=81=8C=20None=20=E3=81=AE=E5=A0=B4=E5=90=88?= =?UTF-8?q?=E3=81=AE=E3=82=B9=E3=82=AD=E3=83=83=E3=83=97=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E3=82=92=E8=A6=8B=E7=9B=B4=E3=81=97=E3=80=81expected=20?= =?UTF-8?q?=E3=81=AB=20400=20=E3=81=8C=E5=90=AB=E3=81=BE=E3=82=8C=E3=82=8B?= =?UTF-8?q?=E5=A0=B4=E5=90=88=E3=81=AF=E3=83=87=E3=83=BC=E3=82=BF=E7=84=A1?= =?UTF-8?q?=E3=81=97=E3=81=A7=E3=82=82=E3=83=AA=E3=82=AF=E3=82=A8=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=82=92=E9=80=81=E4=BF=A1=E3=81=97=E3=81=A6=E3=83=86?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= =?UTF-8?q?=E5=A4=89=E6=9B=B4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-python/test_client.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src-python/test_client.py b/src-python/test_client.py index 6dd565d2..ef34f3ff 100644 --- a/src-python/test_client.py +++ b/src-python/test_client.py @@ -540,6 +540,7 @@ class AutomatedEndpointTester: lst = self._get("/get/data/plamo_model_list") or [] import random data = random.choice(lst) if lst else None + expected = [200,400] elif endpoint == "/set/data/plamo_auth_key": data = "PLAMO_DUMMY_KEY" expected = [200,400] @@ -547,6 +548,7 @@ class AutomatedEndpointTester: lst = self._get("/get/data/gemini_model_list") or [] import random data = random.choice(lst) if lst else None + expected = [200,400] elif endpoint == "/set/data/gemini_auth_key": data = "GEMINI_DUMMY_KEY" expected = [200,400] @@ -554,6 +556,7 @@ class AutomatedEndpointTester: lst = self._get("/get/data/openai_model_list") or [] import random data = random.choice(lst) if lst else None + expected = [200,400] elif endpoint == "/set/data/openai_auth_key": data = "OPENAI_DUMMY_KEY" expected = [200,400] @@ -561,6 +564,7 @@ class AutomatedEndpointTester: lst = self._get("/get/data/lmstudio_model_list") or [] import random data = random.choice(lst) if lst else None + expected = [200,400] elif endpoint == "/set/data/lmstudio_url": import random data = random.choice(["http://localhost:1234/v1","http://127.0.0.1:1234/v1","http://invalid_host:9999/v1"]) @@ -569,6 +573,7 @@ class AutomatedEndpointTester: lst = self._get("/get/data/ollama_model_list") or [] import random data = random.choice(lst) if lst else None + expected = [200,400] elif endpoint == "/set/data/deepl_auth_key": data = "DEEPL_DUMMY_KEY" expected=[200,400] @@ -745,7 +750,8 @@ class AutomatedEndpointTester: self._record(endpoint, None, None, expected) print(f"[SetData] {endpoint} -> {Color.RED}UNKNOWN{Color.RESET}") return False - if data is None: + # data が None でも expected に 400 が含まれていれば送信してテスト + if data is None and 400 not in expected: self._record(endpoint, None, None, expected) print(f"[SetData] {endpoint} -> {Color.YELLOW}SKIP(no data){Color.RESET}") return True From 3af594960a6ae2c5fcd580d435295b0e205df4fc Mon Sep 17 00:00:00 2001 From: misyaguziya <53165965+misyaguziya@users.noreply.github.com> Date: Thu, 30 Oct 2025 22:03:37 +0900 Subject: [PATCH 2/2] =?UTF-8?q?test=5Fendpoints.py=20=E3=81=A8=20docs/test?= =?UTF-8?q?=5Fendpoints.md=20=E3=82=92=E8=BF=BD=E5=8A=A0:=20API=E3=82=A8?= =?UTF-8?q?=E3=83=B3=E3=83=89=E3=83=9D=E3=82=A4=E3=83=B3=E3=83=88=E7=B7=8F?= =?UTF-8?q?=E5=90=88=E3=83=86=E3=82=B9=E3=83=88=E3=83=A2=E3=82=B8=E3=83=A5?= =?UTF-8?q?=E3=83=BC=E3=83=AB=E3=82=92=E5=AE=9F=E8=A3=85=E3=83=BB=E6=96=87?= =?UTF-8?q?=E6=9B=B8=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新規: src-python/test_endpoints.py を追加。メインループ統合の総合テストモジュールを実装 - /set/data/* の動的値を実行時に /get/data/... から取得して self.config_dict にキャッシュしてから選択する方式を導入 - main_instance の start()/controller.init() 呼び出しと、Watchdog 用の no-op コールバック設定を追加 - main.mapping のすべての status を True に設定してテスト対象を列挙 - /set/enable /set/disable /set/data /run /delete/data の個別テスト実装(single/all/random/specific パターン) - LLM/API 関連(plamo/gemini/openai/lmstudio/ollama 等)のモデルリスト取得・ランダム選択、認証キー/URL 系は期待ステータスに [200,400] を設定 - マイク/スピーカー等の検証(閾値・タイムアウト)で不正値時に期待ステータスを [400] にするバリデーション追加 - 実行系エンドポイント(/run/*)のテスト実装、テスト不能な操作は [401] でスキップ扱い - ランダムアクセステスト(全体/ON-OFF/特定セット)を実装 - 翻訳の総当たりテスト機能と結果を translation_test_results.json に出力 - テスト結果を収集する record_test_result と generate_summary によるサマリー出力を実装 - 実行中のデバッグログ出力やスキップ/エラー時の詳細ログを追加 - 新規: src-python/docs/test_endpoints.md を追加。上記モジュールの目的・使用方法・取得/キャッシュ戦略・対象エンドポイント一覧などを文書化 目的: API エンドポイントの包括的な自動テスト基盤を整備し、動的値取得による安定化・LLM/API の接続挙動検査・ランダム負荷試験を容易にする --- src-python/docs/{details/backend_test.md => test_endpoints.md} | 2 +- src-python/{backend_test.py => test_endpoints.py} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename src-python/docs/{details/backend_test.md => test_endpoints.md} (98%) rename src-python/{backend_test.py => test_endpoints.py} (100%) diff --git a/src-python/docs/details/backend_test.md b/src-python/docs/test_endpoints.md similarity index 98% rename from src-python/docs/details/backend_test.md rename to src-python/docs/test_endpoints.md index 9cd03d81..f63596e4 100644 --- a/src-python/docs/details/backend_test.md +++ b/src-python/docs/test_endpoints.md @@ -1,4 +1,4 @@ -# backend_test.py - APIエンドポイントテストモジュール +# test_endpoints.py - APIエンドポイントテストモジュール ## 概要 VRCTアプリケーションのAPIエンドポイントを包括的にテストするためのモジュールです。メインループの各種機能をランダムアクセスでテストし、システムの安定性と堅牢性を検証します。 diff --git a/src-python/backend_test.py b/src-python/test_endpoints.py similarity index 100% rename from src-python/backend_test.py rename to src-python/test_endpoints.py