We have an assembly that runs on TeamCity and contains several different test projects. Each of them starts one after another, and we use MSTest.exe from Rakefile to organize everything this way:
desc 'Run Unit Tests' mstest :data_test => [:build_database_tests] do |mstest| puts build_header("Data Tests") mstest.command = msTestCommand mstest.parameters = [ "/resultsfile:dTest.trx", "/detail:errormessage", "/detail:description", "/usestderr" ] mstest.assemblies "../../../Database/DataTests/bin/Release/DataTests.dll" end
This creates a good TRX file that TeamCity can analyze and everything that it does for a clean tab of a clean report. However, MSTest.exe returns 1 if the test fails, which the rake interprets as a failure, and the rest of the tests do not start.
We would like to suppress this behavior; we want the build to continue to work when the test fails, so that we can see that other tests can also fail. How can we make Rake ignore the return code and / or cause MSTest.exe not to return an error code if the test fails?
source share