Build failure in Jenkins after failed test MSTest Build failure in Jenkins after failed test MSTest jenkins jenkins

Build failure in Jenkins after failed test MSTest


I know it's pretty old but here are something as I've encountered the same type of problem.

Using Batch:
At the end of that batch command step where you run the tests, add one more exit command, such as exit /b 0 or exit 0.


Using Powershell:
At the end of the powershell command step where you run the tests, same, manually set the exit code $LastExitCode = 0.


Final:
The result will always be set to success no matter how many tests failed so you need to parse and analyze the result yourself. There are tools such as: https://plugins.jenkins.io/mstest and https://plugins.jenkins.io/xunit.