From 4cca4e3871053e698d1033a70b41460c0d05dac5 Mon Sep 17 00:00:00 2001 From: Sergey Simonchik Date: Wed, 19 Oct 2016 18:05:34 +0300 Subject: [PATCH] don't count the same test twice in statistics if testFailed is followed by testFinished --- .../runner/GeneralIdBasedToSMTRunnerEventsConvertor.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/GeneralIdBasedToSMTRunnerEventsConvertor.java b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/GeneralIdBasedToSMTRunnerEventsConvertor.java index d7f3fd00cccb..231808d6bf7d 100644 --- a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/GeneralIdBasedToSMTRunnerEventsConvertor.java +++ b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/GeneralIdBasedToSMTRunnerEventsConvertor.java @@ -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); } });