Skip to content

Commit fb88abb

Browse files
authored
Delete the voyager tests and fix the nightly test failures in release/3.3 branch (#2763)
* porting changes from main * porting changes from main for ItManagedCoherence.java * porting changes from main for ItWlsSamples * port changes dfor ItEternalLBTunneling * revert change to ITWlsSamples * port changes from main * port session migration tests from main * revert some commits and fix ItMiiSampleFmwAux failure * add ordering for monitoring exporter tests * increase the number of retries * port monitoring exporter changes from main * wip * wip * remove test ordering * revert changes to ItMiiSample
1 parent 8fd3150 commit fb88abb

File tree

8 files changed

+454
-441
lines changed

8 files changed

+454
-441
lines changed

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItExternalLbTunneling.java

Lines changed: 138 additions & 203 deletions
Large diffs are not rendered by default.

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItManagedCoherence.java

Lines changed: 58 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -28,40 +28,35 @@
2828
import oracle.weblogic.kubernetes.annotations.Namespaces;
2929
import oracle.weblogic.kubernetes.logging.LoggingFacade;
3030
import oracle.weblogic.kubernetes.utils.BuildApplication;
31-
import oracle.weblogic.kubernetes.utils.ExecCommand;
3231
import oracle.weblogic.kubernetes.utils.ExecResult;
33-
import org.awaitility.core.ConditionFactory;
3432
import org.junit.jupiter.api.BeforeAll;
3533
import org.junit.jupiter.api.DisplayName;
36-
import org.junit.jupiter.api.Tag;
3734
import org.junit.jupiter.api.Test;
3835

39-
import static java.util.concurrent.TimeUnit.MINUTES;
40-
import static java.util.concurrent.TimeUnit.SECONDS;
4136
import static oracle.weblogic.kubernetes.TestConstants.ADMIN_PASSWORD_DEFAULT;
4237
import static oracle.weblogic.kubernetes.TestConstants.ADMIN_USERNAME_DEFAULT;
4338
import static oracle.weblogic.kubernetes.TestConstants.DOMAIN_API_VERSION;
44-
import static oracle.weblogic.kubernetes.TestConstants.K8S_NODEPORT_HOST;
4539
import static oracle.weblogic.kubernetes.TestConstants.MANAGED_SERVER_NAME_BASE;
4640
import static oracle.weblogic.kubernetes.TestConstants.OCIR_SECRET_NAME;
4741
import static oracle.weblogic.kubernetes.TestConstants.OKD;
48-
import static oracle.weblogic.kubernetes.TestConstants.VOYAGER_CHART_NAME;
4942
import static oracle.weblogic.kubernetes.actions.ActionConstants.APP_DIR;
5043
import static oracle.weblogic.kubernetes.actions.TestActions.createDomainCustomResource;
5144
import static oracle.weblogic.kubernetes.actions.TestActions.getServiceNodePort;
5245
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.checkServiceExists;
46+
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getHostAndPort;
47+
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.testUntil;
48+
import static oracle.weblogic.kubernetes.utils.ExecCommand.exec;
5349
import static oracle.weblogic.kubernetes.utils.ImageUtils.createImageAndVerify;
5450
import static oracle.weblogic.kubernetes.utils.ImageUtils.createOcirRepoSecret;
5551
import static oracle.weblogic.kubernetes.utils.ImageUtils.dockerLoginAndPushImageToRegistry;
56-
import static oracle.weblogic.kubernetes.utils.LoadBalancerUtils.installAndVerifyVoyager;
57-
import static oracle.weblogic.kubernetes.utils.LoadBalancerUtils.installVoyagerIngressAndVerify;
52+
import static oracle.weblogic.kubernetes.utils.LoadBalancerUtils.createTraefikIngressForDomainAndVerify;
53+
import static oracle.weblogic.kubernetes.utils.LoadBalancerUtils.installAndVerifyTraefik;
5854
import static oracle.weblogic.kubernetes.utils.OKDUtils.createRouteForOKD;
5955
import static oracle.weblogic.kubernetes.utils.OperatorUtils.installAndVerifyOperator;
6056
import static oracle.weblogic.kubernetes.utils.PodUtils.checkPodReady;
6157
import static oracle.weblogic.kubernetes.utils.PodUtils.setPodAntiAffinity;
6258
import static oracle.weblogic.kubernetes.utils.SecretUtils.createSecretWithUsernamePassword;
6359
import static oracle.weblogic.kubernetes.utils.ThreadSafeLogger.getLogger;
64-
import static org.awaitility.Awaitility.with;
6560
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
6661
import static org.junit.jupiter.api.Assertions.assertEquals;
6762
import static org.junit.jupiter.api.Assertions.assertFalse;
@@ -71,7 +66,6 @@
7166
// Test to associate a Coherence Cluster with multiple WebLogic server clusters.
7267
@DisplayName("Test to associate a Coherence Cluster with multiple WebLogic server clusters")
7368
@IntegrationTest
74-
@Tag("okdenv")
7569
class ItManagedCoherence {
7670

7771
// constants for Coherence
@@ -89,21 +83,15 @@ class ItManagedCoherence {
8983
private static final int MANAGED_SERVER_PORT = 8001;
9084
private static final int replicaCount = 2;
9185
private static String adminServerPodName = domainUid + "-admin-server";
92-
private static String cluster1Hostname = null;
93-
private static String cluster2Hostname = null;
9486

9587
private static String opNamespace = null;
9688
private static String domainNamespace = null;
97-
private static ConditionFactory withStandardRetryPolicy = null;
9889

99-
// constants for Voyager
100-
private static String cloudProvider = "baremetal";
101-
private static boolean enableValidatingWebhook = false;
102-
private static HelmParams voyagerHelmParams = null;
90+
private static HelmParams traefikHelmParams = null;
10391
private static LoggingFacade logger = null;
10492

10593
/**
106-
* Install Voyager and operator, build two Coherence applications
94+
* Install Traefik and operator, build two Coherence applications
10795
* 1. Coherence applications are packaged as Grid ARchives (GAR) and
10896
* deployed on storage-enabled managed Coherence servers in cluster-2
10997
* 2. Coherence application GAR is packaged within an EAR and
@@ -115,15 +103,11 @@ class ItManagedCoherence {
115103
@BeforeAll
116104
public static void init(@Namespaces(3) List<String> namespaces) {
117105
logger = getLogger();
118-
// create standard, reusable retry/backoff policy
119-
withStandardRetryPolicy = with().pollDelay(2, SECONDS)
120-
.and().with().pollInterval(10, SECONDS)
121-
.atMost(5, MINUTES).await();
122106

123-
// get a unique Voyager namespace
124-
logger.info("Get a unique namespace for Voyager");
107+
// get a unique Traefik namespace
108+
logger.info("Get a unique namespace for Traefik");
125109
assertNotNull(namespaces.get(0), "Namespace list is null");
126-
String voyagerNamespace = namespaces.get(0);
110+
String traefikNamespace = namespaces.get(0);
127111

128112
// get a new unique opNamespace
129113
logger.info("Assigning a unique namespace for Operator");
@@ -135,10 +119,9 @@ public static void init(@Namespaces(3) List<String> namespaces) {
135119
assertNotNull(namespaces.get(2), "Namespace list is null");
136120
domainNamespace = namespaces.get(2);
137121

138-
// install and verify Voyager if not running on OKD
122+
// install and verify Traefik if not running on OKD
139123
if (!OKD) {
140-
voyagerHelmParams =
141-
installAndVerifyVoyager(voyagerNamespace, cloudProvider, enableValidatingWebhook);
124+
traefikHelmParams = installAndVerifyTraefik(traefikNamespace, 0, 0);
142125
}
143126

144127
// install and verify operator
@@ -165,7 +148,6 @@ public static void init(@Namespaces(3) List<String> namespaces) {
165148
@DisplayName("Two cluster domain with a Coherence cluster and test interaction with cache data")
166149
void testMultiClusterCoherenceDomain() {
167150
String ingressName = domainUid + "-ingress-host-routing";
168-
String ingressServiceName = VOYAGER_CHART_NAME + "-" + ingressName;
169151
String channelName = "tcp-80";
170152

171153
// create a DomainHomeInImage image using WebLogic Image Tool
@@ -187,34 +169,29 @@ void testMultiClusterCoherenceDomain() {
187169
assertTrue(testCompletedSuccessfully, "Test Coherence cache failed");
188170
} else {
189171

190-
// create Voyager ingress resource
191172
Map<String, Integer> clusterNameMsPortMap = new HashMap<>();
192173
for (int i = 1; i <= NUMBER_OF_CLUSTERS; i++) {
193174
clusterNameMsPortMap.put(CLUSTER_NAME_PREFIX + i, MANAGED_SERVER_PORT);
194175
}
176+
// clusterNameMsPortMap.put(clusterName, managedServerPort);
177+
logger.info("Creating ingress for domain {0} in namespace {1}", domainUid, domainNamespace);
178+
createTraefikIngressForDomainAndVerify(domainUid, domainNamespace, 0, clusterNameMsPortMap, true, null);
195179

196-
// get hostnames
197-
List<String> hostNames =
198-
installVoyagerIngressAndVerify(domainUid, domainNamespace, ingressName, clusterNameMsPortMap);
199-
180+
String clusterHostname = domainUid + "." + domainNamespace + ".cluster-1.test";
200181
// get ingress service Nodeport
182+
String ingressServiceName = traefikHelmParams.getReleaseName();
183+
String traefikNamespace = traefikHelmParams.getNamespace();
184+
201185
int ingressServiceNodePort = assertDoesNotThrow(()
202-
-> getServiceNodePort(domainNamespace, ingressServiceName, channelName),
203-
"Getting admin server node port failed");
186+
-> getServiceNodePort(traefikNamespace, ingressServiceName, "web"),
187+
"Getting Ingress Service node port failed");
204188
logger.info("Node port for {0} is: {1} :", ingressServiceName, ingressServiceNodePort);
205189

206-
// get hostname for each cluster
207-
for (String hostName : hostNames) {
208-
if (hostName.contains("cluster-1")) {
209-
cluster1Hostname = hostName;
210-
} else if (hostName.contains("cluster-2")) {
211-
cluster2Hostname = hostName;
212-
}
213-
}
214-
190+
String hostAndPort = getHostAndPort(clusterHostname, ingressServiceNodePort);
191+
assertTrue(checkCoheranceApp(clusterHostname, hostAndPort), "Failed to access Coherance App cation");
215192
// test adding data to the cache and retrieving them from the cache
216193
boolean testCompletedSuccessfully = assertDoesNotThrow(()
217-
-> coherenceCacheTest(cluster1Hostname, ingressServiceNodePort), "Test Coherence cache failed");
194+
-> coherenceCacheTest(clusterHostname, ingressServiceNodePort), "Test Coherence cache failed");
218195
assertTrue(testCompletedSuccessfully, "Test Coherence cache failed");
219196
}
220197
}
@@ -241,8 +218,8 @@ private static void createAndVerifyDomain(String domImage) {
241218
// create secret for admin credentials
242219
logger.info("Create secret for admin credentials");
243220
String adminSecretName = "weblogic-credentials";
244-
assertDoesNotThrow(() -> createSecretWithUsernamePassword(adminSecretName,
245-
domainNamespace, ADMIN_USERNAME_DEFAULT, ADMIN_PASSWORD_DEFAULT),
221+
assertDoesNotThrow(() -> createSecretWithUsernamePassword(adminSecretName, domainNamespace,
222+
ADMIN_USERNAME_DEFAULT, ADMIN_PASSWORD_DEFAULT),
246223
String.format("create secret for admin credentials failed for %s", adminSecretName));
247224

248225
// create encryption secret
@@ -349,7 +326,7 @@ private boolean coherenceCacheTest(String hostName) {
349326
private boolean coherenceCacheTest(String hostName, int ingressServiceNodePort) {
350327
logger.info("Starting to test the cache");
351328

352-
String hostAndPort = (OKD) ? hostName : K8S_NODEPORT_HOST + ":" + ingressServiceNodePort;
329+
String hostAndPort = getHostAndPort(hostName, ingressServiceNodePort);
353330
logger.info("hostAndPort = {0} ", hostAndPort);
354331

355332
// add the data to cache
@@ -358,8 +335,8 @@ private boolean coherenceCacheTest(String hostName, int ingressServiceNodePort)
358335
ExecResult result = null;
359336
for (int i = 0; i < firstNameList.length; i++) {
360337
result = addDataToCache(firstNameList[i], secondNameList[i], hostName, hostAndPort);
361-
logger.info("Data added to the cache " + result.stdout());
362338
assertTrue(result.stdout().contains(firstNameList[i]), "Did not add the expected record");
339+
logger.info("Data added to the cache: {0}", result.stdout());
363340
}
364341

365342
// check if cache size is 6
@@ -390,7 +367,6 @@ private ExecResult addDataToCache(String firstName,
390367
String hostName,
391368
String hostAndPort) {
392369
logger.info("Add initial data to cache");
393-
394370
StringBuffer curlCmd = new StringBuffer("curl --silent --show-error --noproxy '*' ");
395371
curlCmd
396372
.append("-d 'action=add&first=")
@@ -407,8 +383,7 @@ private ExecResult addDataToCache(String firstName,
407383
.append("/")
408384
.append(COHERENCE_APP_NAME);
409385
logger.info("Command to add initial data to cache {0} ", curlCmd.toString());
410-
411-
ExecResult result = assertDoesNotThrow(() -> ExecCommand.exec(curlCmd.toString(), true),
386+
ExecResult result = assertDoesNotThrow(() -> exec(curlCmd.toString(), true),
412387
String.format("Failed to add initial data to cache by running command %s", curlCmd));
413388
assertEquals(0, result.exitValue(),
414389
String.format("Failed to add initial data to cache. Error is %s ", result.stderr()));
@@ -432,7 +407,7 @@ private ExecResult getCacheSize(String hostName, String hostAndPort) {
432407
.append(COHERENCE_APP_NAME);
433408
logger.info("Command to get the number of records in cache " + curlCmd.toString());
434409

435-
ExecResult result = assertDoesNotThrow(() -> ExecCommand.exec(curlCmd.toString(), true),
410+
ExecResult result = assertDoesNotThrow(() -> exec(curlCmd.toString(), true),
436411
String.format("Failed to get the number of records in cache by running command %s", curlCmd));
437412
assertEquals(0, result.exitValue(),
438413
String.format("Failed to get the number of records in cache. Error is %s ", result.stderr()));
@@ -456,7 +431,7 @@ private ExecResult getCacheContents(String hostName, String hostAndPort) {
456431
.append(COHERENCE_APP_NAME);
457432
logger.info("Command to get the records from cache " + curlCmd.toString());
458433

459-
ExecResult result = assertDoesNotThrow(() -> ExecCommand.exec(curlCmd.toString(), true),
434+
ExecResult result = assertDoesNotThrow(() -> exec(curlCmd.toString(), true),
460435
String.format("Failed to get the records from cache by running command %s", curlCmd));
461436
assertEquals(0, result.exitValue(),
462437
String.format("Failed to get the records from cache. Error is %s ", result.stderr()));
@@ -480,11 +455,37 @@ private ExecResult clearCache(String hostName, String hostAndPort) {
480455
.append(COHERENCE_APP_NAME);
481456
logger.info("Command to clean the cache " + curlCmd.toString());
482457

483-
ExecResult result = assertDoesNotThrow(() -> ExecCommand.exec(curlCmd.toString(), true),
458+
ExecResult result = assertDoesNotThrow(() -> exec(curlCmd.toString(), true),
484459
String.format("Failed to clean the cache by running command %s", curlCmd));
485460
assertEquals(0, result.exitValue(),
486461
String.format("Failed to clean the cache. Error is %s ", result.stderr()));
487462

488463
return result;
489464
}
465+
466+
private boolean checkCoheranceApp(String hostName, String hostAndPort) {
467+
468+
StringBuffer curlCmd = new StringBuffer("curl --silent --show-error --noproxy '*' ");
469+
curlCmd
470+
.append("-d 'action=clear' ")
471+
.append("-X POST -H 'host: ")
472+
.append(hostName)
473+
.append("' http://")
474+
.append(hostAndPort)
475+
.append("/")
476+
.append(COHERENCE_APP_NAME)
477+
.append("/")
478+
.append(COHERENCE_APP_NAME)
479+
.append(" -o /dev/null")
480+
.append(" -w %{http_code};")
481+
.append("echo ${status}");
482+
logger.info("Command to check the Application {0} ", curlCmd.toString());
483+
testUntil(
484+
assertDoesNotThrow(() -> () -> exec(new String(curlCmd), true).stdout().contains("200")),
485+
logger,
486+
"application to be ready {0}",
487+
curlCmd);
488+
return true;
489+
}
490+
490491
}

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMonitoringExporter.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,9 +1300,9 @@ private static void installMonitoringExporter() {
13001300
monitoringExporterEndToEndDir = monitoringTemp + "/samples/kubernetes/end2end/";
13011301

13021302
String monitoringExporterBranch = Optional.ofNullable(System.getenv("MONITORING_EXPORTER_BRANCH"))
1303-
.orElse("master");
1304-
//adding ability to build monitoring exporter if branch is not master
1305-
boolean toBuildMonitoringExporter = (!monitoringExporterBranch.equalsIgnoreCase(("master")));
1303+
.orElse("main");
1304+
//adding ability to build monitoring exporter if branch is not main
1305+
boolean toBuildMonitoringExporter = (!monitoringExporterBranch.equalsIgnoreCase(("main")));
13061306
monitoringExporterAppDir = monitoringApp.toString();
13071307
String monitoringExporterAppNoRestPortDir = monitoringAppNoRestPort.toString();
13081308

@@ -1499,7 +1499,7 @@ private static void createAndVerifyDomain(String miiImage,
14991499
createOcirRepoSecret(namespace);
15001500
logger.info("Create secret for admin credentials");
15011501
String adminSecretName = "weblogic-credentials";
1502-
assertDoesNotThrow(() -> createSecretWithUsernamePassword(adminSecretName,
1502+
assertDoesNotThrow(() -> createSecretWithUsernamePassword(adminSecretName,
15031503
namespace, ADMIN_USERNAME_DEFAULT, ADMIN_PASSWORD_DEFAULT),
15041504
String.format("create secret for admin credentials failed for %s", adminSecretName));
15051505

@@ -1650,7 +1650,7 @@ private void verifyMonExpAppAccessThroughNginx(String nginxHost, int replicaCoun
16501650
ADMIN_PASSWORD_DEFAULT,
16511651
K8S_NODEPORT_HOST,
16521652
nodeportshttp);
1653-
assertThat(callWebAppAndCheckForServerNameInResponse(curlCmd, managedServerNames, 50))
1653+
assertThat(callWebAppAndCheckForServerNameInResponse(curlCmd, managedServerNames, 100))
16541654
.as("Verify NGINX can access the monitoring exporter metrics "
16551655
+ "from all managed servers in the domain via http")
16561656
.withFailMessage("NGINX can not access the monitoring exporter metrics "
@@ -1708,11 +1708,11 @@ private static void changeConfigInPod(String podName, String namespace, String c
17081708
"Copying file to pod failed");
17091709
execInPod(exporterPod, "monitoring-exporter", true,
17101710
"curl -X PUT -H \"content-type: application/yaml\" --data-binary \"@/tmp/"
1711-
+ configYaml + "\" -i -u " + ADMIN_USERNAME_DEFAULT + ":"
1712-
+ ADMIN_PASSWORD_DEFAULT
1711+
+ configYaml + "\" -i -u " + ADMIN_USERNAME_DEFAULT + ":"
1712+
+ ADMIN_PASSWORD_DEFAULT
17131713
+ "http://localhost:8080/configuration");
17141714
execInPod(exporterPod, "monitoring-exporter", true, "curl -X GET "
1715-
+ " -i -u " + ADMIN_USERNAME_DEFAULT + ":" + ADMIN_PASSWORD_DEFAULT
1715+
+ " -i -u " + ADMIN_USERNAME_DEFAULT + ":" + ADMIN_PASSWORD_DEFAULT
17161716
+ "http://localhost:8080/metrics");
17171717
}
17181718

0 commit comments

Comments
 (0)