How to fix failed tests count in teamcity for re-executed tests?
<p>We are using <strong>TeamCity</strong> for <strong>Selenium</strong> tests execution with <strong>Specflow+Specrun</strong>, the problem is that TeamCity count re-executed tests.</p>

<p>For example if some test failed for first time he will be re-executed two times more, in teamcity we will see that three tests failed, but probably it was one test. </p>

<p>Also if first re-execution will fail, but other two will success, this will be reported in teamcity as two failed, one passed, but I need to be reported that only one test has been passed.</p>

<p><strong>It is possible to configure this in TeamCity using service messages or something else?</strong></p>

<p><strong>UPDATED:</strong></p>

<p>Based on answer we can gather logs using powershell script and change build status using teamcity service messages:</p>

<pre><code>$path = Get-ChildItem %teamcity.build.checkoutDir%\ProjectFolder\bin\Remote\TestResults\specrun.log
$file = Get-content $path
$total = $file | select-string "Total:"
$passed = $file | select-string "Succeeded:"
$failed = $file | select-string "Failed:"

write-host $( "##teamcity[buildStatus text='Tests {0}, {1}, {2}']" -f $total, $passed, $failed )
</code></pre>