|
5 | 5 | import static java.util.Objects.requireNonNull; |
6 | 6 | import static org.hiero.otter.fixtures.container.utils.ContainerConstants.CONTAINER_APP_WORKING_DIR; |
7 | 7 | import static org.hiero.otter.fixtures.container.utils.ContainerConstants.CONTAINER_CONTROL_PORT; |
| 8 | +import static org.hiero.otter.fixtures.container.utils.ContainerConstants.HASHSTREAM_LOG_PATH; |
| 9 | +import static org.hiero.otter.fixtures.container.utils.ContainerConstants.METRICS_PATH; |
8 | 10 | import static org.hiero.otter.fixtures.container.utils.ContainerConstants.NODE_COMMUNICATION_PORT; |
| 11 | +import static org.hiero.otter.fixtures.container.utils.ContainerConstants.SWIRLDS_LOG_PATH; |
9 | 12 | import static org.hiero.otter.fixtures.internal.AbstractNetwork.NODE_IDENTIFIER_FORMAT; |
10 | 13 | import static org.hiero.otter.fixtures.internal.AbstractNode.LifeCycle.DESTROYED; |
11 | 14 | import static org.hiero.otter.fixtures.internal.AbstractNode.LifeCycle.INIT; |
@@ -372,17 +375,21 @@ public SingleNodeMarkerFileResult newMarkerFileResult() { |
372 | 375 | void destroy() { |
373 | 376 | try { |
374 | 377 | // copy logs from container to the local filesystem |
375 | | - final Path logPath = Path.of("build", "container", NODE_IDENTIFIER_FORMAT.formatted(selfId.id()), "output"); |
376 | | - Files.createDirectories(logPath.resolve("swirlds-hashstream")); |
| 378 | + final Path outputPath = Path.of("build", "container", NODE_IDENTIFIER_FORMAT.formatted(selfId.id())); |
| 379 | + Files.createDirectories(outputPath.resolve("output/swirlds-hashstream")); |
| 380 | + Files.createDirectories(outputPath.resolve("data/stats")); |
377 | 381 |
|
378 | 382 | container.copyFileFromContainer( |
379 | | - CONTAINER_APP_WORKING_DIR + "/output/swirlds.log", |
380 | | - logPath.resolve("swirlds.log").toString()); |
| 383 | + CONTAINER_APP_WORKING_DIR + SWIRLDS_LOG_PATH, |
| 384 | + outputPath.resolve(SWIRLDS_LOG_PATH).toString()); |
381 | 385 | container.copyFileFromContainer( |
382 | | - CONTAINER_APP_WORKING_DIR + "/output/swirlds-hashstream/swirlds-hashstream.log", |
383 | | - logPath.resolve("swirlds-hashstream/swirlds-hashstream.log").toString()); |
| 386 | + CONTAINER_APP_WORKING_DIR + HASHSTREAM_LOG_PATH, |
| 387 | + outputPath.resolve(HASHSTREAM_LOG_PATH).toString()); |
| 388 | + container.copyFileFromContainer( |
| 389 | + CONTAINER_APP_WORKING_DIR + METRICS_PATH.formatted(selfId.id()), |
| 390 | + outputPath.resolve(METRICS_PATH.formatted(selfId.id())).toString()); |
384 | 391 | } catch (final IOException e) { |
385 | | - throw new UncheckedIOException("Failed to copy logs from container", e); |
| 392 | + throw new UncheckedIOException("Failed to copy files from container", e); |
386 | 393 | } |
387 | 394 |
|
388 | 395 | if (lifeCycle == RUNNING) { |
|
0 commit comments