Skip to content

Commit 2bea8e8

Browse files
committed
Fix: AivisSpeech Engine の音声合成は常にある程度のランダム性があるため、テストではハッシュ値の比較は行わない
1 parent 897435e commit 2bea8e8

File tree

5 files changed

+9
-19
lines changed

5 files changed

+9
-19
lines changed

test/e2e/__snapshots__/test_openapi/test_OpenAPIの形が変わっていないことを確認.json

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/e2e/__snapshots__/test_tts.ambr

Lines changed: 0 additions & 4 deletions
This file was deleted.

test/e2e/single_api/tts_pipeline/__snapshots__/test_synthesis.ambr

Lines changed: 0 additions & 7 deletions
This file was deleted.

test/e2e/single_api/tts_pipeline/test_synthesis.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
"""
44

55
from test.e2e.single_api.utils import gen_mora
6-
from test.utility import hash_wave_floats_from_wav_bytes
76

87
from fastapi.testclient import TestClient
98
from syrupy.assertion import SnapshotAssertion
109

10+
# from test.utility import hash_wave_floats_from_wav_bytes
11+
1112

1213
def test_post_synthesis_200(client: TestClient, snapshot: SnapshotAssertion) -> None:
1314
query = {
@@ -40,7 +41,8 @@ def test_post_synthesis_200(client: TestClient, snapshot: SnapshotAssertion) ->
4041

4142
# 音声波形が一致する
4243
assert response.headers["content-type"] == "audio/wav"
43-
assert snapshot == hash_wave_floats_from_wav_bytes(response.read())
44+
# AivisSpeech Engine の音声合成は常にある程度のランダム性があるため、テストではハッシュ値の比較は行わない
45+
# assert snapshot == hash_wave_floats_from_wav_bytes(response.read())
4446

4547

4648
def test_post_synthesis_old_audio_query_200(
@@ -74,4 +76,5 @@ def test_post_synthesis_old_audio_query_200(
7476

7577
# 音声波形が一致する
7678
assert response.headers["content-type"] == "audio/wav"
77-
assert snapshot == hash_wave_floats_from_wav_bytes(response.read())
79+
# AivisSpeech Engine の音声合成は常にある程度のランダム性があるため、テストではハッシュ値の比較は行わない
80+
# assert snapshot == hash_wave_floats_from_wav_bytes(response.read())

test/e2e/test_tts.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
TTSのテスト
33
"""
44

5-
from test.utility import hash_wave_floats_from_wav_bytes
5+
# from test.utility import hash_wave_floats_from_wav_bytes
66

77
from fastapi.testclient import TestClient
88
from syrupy.assertion import SnapshotAssertion
@@ -27,4 +27,5 @@ def test_テキストとキャラクターIDから音声を合成できる(
2727

2828
# FileResponse 内の .wav から抽出された音声波形が一致する
2929
assert synthesis_res.headers["content-type"] == "audio/wav"
30-
assert snapshot == hash_wave_floats_from_wav_bytes(synthesis_res.read())
30+
# AivisSpeech Engine の音声合成は常にある程度のランダム性があるため、テストではハッシュ値の比較は行わない
31+
# assert snapshot == hash_wave_floats_from_wav_bytes(synthesis_res.read())

0 commit comments

Comments
 (0)