[tests] Improve the AppSizeTest a bit.#25143
Conversation
* Don't fail immediately if the file with the expected sizes can't be parsed, treat it like the file didn't exist (this allows it to be easily re-generated even if it's invalid - which is common with merge conflicts, with this change the test will just overwrite any expected files that have merge conflict markers). * Don't fail if the set of files has changed and the test is updating the expected sizes (instead just write out the expected sizes instead).
|
Azure Pipelines: 2 pipeline(s) require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
Updates the AppSizeTest unit test infrastructure to be more resilient when the on-disk “expected size” report is missing/invalid, and to better support workflows that regenerate expected outputs after changes or merge conflicts.
Changes:
- Switch from
long.Parsetolong.TryParsefor the expected app size header so invalid/merge-conflicted expected files don’t immediately break the test. - Avoid failing the test on added/removed bundle files when the test is in “updated expected output” mode.
✅ [CI Build #5a90412] Build passed (Build packages) ✅Pipeline on Agent |
✅ [PR Build #5a90412] Build passed (Detect API changes) ✅Pipeline on Agent |
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
✅ [CI Build #5a90412] Build passed (Build macOS tests) ✅Pipeline on Agent |
🚀 [CI Build #5a90412] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 156 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
treat it like the file didn't exist (this allows it to be easily
re-generated even if it's invalid - which is common with merge conflicts,
with this change the test will just overwrite any expected files that have
merge conflict markers).
expected sizes (instead just write out the expected sizes instead).