diff --git a/src/test/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/KubernetesPipelineTest.java b/src/test/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/KubernetesPipelineTest.java index f3cd1d684a..919a831b05 100644 --- a/src/test/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/KubernetesPipelineTest.java +++ b/src/test/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/KubernetesPipelineTest.java @@ -67,6 +67,8 @@ public void runInPod() throws Exception { WorkflowJob p = r.jenkins.createProject(WorkflowJob.class, "p"); p.setDefinition(new CpsFlowDefinition(loadPipelineScript("runInPod.groovy"), true)); + + logs.capture(1000); WorkflowRun b = p.scheduleBuild2(0).waitForStart(); assertNotNull(b); @@ -78,7 +80,7 @@ public void runInPod() throws Exception { LOGGER.log(Level.INFO, "Found templates with label runInPod: {0}", templates); for (PodTemplate template : cloud.getAllTemplates()) { LOGGER.log(Level.INFO, "Cloud template \"{0}\" labels: {1}", - new Object[] { template.getName(), template.getLabelsMap() }); + new Object[] { template.getName(), template.getLabelSet() }); } Map labels = getLabels(cloud, this); @@ -89,6 +91,10 @@ public void runInPod() throws Exception { Thread.sleep(1000); } + for (String msg : logs.getMessages()) { + System.out.println(msg); + } + assertThat(templates, hasSize(1)); PodTemplate template = templates.get(0); assertEquals(Integer.MAX_VALUE, template.getInstanceCap());