Skip to content

Commit a2c517b

Browse files
authored
Print container logs even on success (#3948)
1 parent 7d26b4d commit a2c517b

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

smoke-tests/framework/src/main/java/com/microsoft/applicationinsights/smoketest/SmokeTestExtension.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -194,15 +194,6 @@ private void beforeAllInternal(ExtensionContext context) throws Exception {
194194
prepareEnvironment(environment);
195195
}
196196

197-
@Override
198-
public void testFailed(ExtensionContext context, Throwable cause) {
199-
if (targetContainer != null) {
200-
System.out.println("Test failure detected.");
201-
System.out.println("Container logs:");
202-
System.out.println(targetContainer.getLogs());
203-
}
204-
}
205-
206197
private void prepareEnvironment(Environment environment) throws Exception {
207198
System.out.println("Preparing environment...");
208199
currentEnvironment = environment.value();
@@ -529,6 +520,11 @@ public void afterEach(ExtensionContext context) {
529520
@Override
530521
public void afterAll(ExtensionContext context) throws Exception {
531522
if (allContainers != null) {
523+
if (targetContainer != null) {
524+
System.out.println("Test failure detected.");
525+
System.out.println("Container logs:");
526+
System.out.println(targetContainer.getLogs());
527+
}
532528
System.out.println("Stopping containers...");
533529
for (GenericContainer<?> container : allContainers) {
534530
container.stop();

0 commit comments

Comments
 (0)