Skip to content
Permalink
Browse files

[JENKINS-26942] Update acceptance test to use stashes.

  • Loading branch information
jglick committed Aug 20, 2015
1 parent 935342b commit 17444bde0577af7485ae2003a9d96c5c97da93bd
Showing with 6 additions and 5 deletions.
  1. +6 −5 src/test/java/plugins/WorkflowPluginTest.java
@@ -43,7 +43,7 @@
/**
* Roughly follows <a href="https://github.com/jenkinsci/workflow-plugin/blob/master/TUTORIAL.md">the tutorial</a>.
*/
@WithPlugins("workflow-aggregator@1.1")
@WithPlugins("workflow-aggregator@1.10-SNAPSHOT") // TODO 1.10 when https://github.com/jenkinsci/workflow-plugin/pull/186 is released
public class WorkflowPluginTest extends AbstractJUnitTest {

@Inject private SlaveController slaveController;
@@ -103,7 +103,7 @@
assertThat(driver, hasContent("All Tests"));
}

@WithPlugins({"parallel-test-executor@1.6", "junit@1.3", "git@2.3"})
@WithPlugins({"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++) {
@@ -112,8 +112,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" +
@@ -122,7 +123,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.
@@ -132,7 +133,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 17444bd

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