Skip to content
Permalink
Browse files

Merge pull request #33 from jglick/encoded-workspace-names-JENKINS-34564

[JENKINS-34564] Adjusted integration test to match modified behavior
  • Loading branch information
jglick committed Sep 23, 2016
2 parents 34c7574 + 62b0925 commit dba7f3b9732ecf01b8a6e99f6ac10826394edd55
@@ -84,7 +84,7 @@ THE SOFTWARE.
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>branch-api</artifactId>
<version>1.11-SNAPSHOT</version>
<version>1.11</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
@@ -215,6 +215,12 @@ THE SOFTWARE.
<version>1.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>credentials</artifactId>
<version>2.1.4</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
@@ -25,9 +25,7 @@
package org.jenkinsci.plugins.workflow.multibranch;

import java.io.File;
import jenkins.branch.BranchProperty;
import jenkins.branch.BranchSource;
import jenkins.branch.DefaultBranchPropertyStrategy;
import jenkins.plugins.git.GitSCMSource;
import jenkins.plugins.git.GitSampleRepoRule;
import org.jenkinsci.plugins.workflow.job.WorkflowJob;
@@ -64,14 +62,14 @@
sampleRepo.git("add", "Jenkinsfile");
sampleRepo.git("commit", "--all", "--message=flow");
WorkflowMultiBranchProject mp = story.j.jenkins.createProject(WorkflowMultiBranchProject.class, "p");
mp.getSourcesList().add(new BranchSource(new GitSCMSource(null, sampleRepo.toString(), "", "*", "", false), new DefaultBranchPropertyStrategy(new BranchProperty[0])));
mp.getSourcesList().add(new BranchSource(new GitSCMSource(null, sampleRepo.toString(), "", "*", "", false)));
WorkflowJob p = scheduleAndFindBranchProject(mp, "dev%2Fmain");
assertEquals(1, mp.getItems().size());
story.j.waitUntilNoActivity();
WorkflowRun b1 = p.getLastBuild();
assertEquals(1, b1.getNumber());
story.j.assertLogContains("branch=dev/main", b1);
story.j.assertLogContains("workspace=dev%2Fmain", b1);
story.j.assertLogContains("workspace=dev_main-ZFNHWJSHKH4HUVOQUPOQV6WFX7XUPIKIAQAQ3DV7CCAGIXQW7YSA", b1);
verifyProject(p);
sampleRepo.write("Jenkinsfile", script.replace("branch=", "Branch="));
}
@@ -85,7 +83,7 @@
WorkflowRun b2 = p.getLastBuild();
assertEquals(2, b2.getNumber());
story.j.assertLogContains("Branch=dev/main", b2);
story.j.assertLogContains("workspace=dev%2Fmain", b2);
story.j.assertLogContains("workspace=dev_main-ZFNHWJSHKH4HUVOQUPOQV6WFX7XUPIKIAQAQ3DV7CCAGIXQW7YSA", b2);
verifyProject(p);
}
});

0 comments on commit dba7f3b

Please sign in to comment.