Windows CI のテストを Defender のスキャン対象から外して高速化する#59
Conversation
The std dummy-tree generation writes thousands of tiny files, and on windows-latest each write goes through Defender's real-time scan, making the unit tests alone take ~90 seconds (#58). Exclude the workspace, temp directories, and the cargo cache from scanning on the disposable runner. TEMP is listed in both its 8.3 short form and the equivalent long form because exclusion matching against short names is unreliable. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 56 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. 📝 WalkthroughWalkthroughThe CI test job now conditionally adds Windows Defender real-time scanning exclusions for workspace, temporary, and Cargo directories before checkout and test execution. ChangesWindows CI performance
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
計測結果 (run 29200567446)
🤖 Generated with Claude Code |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/ci.yml:
- Around line 67-77: Add continue-on-error: true to the “Exclude build
directories from Windows Defender” workflow step so failures from
Add-MpPreference do not fail the test job, while preserving the existing Windows
condition and PowerShell command.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
The exclusion is a speed-up, not a correctness requirement, so a failing Add-MpPreference (Defender disabled, missing privileges, ...) should fall back to running the tests slowly instead of failing the job. Suggested by CodeRabbit. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Resolves #58
概要
Windows の test ジョブに、Windows Defender の除外パスを追加するステップを足します。#58 の対策第一候補 (効き目順 1 番) の実装です。
背景
test (windows-latest, g++) だけ毎回数分かかり、支配的なのは std ダミーツリー生成 (数千個の小ファイル書き込み) が Defender のリアルタイムスキャンに捕まることでした (詳細は #58 の分析を参照)。使い捨てランナーなので、スキャン対象から書き込み先を外します。
変更内容
Add-MpPreference -ExclusionPathステップを追加。GITHUB_WORKSPACE・RUNNER_TEMP・TEMP・LOCALAPPDATA\Temp・~/.cargo。テストの書き込み先は全てtempfile::TempDir(=%TEMP%) で、ほかにワークスペース側の target dir とキャッシュ展開がある。TEMPは 8.3 短縮形 (C:\Users\RUNNER~1\...) で入っており、Defender の除外は短縮形との照合が信頼できないため、同じ場所の長い表記LOCALAPPDATA\Tempも並べて両表記でカバー。計測
この PR の CI 実測で before/after を比較する (現状の基準値: ジョブ全体 3 分 47 秒、ユニットテスト 90.7 秒)。効果が薄ければ #58 の次の選択肢 (リアルタイム監視の無効化、#43 経由の軽量化) を検討。
🤖 Generated with Claude Code
Summary by CodeRabbit