-
Notifications
You must be signed in to change notification settings - Fork 346
test: 音声書き出しe2eテスト #2473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: 音声書き出しe2eテスト #2473
The head ref may contain hidden characters: "wip-\u97F3\u58F0\u66F8\u304D\u51FA\u3057e2e\u30C6\u30B9\u30C8"
Conversation
|
🚀 プレビュー用ページを作成しました 🚀 更新時点でのコミットハッシュ: |
| interrogativeUpspeak: false, | ||
| adjustPauseLength: true, | ||
| interrogativeUpspeak: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ポーズの長さを変えるのもテストしたかったのでモックを修正しました。
| text: "、", | ||
| vowel: "pau", | ||
| vowelLength: 1 - 1 / (accentPhrases.length + 1), | ||
| vowelLength: 1 - 1 / (accentPhrases.length + 2), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
今のaccentPhrasesの数がaccentPhrases.lengthに入っていて、最初は0なので1 - 1/1になって0(ポーズの長さが0)になってしまってたので、+2にしてみました。
tests/e2e/browser/音声書き出し.spec.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
window.backends関数のモックを作るにあたっていくつか妥協したポイントもあったのでコメント。
より良い解決策があれば試したいかも。
- mockを戻せるように作ってない
- 今モック化したのはダイアログ表示の部分と、ファイル書き出しの部分
- ダイアログは表示した瞬間ハングするのと、ファイル書き出しもできないので、まあどちらも戻さなくても問題にならないかなと思い、とりあえずそのままにしています
- 戻せるようにも作れそうだけど、汎用的に書くのは結構難しいかも(全部のモックを戻す関数を作るとかが難しそう)
- 一般化していない
- 他にモックを刺したかった時にさくっとモックをさせるように作れてない
- 今のうちに共通化した方がいいかもだけど・・・良い方法がパッと思いつかなかったので一旦そのままにしています
|
@sevenc-nanashi 完成したのでレビューお願いできると・・・! 🙇 妥協したポイントこちらです。。 なんかもっとこうした方がいいんじゃないかとかあれば。。。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 14 out of 15 changed files in this pull request and generated no comments.
Files not reviewed (1)
- tests/unit/mock/engineMock/snapshots/index.spec.ts.snap: Language not supported
Comments suppressed due to low confidence (2)
src/mock/engineMock/index.ts:104
- Using a null value for pauseLength may lead to type or runtime issues if downstream logic expects a numeric value. Consider initializing this parameter with a default numeric value or handling null explicitly.
pauseLength: null,
src/mock/engineMock/talkModelMock.ts:181
- [nitpick] The change in the divisor from (accentPhrases.length + 1) to (accentPhrases.length + 2) alters the computed vowelLength, potentially affecting audio output. Verify that this adjustment meets the intended voice synthesis requirements.
vowelLength: 1 - 1 / (accentPhrases.length + 2),
sevenc-nanashi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
細かいところを書きましたが、それ以外は問題ないと思います。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 14 out of 15 changed files in this pull request and generated no comments.
Files not reviewed (1)
- tests/unit/mock/engineMock/snapshots/index.spec.ts.snap: Language not supported
Comments suppressed due to low confidence (2)
src/mock/engineMock/talkModelMock.ts:181
- The denominator in the vowelLength calculation changed from (accentPhrases.length + 1) to (accentPhrases.length + 2). Please verify that this adjustment is intentional and correctly reflects the desired audio timing behavior.
vowelLength: 1 - 1 / (accentPhrases.length + 2),
src/mock/engineMock/index.ts:104
- Using null for pauseLength may lead to unexpected behavior if a numeric value is expected. Confirm that this value is acceptable by the engine/mock configuration.
pauseLength: null,
|
たぶん大丈夫だと思うのでマージします! レビューありがとうございました!! |
内容
エンジンモックを使った音声書き出しのテストを書いてみました。
実際の音声も手元にpullしたりダウンロードしたりすれば聞けます。
その他
ブラウザ内でのファイル書き込みをどうモックするかで悩みました。
最終的にbackendのwriteFileをDI(というよりもmock?)することで解決しました。
他の方法としてブラウザに標準的についてる
FileHandleあたりを差し替えることもできるんですが、↓の用にいろいろ問題があったのでやめました。showOpenFilePickerなどのファイル選択ダイアログをmockできないshowOpenFilePickerをDIして適当なFileHandlerを返すこともできるけど、FileHandler周りのテストをPlaywrightがサポートしていないあとテストをplaywrightではなくvitestのブラウザモードで実装するのも考えましたがやめました。
試したところvitest-browser-vueがまだ色々と対応していないのか、ファイルが読み込めてなさそうなエラーが出たので引き返しました。もうちょっと様子見になりそう。