Skip to content
Permalink
Browse files

Merge pull request #34 from jglick/stash-JENKINS-26942

[JENKINS-26942] Update acceptance test to use stashes
  • Loading branch information
jglick committed Oct 2, 2015
2 parents aac7425 + 6363cf3 commit 14b934c1c52bb7ce01df94dafc5c227280d25d14
Showing with 7 additions and 6 deletions.
  1. +7 −6 src/test/java/plugins/WorkflowPluginTest.java
@@ -44,11 +44,11 @@
/**
* Roughly follows <a href="https://github.com/jenkinsci/workflow-plugin/blob/master/TUTORIAL.md">the tutorial</a>.
*/
@WithPlugins("workflow-aggregator@1.1")
public class WorkflowPluginTest extends AbstractJUnitTest {

@Inject private SlaveController slaveController;

@WithPlugins("workflow-aggregator@1.1")
@Test public void helloWorld() throws Exception {
WorkflowJob job = jenkins.jobs.create(WorkflowJob.class);
job.script.set("echo 'hello from Workflow'");
@@ -57,7 +57,7 @@
job.startBuild().shouldSucceed().shouldContainsConsoleOutput("hello from Workflow");
}

@WithPlugins({"junit@1.3", "git@2.3"})
@WithPlugins({"workflow-aggregator@1.1", "junit@1.3", "git@2.3"})
@Test public void linearFlow() throws Exception {
MavenInstallation.installMaven(jenkins, "M3", "3.1.0");
final DumbSlave slave = (DumbSlave) slaveController.install(jenkins).get();
@@ -107,7 +107,7 @@
assertThat(driver, hasContent("All Tests"));
}

@WithPlugins({"parallel-test-executor@1.6", "junit@1.3", "git@2.3"})
@WithPlugins({"workflow-aggregator@1.10", "parallel-test-executor@1.6", "junit@1.3", "git@2.3", "script-security@1.15"})
@Native("mvn")
@Test public void parallelTests() throws Exception {
for (int i = 0; i < 3; i++) {
@@ -116,8 +116,9 @@
WorkflowJob job = jenkins.jobs.create(WorkflowJob.class);
job.script.set(
"node('master') {\n" +
// TODO could be switched to multibranch, in which case this initial `node` is unnecessary, and each branch can just `checkout scm`
" git url: 'https://github.com/jenkinsci/parallel-test-executor-plugin-sample.git'\n" +
" archive 'pom.xml, src/'\n" +
" stash 'sources'\n" +
"}\n" +
"def splits = splitTests([$class: 'CountDrivenParallelism', size: 3])\n" +
"def branches = [:]\n" +
@@ -126,7 +127,7 @@
" branches[\"split${i}\"] = {\n" +
" node('!master') {\n" +
" sh 'rm -rf *'\n" +
" unarchive mapping: ['pom.xml' : '.', 'src/' : '.']\n" +
" unstash 'sources'\n" +
" writeFile file: 'exclusions.txt', text: exclusions.join(\"\\n\")\n" +
// Do not bother with ${tool 'M3'}; would take too long to unpack Maven on all slaves.
// TODO would be useful for ToolInstallation to support the URL installer, hosting the tool ZIP ourselves somewhere cached.
@@ -136,7 +137,7 @@
" }\n" +
"}\n" +
"parallel branches");
// TODO add "script-security@1.15" to @WithPlugins when released and: job.sandbox.check();
job.sandbox.check();
job.save();
Build build = job.startBuild();
try {

0 comments on commit 14b934c

Please sign in to comment.
You can’t perform that action at this time.