put podlogs into folder with taskName to support parallel jenkins unit and integration test run (#5759)

This commit is contained in:
Stefano Franz 2019-11-26 13:05:02 +00:00 committed by GitHub
parent 16eb2fce78
commit d604820de9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,7 +11,6 @@ import io.fabric8.kubernetes.api.model.Quantity;
import io.fabric8.kubernetes.api.model.Status;
import io.fabric8.kubernetes.api.model.StatusCause;
import io.fabric8.kubernetes.api.model.StatusDetails;
import io.fabric8.kubernetes.api.model.Toleration;
import io.fabric8.kubernetes.api.model.TolerationBuilder;
import io.fabric8.kubernetes.client.DefaultKubernetesClient;
import io.fabric8.kubernetes.client.KubernetesClient;
@ -424,7 +423,9 @@ public class KubesTest extends DefaultTask {
private File startLogPumping(InputStream stdOutIs, int podIdx, File podLogsDirectory, boolean printOutput) throws IOException {
File outputFile = new File(podLogsDirectory, "container-" + podIdx + ".log");
File outputDir = new File(podLogsDirectory, taskToExecuteName);
outputDir.mkdirs();
File outputFile = new File(outputDir, "container-" + podIdx + ".log");
outputFile.createNewFile();
Thread loggingThread = new Thread(() -> {
try (BufferedWriter out = new BufferedWriter(new FileWriter(outputFile, true));