How to config a sqlcop or tsqlt test as a warning, not a hard fail
ullull
Posts: 9 New member
My understanding of the default behavior is for single failed unit test to fail an entire build.
I'd like to configure certain tests to merely warn if they do not pass, and still allow the build to succeed. How would this be done with, say, Azure Devops?
I'd like to configure certain tests to merely warn if they do not pass, and still allow the build to succeed. How would this be done with, say, Azure Devops?
Answers
By default, Invoke-DatabaseTests will run all tests on a project, however, you can control this using the -RunOnly parameter.
When used in conjuction with the generic Powershell parameters -WarningAction and -ErrorAction this should allow you finely define the actions for individual tests regarding this.
https://documentation.red-gate.com/sca/reference/powershell-cmdlets/invoke-databasetests
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_commonparameters?view=powershell-7
Product Support Engineer
Redgate Software Ltd
Please see our Help Center for detailed guides on how to use our tools