Skip to content
Permalink
Browse files
Merge pull request #1 from jglick/1.580
[FIXED JENKINS-25446] Make this runnable against 1.580.x
  • Loading branch information
seriousamlqz committed Mar 25, 2015
2 parents 9ad1897 + cb12c52 commit c68997a67353d2b62ae3ab32fb2de89de64c2620
@@ -20,13 +20,13 @@ limitations under the License.
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>1.568</version><!-- which version of Jenkins is this plugin built against? Users must have at least this Jenkins version to use this plugin. -->
<version>1.580.1</version>
</parent>

<artifactId>flaky-test-handler</artifactId>
<name>Flaky Test Handler plugin</name>
<description>Display rerun flaky tests</description>
<version>1.0.1</version>
<version>1.1-SNAPSHOT</version>
<packaging>hpi</packaging>
<url>https://wiki.jenkins-ci.org/display/JENKINS/Flaky+Test+Handler+Plugin</url>

@@ -76,6 +76,11 @@ limitations under the License.
<groupId>jfree</groupId>
<artifactId>jfreechart</artifactId>
<version>1.0.13</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>junit</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
@@ -75,7 +75,8 @@
*/
public FlakyTestResultAction(AbstractBuild build, BuildListener listener) {
this.build = build;
AbstractTestResultAction action = build.getTestResultAction();
// TODO consider the possibility that there is >1 such action
AbstractTestResultAction action = build.getAction(AbstractTestResultAction.class);
if (action != null) {
Object latestResult = action.getResult();
if (latestResult != null && latestResult instanceof TestResult) {
@@ -28,6 +28,7 @@
import hudson.tasks.junit.TestDataPublisher;
import hudson.tasks.junit.TestResult;
import hudson.tasks.junit.TestResultAction;
import hudson.tasks.test.AbstractTestResultAction;

/**
* Publisher for publishing rerun information
@@ -46,7 +47,8 @@ public JUnitFlakyTestDataPublisher() {
BuildListener buildListener, TestResult testResult)
throws IOException, InterruptedException {
FlakyTestResult flakyTestResult = new FlakyTestResult(testResult);
flakyTestResult.freeze(abstractBuild.getTestResultAction(), abstractBuild);
// TODO consider the possibility that there is >1 such action
flakyTestResult.freeze(abstractBuild.getAction(AbstractTestResultAction.class), abstractBuild);
return new JUnitFlakyTestData(flakyTestResult);
}

@@ -50,6 +50,7 @@ public DeflakeListener() {
// Add deflake action to the build and aggregate test running stats from this build
@Override
public void onCompleted(AbstractBuild build, TaskListener listener) {
// TODO consider the possibility that there is >1 such action
TestResultAction testResultAction = build.getAction(TestResultAction.class);

HistoryAggregatedFlakyTestResultAction historyAction = build.getProject()
@@ -45,6 +45,7 @@
import hudson.remoting.VirtualChannel;
import hudson.slaves.EnvironmentVariablesNodeProperty;
import hudson.util.StreamTaskListener;
import jenkins.MasterToSlaveFileCallable;


/**
@@ -227,7 +228,7 @@ protected void setVariables(Node node, EnvironmentVariablesNodeProperty.Entry...
}

protected String getHeadRevision(AbstractBuild build, final String branch) throws IOException, InterruptedException {
return build.getWorkspace().act(new FilePath.FileCallable<String>() {
return build.getWorkspace().act(new MasterToSlaveFileCallable<String>() {
public String invoke(File f, VirtualChannel channel) throws IOException, InterruptedException {
try {
ObjectId oid = Git.with(null, null).in(f).getClient().getRepository().resolve("refs/heads/" + branch);

0 comments on commit c68997a

Please sign in to comment.