@Issue("JENKINS-42473")
@Test
public void folderLibraryParsing() throws Exception {
otherRepo.init();
otherRepo.git("checkout", "-b", "test");
otherRepo.write("src/org/foo/Zot.groovy", "package org.foo;\n" +
"\n" +
"def echo(msg) {\n" +
" echo \"-> ${msg}\"\n" +
"}\n");
otherRepo.git("add", "src");
otherRepo.git("commit", "--message=init");
Folder folder = j.jenkins.createProject(Folder.class, "testFolder");
LibraryConfiguration echoLib = new LibraryConfiguration("zot-stuff",
new SCMSourceRetriever(new GitSCMSource(null, otherRepo.toString(), "", "*", "", true)));
folder.getProperties().add(new FolderLibraries(Collections.singletonList(echoLib)));
WorkflowRun firstRun = expect("folderLibraryParsing")
.inFolder(folder)
.logContains("Hello world")
.go();
WorkflowRun secondRun = j.buildAndAssertSuccess(firstRun.getParent());
ExecutionModelAction action = secondRun.getAction(ExecutionModelAction.class);
assertNotNull(action);
ModelASTStages stages = action.getStages();
assertNull(stages.getSourceLocation());
assertNotNull(stages);
}