Skip to content
Permalink
Browse files
[JENKINS-24843] Add marker to where to add duration tally code
  • Loading branch information
kinow committed Oct 8, 2015
1 parent 79809a3 commit 826be90000d4876cce1703449050e4a25b4c5423
Showing with 15 additions and 2 deletions.
  1. +7 −0 src/main/java/org/tap4j/plugin/TapResult.java
  2. +8 −2 src/main/java/org/tap4j/plugin/model/TapStreamResult.java
@@ -77,6 +77,7 @@ public class TapResult implements ModelObject, Serializable {
private int skipped = 0;
private int bailOuts = 0;
private int total = 0;
private float duration = 0.0f;
private String name;
private Boolean todoIsFailure;
private Boolean includeCommentDiagnostics;
@@ -161,6 +162,7 @@ public void tally() {
skipped = 0;
bailOuts = 0;
total = 0;
duration = 0.0f;

for (TestSetMap testSet : testSets) {
TestSet realTestSet = testSet.getTestSet();
@@ -181,6 +183,7 @@ public void tally() {
} else {
passed += 1;
}
duration += 0.0f; // FIXME add code to tally duration
}
}

@@ -239,6 +242,10 @@ public int getTotal() {
return this.total;
}

public float getDuration() {
return this.duration;
}

private boolean isSkipped(TestResult testResult) {
boolean r = false;
Directive directive = testResult.getDirective();
@@ -42,7 +42,8 @@
import org.tap4j.util.StatusValues;

/**
*
* A tabulated TAP Stream result.
*
* @author Bruno P. Kinoshita - http://www.kinoshita.eti.br
* @since 0.1
*/
@@ -147,6 +148,7 @@ public List<CaseResult> getFailedTests() {
return Collections.emptyList();
}

// FIXME: use the getFailedTests, or explain why it's not used
public List<TestResult> getFailedTests2() {
List<TestResult> failedTests = new ArrayList<TestResult>();
if(tapResult != null && tapResult.getTestSets().size() > 0) {
@@ -161,7 +163,11 @@ public List<TestResult> getFailedTests2() {
}
return failedTests;
}


public float getDuration() {
return this.tapResult.getDuration();
};

@Override
public Object getDynamic(String name, StaplerRequest req, StaplerResponse rsp) {
TapTestResultResult tr = getTapTestResultResult(name);

0 comments on commit 826be90

Please sign in to comment.