-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Msi installer: smoke test #6105
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
Changes from all commits
2b7c10a
cef0a06
f6530b8
043076a
d5e6a0b
da89fce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -445,6 +445,7 @@ function Get-ReleaseTag | |
| # Implements AppVeyor 'on_finish' step | ||
| function Invoke-AppveyorFinish | ||
| { | ||
| $exitCode = 0 | ||
| try { | ||
| $releaseTag = Get-ReleaseTag | ||
|
|
||
|
|
@@ -474,6 +475,19 @@ function Invoke-AppveyorFinish | |
| $preReleaseVersion = "$previewPrefix-$previewLabel.$env:APPVEYOR_BUILD_NUMBER" | ||
| } | ||
|
|
||
| # Smoke Test MSI installer | ||
| Write-Verbose "Smoke-Testing MSI installer" -Verbose | ||
| $msi = $artifacts | Where-Object { $_.EndsWith(".msi") } | ||
| $msiLog = Join-Path (Get-Location) 'msilog.txt' | ||
| $msiExecProcess = Start-Process msiexec.exe -Wait -ArgumentList "/I $msi /quiet /l*vx $msiLog" -NoNewWindow -PassThru | ||
| if ($msiExecProcess.ExitCode -ne 0) | ||
| { | ||
| Push-AppveyorArtifact msiLog.txt | ||
| $exitCode = $msiExecProcess.ExitCode | ||
| throw "MSI installer failed and returned error code $exitCode. MSI Log was uploaded as artifact." | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps just call Add-Appveyor test with the results?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have tried this in a test branch but although the test shows up as red, the build is still green: https://ci.appveyor.com/project/bergmeister/powershell/build/v6.1.0-preview.281/tests
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yup, I see and the DSC code solves this by throwing...
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No sure about the fact that it actually 'solves' it because throwing still does not make the build red. See here
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that's because we are in the finish.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why can this not be a Pester test that requires admin?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because you build all your packages in the finish step when calling
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks... forgot about that.... |
||
| } | ||
| Write-Verbose "MSI smoke test was successful" -Verbose | ||
|
|
||
| # only publish assembly nuget packages if it is a daily build and tests passed | ||
| if((Test-DailyBuild) -and $env:TestPassed -eq 'True') | ||
| { | ||
|
|
@@ -527,4 +541,13 @@ function Invoke-AppveyorFinish | |
| catch { | ||
| Write-Host -Foreground Red $_ | ||
| } | ||
| finally { | ||
| # A throw statement would not make the build fail. This function is AppVeyor specific | ||
| # and is the only command executed in 'on_finish' phase, so it's safe that we request | ||
| # the current runspace to exit with the specified exit code. If the exit code is non-zero, | ||
| # AppVeyor will fail the build. | ||
| # See this link for details: | ||
| # https://help.appveyor.com/discussions/problems/4498-powershell-exception-in-test_script-does-not-fail-build | ||
| $host.SetShouldExit($exitCode) | ||
| } | ||
| } | ||

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.
Does it run with elevated privileges?
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.
Yes (otherwise it would fail)