mirror of
https://github.com/corda/corda.git
synced 2024-12-19 21:17:58 +00:00
add pod index to container output message to make it easier to find in artifacts
This commit is contained in:
parent
2dab35c362
commit
718b7abb2f
@ -257,7 +257,7 @@ public class KubesTest extends DefaultTask {
|
||||
client.pods().delete(createdPod);
|
||||
client.persistentVolumeClaims().delete(pvc);
|
||||
}
|
||||
return new KubePodResult(resCode, podOutput, binaryResults);
|
||||
return new KubePodResult(podIdx, resCode, podOutput, binaryResults);
|
||||
});
|
||||
} catch (Retry.RetryException e) {
|
||||
throw new RuntimeException("Failed to build in pod " + podName + " (" + podIdx + "/" + numberOfPods + ") in " + numberOfRetries + " attempts", e);
|
||||
|
@ -5,11 +5,13 @@ import java.util.Collection;
|
||||
|
||||
public class KubePodResult {
|
||||
|
||||
private final int podIndex;
|
||||
private final int resultCode;
|
||||
private final File output;
|
||||
private final Collection<File> binaryResults;
|
||||
|
||||
public KubePodResult(int resultCode, File output, Collection<File> binaryResults) {
|
||||
public KubePodResult(int podIndex, int resultCode, File output, Collection<File> binaryResults) {
|
||||
this.podIndex = podIndex;
|
||||
this.resultCode = resultCode;
|
||||
this.output = output;
|
||||
this.binaryResults = binaryResults;
|
||||
@ -26,4 +28,8 @@ public class KubePodResult {
|
||||
public Collection<File> getBinaryResults() {
|
||||
return binaryResults;
|
||||
}
|
||||
|
||||
public int getPodIndex() {
|
||||
return podIndex;
|
||||
}
|
||||
}
|
||||
|
@ -151,12 +151,12 @@ public class KubesReporting extends DefaultTask {
|
||||
|
||||
if (!containersWithNonZeroReturnCodes.isEmpty()) {
|
||||
String reportUrl = new ConsoleRenderer().asClickableFileUrl(new File(destinationDir, "index.html"));
|
||||
if (shouldPrintOutput){
|
||||
if (shouldPrintOutput) {
|
||||
containersWithNonZeroReturnCodes.forEach(podResult -> {
|
||||
try {
|
||||
System.out.println("\n##### CONTAINER OUTPUT START #####");
|
||||
System.out.println("\n##### CONTAINER " + podResult.getPodIndex() + " OUTPUT START #####");
|
||||
IOUtils.copy(new FileInputStream(podResult.getOutput()), System.out);
|
||||
System.out.println("##### CONTAINER OUTPUT END #####\n");
|
||||
System.out.println("##### CONTAINER " + podResult.getPodIndex() + " OUTPUT END #####\n");
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user