Skip to content

Commit

Permalink
Campture and print the cloud logs
Browse files Browse the repository at this point in the history
  • Loading branch information
carlossg committed Sep 4, 2018
1 parent dd90b8c commit 23a0fce
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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<String, String> labels = getLabels(cloud, this);
Expand All @@ -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());
Expand Down

0 comments on commit 23a0fce

Please sign in to comment.