Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

Commit

Permalink
Fix after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
kornys committed Jun 24, 2020
1 parent 67d58d1 commit efd90cf
Showing 1 changed file with 11 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
import io.enmasse.systemtest.operator.EnmasseOperatorManager;
import io.enmasse.systemtest.platform.Kubernetes;
import io.enmasse.systemtest.utils.AddressUtils;

import static io.enmasse.systemtest.condition.OpenShiftVersion.OCP4;

import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
Expand All @@ -48,27 +50,16 @@ class MonitoringTest extends TestBase implements ITestIsolatedStandard {
private MonitoringClient monitoring;

@BeforeAll
void installMonitoring() {
try { //TODO remove it after upgrade to surefire plugin 3.0.0-M5
EnmasseOperatorManager.getInstance().enableMonitoring();
Endpoint metricsEndpoint;
if (Kubernetes.isOpenShiftCompatible(OCP4) && !Kubernetes.isCRC()) {
metricsEndpoint = Kubernetes.getInstance().getExternalEndpoint("thanos-querier", "openshift-monitoring");
} else {
metricsEndpoint = Kubernetes.getInstance().getExternalEndpoint("prometheus-route", environment.getMonitoringNamespace());
}
monitoring = new MonitoringClient(metricsEndpoint);
kubernetes.createNamespace(testNamespace);
} catch (Exception e) {
beforeAllException = e;
}
}

@BeforeEach
void catchBeforeAllException() throws Exception {
if (beforeAllException != null) {
throw beforeAllException;
void installMonitoring() throws Exception {
EnmasseOperatorManager.getInstance().enableMonitoring();
Endpoint metricsEndpoint;
if (Kubernetes.isOpenShiftCompatible(OCP4) && !Kubernetes.isCRC()) {
metricsEndpoint = Kubernetes.getInstance().getExternalEndpoint("thanos-querier", "openshift-monitoring");
} else {
metricsEndpoint = Kubernetes.getInstance().getExternalEndpoint("prometheus-route", environment.getMonitoringNamespace());
}
monitoring = new MonitoringClient(metricsEndpoint);
kubernetes.createNamespace(testNamespace);
}

@AfterAll
Expand Down

0 comments on commit efd90cf

Please sign in to comment.