Search in sources :

Example 1 with KubernetesClusterUnstableException

use of io.strimzi.systemtest.exceptions.KubernetesClusterUnstableException in project strimzi by strimzi.

the class TestExecutionWatcher method handleTestExecutionException.

@Override
public void handleTestExecutionException(ExtensionContext extensionContext, Throwable throwable) throws Throwable {
    LOGGER.error("{} - Exception {} has been thrown in @Test. Going to collect logs from components.", extensionContext.getRequiredTestClass().getSimpleName(), throwable.getMessage());
    if (!(throwable instanceof TestAbortedException || throwable instanceof KubernetesClusterUnstableException)) {
        final String testClass = extensionContext.getRequiredTestClass().getName();
        final String testMethod = extensionContext.getRequiredTestMethod().getName();
        collectLogs(extensionContext, new CollectorElement(testClass, testMethod));
    }
    throw throwable;
}
Also used : KubernetesClusterUnstableException(io.strimzi.systemtest.exceptions.KubernetesClusterUnstableException) TestAbortedException(org.opentest4j.TestAbortedException) CollectorElement(io.strimzi.test.logs.CollectorElement)

Example 2 with KubernetesClusterUnstableException

use of io.strimzi.systemtest.exceptions.KubernetesClusterUnstableException in project strimzi by strimzi.

the class TestExecutionWatcher method handleAfterEachMethodExecutionException.

@Override
public void handleAfterEachMethodExecutionException(ExtensionContext extensionContext, Throwable throwable) throws Throwable {
    LOGGER.error("{} - Exception {} has been thrown in @AfterEach. Going to collect logs from components.", extensionContext.getRequiredTestClass().getSimpleName(), throwable.getMessage());
    if (!(throwable instanceof KubernetesClusterUnstableException)) {
        final String testClass = extensionContext.getRequiredTestClass().getName();
        final String testMethod = extensionContext.getRequiredTestMethod().getName();
        collectLogs(extensionContext, new CollectorElement(testClass, testMethod));
    }
    throw throwable;
}
Also used : KubernetesClusterUnstableException(io.strimzi.systemtest.exceptions.KubernetesClusterUnstableException) CollectorElement(io.strimzi.test.logs.CollectorElement)

Example 3 with KubernetesClusterUnstableException

use of io.strimzi.systemtest.exceptions.KubernetesClusterUnstableException in project strimzi by strimzi.

the class TestExecutionWatcher method handleBeforeAllMethodExecutionException.

@Override
public void handleBeforeAllMethodExecutionException(ExtensionContext extensionContext, Throwable throwable) throws Throwable {
    LOGGER.error("{} - Exception {} has been thrown in @BeforeAll. Going to collect logs from components.", extensionContext.getRequiredTestClass().getSimpleName(), throwable.getMessage());
    if (!(throwable instanceof TestAbortedException || throwable instanceof KubernetesClusterUnstableException)) {
        final String testClass = extensionContext.getRequiredTestClass().getName();
        collectLogs(extensionContext, new CollectorElement(testClass));
    }
    throw throwable;
}
Also used : KubernetesClusterUnstableException(io.strimzi.systemtest.exceptions.KubernetesClusterUnstableException) TestAbortedException(org.opentest4j.TestAbortedException) CollectorElement(io.strimzi.test.logs.CollectorElement)

Example 4 with KubernetesClusterUnstableException

use of io.strimzi.systemtest.exceptions.KubernetesClusterUnstableException in project strimzi by strimzi.

the class TestExecutionWatcher method handleBeforeEachMethodExecutionException.

@Override
public void handleBeforeEachMethodExecutionException(ExtensionContext extensionContext, Throwable throwable) throws Throwable {
    LOGGER.error("{} - Exception {} has been thrown in @BeforeEach. Going to collect logs from components.", extensionContext.getRequiredTestClass().getSimpleName(), throwable.getMessage());
    if (!(throwable instanceof TestAbortedException || throwable instanceof KubernetesClusterUnstableException)) {
        final String testClass = extensionContext.getRequiredTestClass().getName();
        final String testMethod = extensionContext.getRequiredTestMethod().getName();
        collectLogs(extensionContext, new CollectorElement(testClass, testMethod));
    }
    throw throwable;
}
Also used : KubernetesClusterUnstableException(io.strimzi.systemtest.exceptions.KubernetesClusterUnstableException) TestAbortedException(org.opentest4j.TestAbortedException) CollectorElement(io.strimzi.test.logs.CollectorElement)

Example 5 with KubernetesClusterUnstableException

use of io.strimzi.systemtest.exceptions.KubernetesClusterUnstableException in project strimzi-kafka-operator by strimzi.

the class TestExecutionWatcher method handleBeforeAllMethodExecutionException.

@Override
public void handleBeforeAllMethodExecutionException(ExtensionContext extensionContext, Throwable throwable) throws Throwable {
    LOGGER.error("{} - Exception {} has been thrown in @BeforeAll. Going to collect logs from components.", extensionContext.getRequiredTestClass().getSimpleName(), throwable.getMessage());
    if (!(throwable instanceof TestAbortedException || throwable instanceof KubernetesClusterUnstableException)) {
        final String testClass = extensionContext.getRequiredTestClass().getName();
        collectLogs(extensionContext, new CollectorElement(testClass));
    }
    throw throwable;
}
Also used : KubernetesClusterUnstableException(io.strimzi.systemtest.exceptions.KubernetesClusterUnstableException) TestAbortedException(org.opentest4j.TestAbortedException) CollectorElement(io.strimzi.test.logs.CollectorElement)

Aggregations

KubernetesClusterUnstableException (io.strimzi.systemtest.exceptions.KubernetesClusterUnstableException)10 CollectorElement (io.strimzi.test.logs.CollectorElement)10 TestAbortedException (org.opentest4j.TestAbortedException)6 SuiteThreadController (io.strimzi.systemtest.parallel.SuiteThreadController)2