Skip to content
Open
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@
import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.model.AutoCompletionCandidates;
import hudson.EnvVars;
import hudson.Extension;
import hudson.Launcher;
import hudson.Util;
import static hudson.Util.fixNull;
import hudson.model.Action;
import hudson.model.BuildListener;
import hudson.model.DependencyGraph;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't need this, sorry. I will remove it and the excess new lines added below

import hudson.model.Fingerprint.RangeSet;
import hudson.model.InvisibleAction;
import hudson.model.ItemGroup;
Expand All @@ -51,6 +53,7 @@
import hudson.tasks.Recorder;
import hudson.util.FormValidation;
import net.sf.json.JSONObject;

import org.kohsuke.stapler.AncestorInPath;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.StaplerRequest;
Expand All @@ -60,7 +63,9 @@
import java.util.Collection;
import java.util.Collections;
import java.util.List;

import javax.annotation.CheckForNull;

import org.acegisecurity.AccessDeniedException;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
Expand Down Expand Up @@ -95,9 +100,20 @@ public AggregatedTestResultPublisher(String jobs, boolean includeFailedBuilds) {

public boolean perform(AbstractBuild<?,?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
// add a TestResult just so that it can show up later.
build.addAction(new TestResultAction(jobs, includeFailedBuilds, build));
// Expand the jobs String as it can contain variable
String expandedJobs = this.getJobs(build.getEnvironment(listener));
build.addAction(new TestResultAction(expandedJobs, includeFailedBuilds, build));
return true;
}

/**
* Return the expanded job list
* @param env
* @return
*/
public String getJobs(EnvVars env) {
return (env != null ? env.expand(this.jobs) : this.jobs);
}

public BuildStepMonitor getRequiredMonitorService() {
return BuildStepMonitor.NONE;
Expand Down