How can we help you today? How can we help you today?

How to cause pipeline build to error when running Invoke-DatabaseTests

I am creating a a CICD pipeline and need to have the build fail when I get a test error.  I am using powershell in Gitlab to run the build and Octopus is doing the actual deployment.  When I run the build, I can see the error from the test but it is interpreted as a warning and the build continues.  How do I get it to fail instead of just a warning?
Scott Lancaster
0

Comments

3 comments

  • Jessica R
    Hi scott1060!

    I believe you can set the $WarningPreference variable mentioned on this page so that a warning would stop the process (for example,  $WarningPreference = "Stop").

    Hope that helps!

    Jessica R
    0
  • scott1060
    I will test that out.  Thank you!
    scott1060
    0
  • scott1060
    Sorry for taking so long to get back to this issue.  The variable changes does work.  Thanks!
    scott1060
    0

Add comment

Please sign in to leave a comment.