Commit 81d090e
fix: ponpe/atcoderの起動時ネットワークアクセスを解消し、deploy/mahjong/atcoder/ponpe/google-calendarをスモークテスト対象に追加
- ponpe: default() 内でawaitしていたemoji.json/common_word_listのダウンロードと
team.info()呼び出しをlib/utils.tsのLoaderでラップし、実際にゲームが
開始されるまで(isValidEmoji/getTheme呼び出し時まで)遅延させた。
lib/download.tsはファイルが既に存在すればネットワークアクセスをスキップする
実装のため、本番動作への影響はほぼ無い。
- atcoder: default() 起動直後の無条件updateContests()呼び出しを削除。
30分おきのsetIntervalによる定期更新は変更せず維持している。
lib/startup.test.ts:
- vi.useFakeTimers({toFake: ['setTimeout', 'setInterval', 'clearTimeout',
'clearInterval']}) を追加し、setInterval/node-schedule(内部的にsetTimeoutを
使用)由来の定期実行ジョブがテスト実行中に発火しないようにした。Dateまで
フェイク化するとwinstonのタイムスタンプ生成やnode-scheduleのJob生成が
クラッシュするため、toFakeでタイマー関数のみに対象を限定している。
- 上記の対応により、atcoder(30分おきのsetIntervalが発火してもエラーに
ならなくなった)とgoogle-calendar(毎分発火するnode-scheduleのジョブが
テスト中に発火しなくなった)をスモークテスト対象に追加。
- deploy/mahjongは実際に有効化して検証したところ問題なくpassしたため
除外を解除した(旧PR(#1231)のts-jestのESM解決制約が理由だったが、
vitestではこの制約は存在しない。map-guessr/nmpzと同種の誤除外)。
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BuziKVfh8Zx1WC9bRy2MYu1 parent 387fef1 commit 81d090e
3 files changed
Lines changed: 33 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
656 | 656 | | |
657 | 657 | | |
658 | 658 | | |
659 | | - | |
660 | 659 | | |
661 | 660 | | |
662 | 661 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
7 | 21 | | |
8 | 22 | | |
9 | 23 | | |
| |||
16 | 30 | | |
17 | 31 | | |
18 | 32 | | |
19 | | - | |
20 | 33 | | |
21 | 34 | | |
22 | 35 | | |
| |||
78 | 91 | | |
79 | 92 | | |
80 | 93 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | 94 | | |
100 | 95 | | |
101 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
62 | | - | |
63 | | - | |
64 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
65 | 73 | | |
66 | | - | |
67 | 74 | | |
| 75 | + | |
| 76 | + | |
68 | 77 | | |
69 | 78 | | |
70 | 79 | | |
| |||
73 | 82 | | |
74 | 83 | | |
75 | 84 | | |
76 | | - | |
77 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
78 | 89 | | |
79 | | - | |
| 90 | + | |
| 91 | + | |
80 | 92 | | |
81 | 93 | | |
82 | 94 | | |
| |||
0 commit comments