Skip to content

Commit 58f2591

Browse files
committed
SCMSourceRetrieverTest: checkDefaultVersion(): also test non-checkout of an absent libname@bogusbranch
1 parent 925cf30 commit 58f2591

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/test/java/org/jenkinsci/plugins/workflow/libs/SCMSourceRetrieverTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,14 @@ public class SCMSourceRetrieverTest {
259259
WorkflowRun b3 = r.buildAndAssertSuccess(p3);
260260
r.assertLogContains("something special", b3);
261261

262+
// Use a specified but missing branch
263+
WorkflowJob p4 = r.jenkins.createProject(WorkflowJob.class, "p4");
264+
p4.setDefinition(new CpsFlowDefinition("@Library('branchylib@bogus') import myecho; myecho()", true));
265+
WorkflowRun b4 = r.buildAndAssertStatus(Result.FAILURE, p4);
266+
r.assertLogContains("ERROR: No version bogus found for library branchylib", b4);
267+
r.assertLogContains("org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:", b4);
268+
r.assertLogContains("WorkflowScript: Loading libraries failed", b4);
269+
262270
// TODO: create a job instantiated from Git (or fooled into
263271
// thinking it is - injecting BRANCH_NAME envvar via Java)
264272
// and check behaviors with BRANCH_NAME="master",

0 commit comments

Comments
 (0)