File otherWc = tmp.newFolder();
run(otherWc, "svn", "co", otherRepoU, ".");
FileUtils.touch(new File(otherWc, "otherfile"));
run(otherWc, "svn", "add", "otherfile");
run(otherWc, "svn", "commit", "--message=init");
WorkflowJob p = r.jenkins.createProject(WorkflowJob.class, "demo");
p.addTrigger(new SCMTrigger(""));
p.setQuietPeriod(3); // so it only does one build
p.setDefinition(new CpsFlowDefinition(
"node {\n" +
" ws {\n" +
" dir('main') {\n" +
" svn(url: '" + sampleRepoU + "')\n" +
" }\n" +
" dir('other') {\n" +
" svn(url: '" + otherRepoU + "')\n" +
" }\n" +
" sh 'for f in */*; do echo PRESENT: $f; done'\n" +
" }\n" +
"}"));
WorkflowRun b = r.assertBuildStatusSuccess(p.scheduleBuild2(0));
r.assertLogContains("PRESENT: main/file", b);
r.assertLogContains("PRESENT: other/otherfile", b);
FileUtils.touch(new File(sampleWc, "file2"));
run(sampleWc, "svn", "add", "file2");
run(sampleWc, "svn", "commit", "--message=+file2");
FileUtils.touch(new File(otherWc, "otherfile2"));
run(otherWc, "svn", "add", "otherfile2");
run(otherWc, "svn", "commit", "--message=+otherfile2");
notifyCommit(uuid(sampleRepoU), "file2");
notifyCommit(uuid(otherRepoU), "otherfile2");
r.waitUntilNoActivity();
b = p.getLastBuild();
assertEquals(2, b.number);
r.assertLogContains("PRESENT: main/file2", b);
r.assertLogContains("PRESENT: other/otherfile2", b);
Iterator<? extends SCM> scms = p.getSCMs().iterator();
assertTrue(scms.hasNext());
assertEquals(sampleRepoU, ((SubversionSCM) scms.next()).getLocations()[0].getURL());
assertTrue(scms.hasNext());
assertEquals(otherRepoU, ((SubversionSCM) scms.next()).getLocations()[0].getURL());
assertFalse(scms.hasNext());