Skip to content

Commit

Permalink
Update: デフォルトモデルの追加に伴い、E2E テストで StyleBertVITS2TTSEngine を用いるよう変更
Browse files Browse the repository at this point in the history
これで CI により最低限音声合成できることが保証されるはず
  • Loading branch information
tsukumijima committed Nov 23, 2024
1 parent 3d712c1 commit 10227fb
Show file tree
Hide file tree
Showing 23 changed files with 149 additions and 128 deletions.
2 changes: 1 addition & 1 deletion test/e2e/__snapshots__/test_tts.ambr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# serializer version: 1
# name: test_テキストとキャラクターIDから音声を合成できる
'MD5:8f7ddc461c68542d4d8ef4cd5c54ca82'
'MD5:015a2f6482f2a893c4c61e63c10993b3'
# ---
13 changes: 10 additions & 3 deletions test/e2e/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@

from voicevox_engine.aivm_manager import AivmManager
from voicevox_engine.app.application import generate_app
from voicevox_engine.core.core_initializer import initialize_cores
from voicevox_engine.core.core_initializer import MOCK_VER, initialize_cores
from voicevox_engine.engine_manifest import load_manifest
from voicevox_engine.library.library_manager import LibraryManager
from voicevox_engine.preset.preset_manager import PresetManager
from voicevox_engine.setting.setting_manager import SettingHandler
from voicevox_engine.tts_pipeline.tts_engine import make_tts_engines_from_cores
from voicevox_engine.tts_pipeline.style_bert_vits2_tts_engine import (
StyleBertVITS2TTSEngine,
)
from voicevox_engine.tts_pipeline.tts_engine import TTSEngineManager
from voicevox_engine.user_dict.user_dict_manager import (
DEFAULT_DICT_DIR_PATH,
UserDictionary,
Expand All @@ -36,7 +39,11 @@ def _copy_under_dir(file_path: Path, dir_path: Path) -> Path:
def app_params(tmp_path: Path) -> dict[str, Any]:
aivm_manager = AivmManager(get_save_dir() / "Models")
core_manager = initialize_cores(use_gpu=False, enable_mock=True)
tts_engines = make_tts_engines_from_cores(core_manager)
tts_engines = TTSEngineManager()
tts_engines.register_engine(
StyleBertVITS2TTSEngine(aivm_manager, False, False),
MOCK_VER,
)
setting_loader = SettingHandler(tmp_path / "not_exist.yaml")

# テスト用に隔離されたプリセットを生成する
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# serializer version: 1
# name: test_post_synthesis_200
'MD5:f7d42ce5787856549abc3d2d7561c06f'
'MD5:bb372629df13cbec280585d3d34dc217'
# ---
# name: test_post_synthesis_old_audio_query_200
'MD5:f7d42ce5787856549abc3d2d7561c06f'
'MD5:f76a5639ff8327ccee59844624be2ef5'
# ---
2 changes: 1 addition & 1 deletion test/e2e/single_api/tts_pipeline/test_accent_phrases.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def test_post_accent_phrases_200(
client: TestClient, snapshot_json: SnapshotAssertion
) -> None:
response = client.post(
"/accent_phrases", params={"text": "テストです", "speaker": 0}
"/accent_phrases", params={"text": "テストです", "speaker": 888753760}
)
assert response.status_code == 200
assert snapshot_json == round_floats(response.json(), 2)
4 changes: 3 additions & 1 deletion test/e2e/single_api/tts_pipeline/test_audio_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
def test_post_audio_query_200(
client: TestClient, snapshot_json: SnapshotAssertion
) -> None:
response = client.post("/audio_query", params={"text": "テストです", "speaker": 0})
response = client.post(
"/audio_query", params={"text": "テストです", "speaker": 888753760}
)
assert response.status_code == 200
assert snapshot_json == round_floats(response.json(), round_value=2)
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
def test_post_initialize_speaker_204(
client: TestClient, snapshot: SnapshotAssertion
) -> None:
response = client.post("/initialize_speaker", params={"speaker": 0})
response = client.post("/initialize_speaker", params={"speaker": 888753760})
assert response.status_code == 204
assert snapshot == response.content
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
def test_get_is_initialized_speaker_200(
client: TestClient, snapshot_json: SnapshotAssertion
) -> None:
response = client.get("/is_initialized_speaker", params={"speaker": 0})
response = client.get("/is_initialized_speaker", params={"speaker": 888753760})
assert response.status_code == 200
assert snapshot_json == response.json()
Loading

0 comments on commit 10227fb

Please sign in to comment.