File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
src/test/java/org/jenkinsci/plugins/workflow/cps Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -589,10 +589,24 @@ public void evaluate() throws Throwable {
589589 story .addStep (new Statement () {
590590 @ Override
591591 public void evaluate () throws Throwable {
592+ if (logging .getMessages ().stream ().anyMatch (msg -> msg .contains ("could not load" ) && msg .contains ("jobs/durableAgainstClean/builds/1" ))){
593+ log .warning ("Found a message in LoggerRule - trying to log the build.xml" );
594+ File buildXml = new File (story .j .jenkins .getRootDir () + "/jobs/durableAgainstClean/builds/1/build.xml" );
595+ BufferedReader in = new BufferedReader (new FileReader (buildXml ));
596+ String line = in .readLine ();
597+ while (line != null )
598+ {
599+ log .warning (line );
600+ line = in .readLine ();
601+ }
602+ in .close ();
603+ log .warning ("Done logging the build.xml" );
604+ }
592605 WorkflowRun run = story .j .jenkins .getItemByFullName ("durableAgainstClean" , WorkflowJob .class ).getLastBuild ();
593606 try {
594607 verifyFailedCleanly (story .j .jenkins , run );
595608 } catch (NullPointerException e ) {
609+ log .warning ("Caught NPE - trying to log the build.xml" );
596610 File buildXml = new File (story .j .jenkins .getRootDir () + "/jobs/durableAgainstClean/builds/1/build.xml" );
597611 BufferedReader in = new BufferedReader (new FileReader (buildXml ));
598612 String line = in .readLine ();
@@ -602,6 +616,7 @@ public void evaluate() throws Throwable {
602616 line = in .readLine ();
603617 }
604618 in .close ();
619+ log .warning ("Done logging the build.xml" );
605620 throw e ;
606621 }
607622 story .j .assertLogContains (logStart [0 ], run );
You can’t perform that action at this time.
0 commit comments