You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Azure DevOps builds not failing despite tests failing #31
When a build is run via Azure DevOps I'd expect the build to fail if tests or PSSA fails. For example I have this build which failed while I was fixing various things in how it was versioning etc https://halbaradkenafin.visualstudio.com/Github/_build/results?buildId=775 and it failed correctly due to tests failing.
There was no real changes to the code between those two builds, I've even tried setting the ErrorActionPreference and ContinueOnError in the azure-pipelines.yml to ensure it does stop but it looks like the code isn't even getting to any of the throw statements that should cause it to stop.
After digging into it a bit more and trying to figure out what I might have changed which broke it, turns out that I'd set an output file for the Pester results and that's causing the build to pass even if it should fail.
I can't see why that would make a difference since PassThru is always provided. I'll try to do some more digging and see if I can see what might be happening.
This should almost certainly be adding those keys to the hashtable rather than redefining the hashtable entirely. I'll throw a pull request to fix this.
Activity
ChrisLGardner commentedon Aug 28, 2019
After digging into it a bit more and trying to figure out what I might have changed which broke it, turns out that I'd set an output file for the Pester results and that's causing the build to pass even if it should fail.
I can't see why that would make a difference since PassThru is always provided. I'll try to do some more digging and see if I can see what might be happening.
ChrisLGardner commentedon Aug 28, 2019
And after a second look at the code for this I've spotted the issue:
PowerShellBuild/PowerShellBuild/Public/Test-PSBuildPester.ps1
Line 55 in 6b4998b
This should almost certainly be adding those keys to the hashtable rather than redefining the hashtable entirely. I'll throw a pull request to fix this.
devblackops commentedon Sep 1, 2019
Good catch @ChrisLGardner. Thanks!
fix: Fail the build when a Pester run fails for any reason (#133)