Skip to content

Commit

Permalink
[JENKINS-24843] Add marker to where to add duration tally code
Browse files Browse the repository at this point in the history
  • Loading branch information
kinow committed Oct 8, 2015
1 parent 79809a3 commit 826be90
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/main/java/org/tap4j/plugin/TapResult.java
Expand Up @@ -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;
Expand Down Expand Up @@ -161,6 +162,7 @@ public void tally() {
skipped = 0;
bailOuts = 0;
total = 0;
duration = 0.0f;

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

Expand Down Expand Up @@ -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();
Expand Down
10 changes: 8 additions & 2 deletions src/main/java/org/tap4j/plugin/model/TapStreamResult.java
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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) {
Expand All @@ -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);
Expand Down

0 comments on commit 826be90

Please sign in to comment.