-
Notifications
You must be signed in to change notification settings - Fork 346
test: VVPPデフォルトエンジンを使うテストを書く #2444
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
The head ref may contain hidden characters: "VVPP\u30C7\u30D5\u30A9\u30EB\u30C8\u30A8\u30F3\u30B8\u30F3\u3092\u4F7F\u3046\u30C6\u30B9\u30C8\u3092\u66F8\u304F"
Conversation
|
🚀 プレビュー用ページを作成しました 🚀 更新時点でのコミットハッシュ: |
| process.env.VITE_7Z_BIN_NAME = | ||
| (options.mode === "development" | ||
| (mode !== "production" | ||
| ? path.join(import.meta.dirname, "vendored", "7z") + path.sep | ||
| : "") + sevenZipBinName; |
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.
testのときも7zのパスの注入が働くように変更しました。
|
テストが通ったのでレビュー開けます!! |
| log.error(`Failed to install ${vvppPath},`, e); | ||
| dialog.showErrorBox( | ||
| "インストールエラー", | ||
| `${vvppPath} をインストールできませんでした。`, | ||
| ); | ||
| log.error(`Failed to install ${vvppPath},`, e); |
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.
@sevenc-nanashi
変更行数の割にかなり設計が複雑なのでヘビーかもなのですが、レビューお願いしても良いでしょうか 🙇 🙇 🙇
approveの自信がなかったらとりあえずコメントだけとかでも大丈夫です!
このPRの実装に若干自信がないので誰かの目が入ってほしい気持ち。
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.
LGTMです。
| /** .envからデフォルトエンジン情報を読み込む */ | ||
| export function loadEnvEngineInfos(): EnvEngineInfoType[] { | ||
| // electronのときはプロセスの環境変数を参照する。 | ||
| // NOTE: electronテスト環境を切り替えるため。テスト環境が1本化されればimport.meta.envを使う。 |
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.
おっと 僕の脳内ストーリーだとこんな感じです!
- 製品版の起動がVVPPデフォルトエンジンに1本化される
- 必要なテストが1種類になる
process.env.VITE_DEFAULT_ENGINE_INFOSが不要になる- ここのNOTEコメントが不要になる!
もし手元の環境でVITE_DEFAULT_ENGINE_INFOSを変えたい場合もimport.meta.env側を使えば良いはずなので、普通にimport.meta.envに共通化できる・・・・・はず・・・?
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.
レビューありがとうございます!!
ちなみにもしかしたら割とサクッとレビューできたりしましたか・・・? 👀
(このPRの変更は相当文脈が深く、 @sevenc-nanashi さんも把握できてないポイントがいくつかありそうで結構難しいお願いをしてしまったかなと思っています)
内容
VVPPデフォルトエンジンを使うテストを書きます。
途中でelectronのダイアログが来ますが、ダイアログ表示関数を直接上書きすることで無理やり突破します。
将来的にはelectronのダイアログではなくブラウザ表示になる予定なのでこのワークアラウンド不要になる予定です。
変更行数は少ないですが、結構複雑度が上がってしまっています。解決策募集中。。
関連 Issue
その他
おそらく動くのですが、VOICEVOXエンジンをダウンロードする部分が重くてタイムアウトになると思います。
Nemo用のlatestDefaultEngineInfosを作ろうと思います。