-
Notifications
You must be signed in to change notification settings - Fork 323
Narrowly fix Test-Packages.ps1 and Analyze-Code.ps1 #3106
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
Conversation
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.
Pull Request Overview
This PR implements a temporary fix to improve error handling in PowerShell build scripts by adding explicit exit code checks after command execution. The changes ensure that failures in cargo commands and other build tools are properly detected and cause script termination.
Key changes:
- Replace direct
Invoke-LoggedCommandcalls with pattern that stores command in variable and checks$LastExitCode - Add
Write-Errorcalls when commands fail to ensure proper script termination - Apply consistent error handling pattern across multiple cargo operations
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| eng/scripts/Test-Packages.ps1 | Added error checking for cargo build and test commands to ensure failures are properly handled |
| eng/scripts/Analyze-Code.ps1 | Added error checking for all cargo commands, rustup, and dependency verification scripts |
This reverts commit 2cc1aec.
This reverts commit 2cc1aec.
Reverts #3106 Example failure (test and analyze failures expected): https://dev.azure.com/azure-sdk/public/_build/results?buildId=5418072&view=results Example success: https://dev.azure.com/azure-sdk/public/_build/results?buildId=5418071&view=results
|
@danieljurek this shouldn't be the short-term fix this should be the real fix. |
This is a short term fix. The longer term fix involves getting LogError to Write-Error
Analyze job failure: https://dev.azure.com/azure-sdk/public/_build/results?buildId=5413162&view=logs&j=b70e5e73-bbb6-5567-0939-8415943fadb9
Test jobs should also fail: https://dev.azure.com/azure-sdk/public/_build/results?buildId=5413162&view=logs&j=76992fd1-2312-5fae-7c45-7baba86b87ae