Skip to content

Commit

Permalink
Merge #5895
Browse files Browse the repository at this point in the history
5895: [Backport stable/0.25] Show container logs on update test failure r=MiguelPires a=github-actions[bot]

# Description
Backport of #5872 to `stable/0.25`.

Co-authored-by: Nicolas Pépin-Perreault <nicolas.pepin-perreault@camunda.com>
  • Loading branch information
zeebe-bors[bot] and npepinpe authored Nov 23, 2020
2 parents 4d0928f + 54f77d2 commit 485434a
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
import org.junit.jupiter.api.extension.AfterTestExecutionCallback;
import org.junit.jupiter.api.extension.BeforeTestExecutionCallback;
import org.junit.jupiter.api.extension.ExtensionContext;
import org.junit.jupiter.api.extension.TestWatcher;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ContainerStateExtension
implements BeforeTestExecutionCallback, AfterTestExecutionCallback, TestWatcher {
implements BeforeTestExecutionCallback, AfterTestExecutionCallback {
private static final Logger LOG = LoggerFactory.getLogger(ContainerStateExtension.class);

private final ContainerState state;
Expand All @@ -25,13 +24,13 @@ public ContainerStateExtension(final ContainerState state) {
this.state = state;
}

@Override
public void testFailed(final ExtensionContext context, final Throwable cause) {
state.onFailure();
}

@Override
public void afterTestExecution(final ExtensionContext context) {
final boolean hasFailed = context.getExecutionException().isPresent();
if (hasFailed) {
state.onFailure();
}

try {
state.close();
} catch (final Exception e) {
Expand Down

0 comments on commit 485434a

Please sign in to comment.