Fail AppVeyor Build if MSI does not build#5755
Conversation
… and introduce syntax error to test it.
|
I restarted Travis CI Linux job. |
|
@bergmeister this is where you tested it, correct? https://ci.appveyor.com/project/bergmeister/powershell/build/v6.1.0-preview.204 |
|
@markekraus Yes, sorry, it seems my link was broken, it is fixed now in the PR description. If you look at the commit history, the first commit contained also a syntax error to test that AppVeyor would actually fail and the 2nd commit reverted the syntax error. Maybe not clean in terms of git history but the PR commit gets squashed anyway. |
build.psm1
Outdated
| $WiXLightLog | Out-String | Write-Verbose -Verbose | ||
| if ($null -ne $env:CI) | ||
| { | ||
| $host.SetShouldExit(-1) |
There was a problem hiding this comment.
Instead of having the CmdLet alter the host behavior, AppVeyor.psm1 should detect this error and fail the CI. This might become unreliable if we attempt this is multiple places.
Another option, is detect we are in AppVeyor, and Add a compilation message
There was a problem hiding this comment.
I applied your suggestion but the error message from Appveyor is very obscure then: https://ci.appveyor.com/project/PowerShell/powershell/build/1.0.7407
… Appveyor environment as suggested in PR
…or testing purposes
PR Summary
Before this PR, when a
WiXcompilation error occurs then an error is thrown, which appears in the log with details but the AppVeyor build itself is still marked as green.This PR makes the console host also return an exit code of -1 when being run on
AppVeyorso that it can then interpret it as a build failure and mark the build as red. It uses the fact that AppVeyor defines an environment variable named CI. Exiting is OK since the MSI build is the last step in CI and nothing happens after that.The git history shows a test build that proves that this works if the installer was broken.
PR Checklist
Note: Please mark anything not applicable to this PR
NA.[feature]if the change is significant or affectes feature tests