Skip to content

Commit

Permalink
Made it possible to configure a test result trend graph for aggregate…
Browse files Browse the repository at this point in the history
…d tests, fixes zeroturnaround#12
  • Loading branch information
Tõnis Pool committed Aug 30, 2015
1 parent 4c0cc0c commit 015169c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.zeroturnaround.jenkins.flowbuildtestaggregator;

import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
import java.util.concurrent.ExecutionException;

import com.tikal.jenkins.plugins.multijob.MultiJobBuild;
Expand All @@ -10,7 +12,9 @@
import hudson.maven.MavenModuleSetBuild;
import hudson.maven.reporters.SurefireAggregatedReport;
import hudson.model.AbstractProject;
import hudson.model.Action;
import hudson.model.Run;
import hudson.tasks.test.TestResultProjectAction;
import jenkins.model.Jenkins;

import org.kohsuke.stapler.DataBoundConstructor;
Expand All @@ -32,13 +36,23 @@

public class FlowTestAggregator extends Recorder {

public final boolean showTestResultTrend;

@DataBoundConstructor
public FlowTestAggregator() {}
public FlowTestAggregator(boolean showTestResultTrend) {
this.showTestResultTrend = showTestResultTrend;
}

public BuildStepMonitor getRequiredMonitorService() {
return BuildStepMonitor.NONE;
}

@Override
public Collection<? extends Action> getProjectActions(AbstractProject<?, ?> project) {
if (showTestResultTrend) return Collections.<Action>singleton(new TestResultProjectAction(project));
return Collections.emptyList();
}

@Override
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
FlowRun flowRun = (FlowRun) build;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form">
<f:entry title="">
<f:checkbox title="${%Show test result trend graph for aggregated test results}" default="true" value="${instance.showTestResultTrend}" field="showTestResultTrend" />
</f:entry>
</j:jelly>

0 comments on commit 015169c

Please sign in to comment.