don't count the same test twice in statistics if testFailed is followed by testFinished

This commit is contained in:
Sergey Simonchik
2016-10-19 18:05:34 +03:00
parent 0795a5fdb3
commit 4cca4e3871
@@ -178,7 +178,14 @@ public class GeneralIdBasedToSMTRunnerEventsConvertor extends GeneralTestEventsP
testProxy.setDuration(testFinishedEvent.getDuration());
testProxy.setFrameworkOutputFile(testFinishedEvent.getOutputFile());
testProxy.setFinished();
fireOnTestFinished(testProxy);
if (node.getState() != State.FAILED) {
// Don't count the same test twice if 'testFailed' message is followed by 'testFinished' message
// which may happen if generated TeamCity messages adhere rules from
// https://confluence.jetbrains.com/display/TCD10/Build+Script+Interaction+with+TeamCity
// Anyway, this id-based converter already breaks TeamCity protocol by expecting messages with
// non-standard TeamCity attributes: 'nodeId'/'parentNodeId' instead of 'name'.
fireOnTestFinished(testProxy);
}
terminateNode(node, State.FINISHED);
}
});