提交 7921599c 编写于 作者: G Greg Temchenko

JENKINS-13377 duration on history page bugfix

上级 54325769
......@@ -185,6 +185,7 @@ public final class TestResult extends MetaTabulatedResult {
}
private void add(SuiteResult sr) {
duration += sr.getDuration();
for (SuiteResult s : suites) {
// JENKINS-12457: If a testsuite is distributed over multiple files, merge it into a single SuiteResult:
if(s.getName().equals(sr.getName()) && nullSafeEq(s.getId(),sr.getId())) {
......@@ -204,7 +205,6 @@ public final class TestResult extends MetaTabulatedResult {
}
}
suites.add(sr);
duration += sr.getDuration();
}
private boolean strictEq(Object lhs, Object rhs) {
......
......@@ -125,6 +125,9 @@ public class TestResultTest extends TestCase {
assertEquals("Wrong number of testsuites", 1, testResult.getSuites().size());
assertEquals("Wrong number of test cases", 2, testResult.getTotalCount());
// check duration: 157.980 (TestSuite_a1.xml) and 15.000 (TestSuite_a2.xml) = 172.98
assertEquals("Wrong duration for test result", 172.98, testResult.getDuration(), 0.1);
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册