Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions src/main/java/org/tap4j/plugin/TapTestResultAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import hudson.model.HealthReportingAction;
import hudson.model.Job;
import hudson.model.Run;
import hudson.tasks.test.AbstractTestResultAction;
import jenkins.model.RunAction2;
import jenkins.tasks.SimpleBuildStep;
import jenkins.util.NonLocalizable;
Expand All @@ -44,13 +45,9 @@
/**
* @since 0.1
*/
public class TapTestResultAction
public class TapTestResultAction extends AbstractTestResultAction<TapTestResultAction>
implements StaplerProxy, SimpleBuildStep.LastBuildAction, HealthReportingAction, RunAction2 {

public transient Run<?, ?> run;
@Deprecated
public transient AbstractBuild<?, ?> owner;

private TapResult tapResult;

protected TapTestResultAction(Run<?, ?> r, TapResult tapResult) {
Expand All @@ -59,6 +56,13 @@
this.tapResult = tapResult;
}

/**
* @return the current Run to support new JUnit
*/
public Run<?, ?> getObject() {
return run;

Check warning on line 63 in src/main/java/org/tap4j/plugin/TapTestResultAction.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 63 is not covered by tests
}

/**
* @return the tapResult
*/
Expand Down Expand Up @@ -99,7 +103,7 @@
}

public TapStreamResult getResult() {
return new TapStreamResult(owner, tapResult);
return new TapStreamResult(owner, tapResult, this);
}

/* (non-Javadoc)
Expand Down
15 changes: 14 additions & 1 deletion src/main/java/org/tap4j/plugin/model/TapStreamResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import hudson.model.Run;
import hudson.tasks.junit.CaseResult;
import hudson.tasks.test.AbstractTestResultAction;
import hudson.tasks.test.TabulatedResult;
import hudson.tasks.test.TestObject;
import hudson.tasks.test.TestResult;
Expand All @@ -33,6 +34,7 @@
import org.kohsuke.stapler.export.Exported;
import org.tap4j.model.TestSet;
import org.tap4j.plugin.TapResult;
import org.tap4j.plugin.TapTestResultAction;
import org.tap4j.util.StatusValues;

import javax.annotation.Nullable;
Expand All @@ -50,12 +52,14 @@

private static final long serialVersionUID = 8337146933697574082L;
private final transient Run<?, ?> owner;
private final transient AbstractTestResultAction tapTestResultAction;
private List<TestResult> children = new ArrayList<>();
private TapResult tapResult;

public TapStreamResult(Run<?, ?> owner, TapResult tapResult) {
public TapStreamResult(Run<?, ?> owner, TapResult tapResult, AbstractTestResultAction tapTestResultAction) {
this.owner = owner;
this.tapResult = tapResult;
this.tapTestResultAction = tapTestResultAction;
setChildrenInfo();
}

Expand All @@ -75,6 +79,15 @@
return owner;
}

public String getTitle() {
return getDisplayName();
}

@Override
public AbstractTestResultAction getParentAction() {
return tapTestResultAction;

Check warning on line 88 in src/main/java/org/tap4j/plugin/model/TapStreamResult.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 88 is not covered by tests
}

/* (non-Javadoc)
* @see hudson.tasks.test.TestObject#getParent()
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
TestSetMap subTest = new TestSetMap(testSetMap.getFileName(), testSet);
List<TestSetMap> list = new ArrayList<>();
list.add(subTest);
parent = new TapStreamResult(owner, new TapResult("TAP Test Results", owner, list, todoIsFailure, includeCommentDiagnostics, validateNumberOfTests));
parent = new TapStreamResult(owner, new TapResult("TAP Test Results", owner, list, todoIsFailure, includeCommentDiagnostics, validateNumberOfTests), getTestResultAction());

Check warning on line 109 in src/main/java/org/tap4j/plugin/model/TapTestResultResult.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 109 is not covered by tests
}
return parent;
}
Expand Down
Loading