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
Invoke-Pester doesn't fail in Azure Devops Build if Invoke-Command shortcut used with invalid path #1644
Comments
#1643 might relate. |
Have you tried with |
@asears Have you tried the suggestion above? The Lines 1135 to 1137 in 8d55526
Non-zero exit code will fail the powershell step in a DevOps pipeline. |
@asears gentle ping on this. |
Closing for inactivity. |
Sorry for the delay. No issues closing here! It's probably on the Devops side with possible improvements to how Pester throws errors vs just warns on them in the Devops pipeline, or how CI behavior may be different / support less than non-CI. I believe I tried CI and at the time encountered some differences / limitations that I can't recall right now. Perhaps the issue was with code coverage and having multiple paths to cover? In one of our projects, scripts are structured as: Project/ScriptCategory1/scriptname1.ps1 Tests are currently structured as There's about 40+ categories of scripts. I was running blocks of tests separately due to discovery phase being slow, priority of tests, and was passing each set of categories in as a block. There was some challenges getting test results and code coverage consolidated, outputted and published, and merged in Devops with this pattern. I'll see what's currently used in the pipeline. |
Not sure how to help here, we need a proper repro. |
1. General summary of the issue
Using Pester 5.0.2 and Azure Devops Azure Powershell Code cli.
scratch.Tests.ps1
Script displays an error, however error does not fail pipeline.
2. Describe Your Environment
Running Invoke-Pester with Powershell 7 locally and in Azure Devops.
Azure Powershell 5.0 task
Fail on standard error set
Powershell core
Erroraction Stop set
3. Expected Behavior
Build fails or warns, build breaker on PR
4.Current Behavior
Devops Step succeeds with warning messages shown.
5. Possible Solution
This may not be a Pester issue, could be Devops is masking the error. Is there a way to identify if there was an error returned as part of this script invoke-pester call and we can add a workaround throw?
6. Context
The text was updated successfully, but these errors were encountered: