Setting exit code to Powershell script does not work
I am using Pester to run unit tests for a few Powershell scripts. I've set up the test script in AppVeyor to be:
Invoke-Pester -EnableExit
It runs correctly, but when any test fails, the build still succeeds.
It seems that Pester
uses $host.SetShouldExit()
to set the exit code.
Was AppVeyor supposed to work with this?
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Feodor Fitsner on 19 Jul, 2014 05:39 AM
Hi Alex,
It's not currently implemented, but I'll look into that.
Support Staff 2 Posted by Feodor Fitsner on 19 Jul, 2014 03:20 PM
We've just deployed an update implementing that. Give it another try and let me know how it goes.
3 Posted by Alex Tercete on 21 Jul, 2014 10:51 AM
Hey Feodor, thanks for the quick fix. However, it does not appear to have worked. The build is still green, even though there are failed tests. I have even tried to call
$host.SetShouldExit(1)
myself to make sure it was not anything related to Pester.Support Staff 4 Posted by Feodor Fitsner on 21 Jul, 2014 03:22 PM
Will take a look.
Support Staff 5 Posted by Feodor Fitsner on 22 Jul, 2014 06:50 AM
OK, found the issue, fixed and deployed update.
6 Posted by Alex Tercete on 22 Jul, 2014 11:57 AM
It works! Thanks!
Keep up the great work!
Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:46 AM.