Skip to content

Commit 24ffab4

Browse files
hzhao-githubrjeberhard
authored andcommitted
Backported internal OKE conversion in OWLS-112085 on main into release/4.2
1 parent 4f2a892 commit 24ffab4

File tree

2 files changed

+39
-17
lines changed

2 files changed

+39
-17
lines changed

Jenkinsfile.oke

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@
33
//
44

55
CRON_SETTINGS = '''H 3 * * * % MAVEN_PROFILE_NAME=oke-gate;CLUSTER_NAME=seqone;PARALLEL_RUN=false
6-
H 1 * * * % MAVEN_PROFILE_NAME=oke-parallelnew;CLUSTER_NAME=parone;PARALLEL_RUN=true'''
7-
6+
H 2 * * * % MAVEN_PROFILE_NAME=oke-parallelnew;CLUSTER_NAME=parone;PARALLEL_RUN=true'''
87
pipeline {
98
agent { label 'large' }
109
options {
1110
timeout(time: 1800, unit: 'MINUTES')
1211
//disableConcurrentBuilds()
1312
}
14-
13+
triggers {
14+
// timer trigger for "nightly build"
15+
parameterizedCron(env.JOB_NAME == 'wko-oke-nightly' ?
16+
CRON_SETTINGS : '')
17+
}
1518
tools {
1619
maven 'maven-3.8.7'
1720
jdk 'jdk21'
@@ -476,13 +479,13 @@ EOF
476479
environment {
477480
runtime_path = "${WORKSPACE}/bin:${PATH}"
478481
clusterName = "${CLUSTER_NAME}"
479-
FSS_DIR = "/oketest1,/oketest2,/oketest3"
482+
FSS_DIR = "/oketest1,/oketest2,/oketest3,/oketest4,/oketest5,/oketest6,/oketest7,/oketest8,/oketest9,/oketest10,/oketest11,/oketest12,/oketest13,/oketest14,/oketest15"
480483

481484
}
482485
steps {
483486
script {
484487
def res = 0
485-
currentBuild.description = "${GIT_BRANCH} ${MAVEN_PROFILE_NAME}"
488+
currentBuild.description = "${GIT_BRANCH} ${MAVEN_PROFILE_NAME} ${CLUSTER_NAME}"
486489
res = sh(script: '''
487490
if [ -z "${IT_TEST}" ] && [ "${MAVEN_PROFILE_NAME}" = "integration-tests" ]; then
488491
echo 'ERROR: All tests cannot be run with integration-tests profile'

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

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import java.nio.file.Files;
88
import java.nio.file.Path;
99
import java.nio.file.Paths;
10+
import java.util.ArrayList;
1011
import java.util.HashMap;
1112
import java.util.List;
1213
import java.util.Map;
@@ -28,6 +29,7 @@
2829
import oracle.weblogic.kubernetes.annotations.Namespaces;
2930
import oracle.weblogic.kubernetes.logging.LoggingFacade;
3031
import oracle.weblogic.kubernetes.utils.BuildApplication;
32+
import oracle.weblogic.kubernetes.utils.ExecCommand;
3133
import oracle.weblogic.kubernetes.utils.ExecResult;
3234
import org.junit.jupiter.api.BeforeAll;
3335
import org.junit.jupiter.api.DisplayName;
@@ -39,8 +41,10 @@
3941
import static oracle.weblogic.kubernetes.TestConstants.DOMAIN_API_VERSION;
4042
import static oracle.weblogic.kubernetes.TestConstants.IMAGE_PULL_POLICY;
4143
import static oracle.weblogic.kubernetes.TestConstants.INGRESS_CLASS_FILE_NAME;
44+
import static oracle.weblogic.kubernetes.TestConstants.KUBERNETES_CLI;
4245
import static oracle.weblogic.kubernetes.TestConstants.MANAGED_SERVER_NAME_BASE;
4346
import static oracle.weblogic.kubernetes.TestConstants.OKD;
47+
import static oracle.weblogic.kubernetes.TestConstants.OKE_CLUSTER;
4448
import static oracle.weblogic.kubernetes.TestConstants.TEST_IMAGES_REPO_SECRET_NAME;
4549
import static oracle.weblogic.kubernetes.TestConstants.TRAEFIK_INGRESS_HTTP_HOSTPORT;
4650
import static oracle.weblogic.kubernetes.actions.ActionConstants.APP_DIR;
@@ -74,7 +78,7 @@
7478
@IntegrationTest
7579
@Tag("kind-parallel")
7680
@Tag("okd-wls-mrg")
77-
@Tag("oke-sequential1")
81+
@Tag("oke-gate")
7882
class ItManagedCoherence {
7983

8084
// constants for Coherence
@@ -129,10 +133,15 @@ public static void init(@Namespaces(3) List<String> namespaces) {
129133
assertNotNull(namespaces.get(2), "Namespace list is null");
130134
domainNamespace = namespaces.get(2);
131135

136+
String nodePortValue = null;
137+
if (!OKE_CLUSTER) {
138+
nodePortValue = "NodePort";
139+
}
140+
132141
// install and verify Traefik if not running on OKD
133142
if (!OKD || (TestConstants.KIND_CLUSTER
134143
&& TestConstants.WLSIMG_BUILDER.equals(TestConstants.WLSIMG_BUILDER_DEFAULT))) {
135-
traefikParams = installAndVerifyTraefik(traefikNamespace, 0, 0, "NodePort");
144+
traefikParams = installAndVerifyTraefik(traefikNamespace, 0, 0, nodePortValue);
136145
traefikHelmParams = traefikParams.getHelmParams();
137146
}
138147

@@ -165,6 +174,16 @@ void testMultiClusterCoherenceDomain() throws IOException {
165174
// create and verify a two-cluster WebLogic domain with a Coherence cluster
166175
createAndVerifyDomain(domImage);
167176

177+
String command = KUBERNETES_CLI + " get all --all-namespaces";
178+
logger.info("curl command to get all --all-namespaces is: {0}", command);
179+
180+
try {
181+
ExecResult result0 = ExecCommand.exec(command, true);
182+
logger.info("result is: {0}", result0.toString());
183+
} catch (IOException | InterruptedException ex) {
184+
ex.printStackTrace();
185+
}
186+
168187
if (OKD) {
169188
String cluster1HostName = domainUid + "-cluster-cluster-1";
170189
final String cluster1IngressHost = createRouteForOKD(cluster1HostName, domainNamespace);
@@ -174,12 +193,12 @@ void testMultiClusterCoherenceDomain() throws IOException {
174193
-> coherenceCacheTest(cluster1IngressHost, 0), "Test Coherence cache failed");
175194
assertTrue(testCompletedSuccessfully, "Test Coherence cache failed");
176195
} else {
177-
178196
Map<String, Integer> clusterNameMsPortMap = new HashMap<>();
179197
for (int i = 1; i <= NUMBER_OF_CLUSTERS; i++) {
180198
clusterNameMsPortMap.put(CLUSTER_NAME_PREFIX + i, MANAGED_SERVER_PORT);
181199
}
182-
String hostHeader = domainUid + "." + domainNamespace + ".cluster-1.test";
200+
201+
String clusterHostname = domainUid + "." + domainNamespace + ".cluster-1.test";
183202
String hostAndPort;
184203
int ingressServiceNodePort;
185204
if (TestConstants.KIND_CLUSTER
@@ -191,10 +210,12 @@ void testMultiClusterCoherenceDomain() throws IOException {
191210
hostAndPort = "localhost:" + TRAEFIK_INGRESS_HTTP_HOSTPORT;
192211
ingressServiceNodePort = TRAEFIK_INGRESS_HTTP_HOSTPORT;
193212
} else {
194-
// clusterNameMsPortMap.put(clusterName, managedServerPort);
213+
List<String> domainUids = new ArrayList<>();
214+
domainUids.add(domainUid);
215+
195216
logger.info("Creating ingress for domain {0} in namespace {1}", domainUid, domainNamespace);
196-
createTraefikIngressForDomainAndVerify(domainUid, domainNamespace, 0, clusterNameMsPortMap, true, null,
197-
traefikParams.getIngressClassName());
217+
createTraefikIngressForDomainAndVerify(domainUid, domainNamespace, 0,
218+
clusterNameMsPortMap, true, null, traefikParams.getIngressClassName());
198219

199220
// get ingress service Name and Nodeport
200221
String ingressServiceName = traefikHelmParams.getReleaseName();
@@ -207,13 +228,13 @@ void testMultiClusterCoherenceDomain() throws IOException {
207228

208229
hostAndPort = getServiceExtIPAddrtOke(ingressServiceName, traefikNamespace) != null
209230
? getServiceExtIPAddrtOke(ingressServiceName, traefikNamespace)
210-
: getHostAndPort(hostHeader, ingressServiceNodePort);
231+
: getHostAndPort(clusterHostname, ingressServiceNodePort);
211232
}
212233

213-
assertTrue(checkCoheranceApp(hostAndPort, hostHeader), "Failed to access Coherance Application");
234+
assertTrue(checkCoheranceApp(hostAndPort, clusterHostname), "Failed to access Coherance Application");
214235
// test adding data to the cache and retrieving them from the cache
215236
boolean testCompletedSuccessfully = assertDoesNotThrow(()
216-
-> coherenceCacheTest(hostHeader, ingressServiceNodePort), "Test Coherence cache failed");
237+
-> coherenceCacheTest(clusterHostname, ingressServiceNodePort), "Test Coherence cache failed");
217238
assertTrue(testCompletedSuccessfully, "Test Coherence cache failed");
218239
}
219240
}
@@ -486,7 +507,6 @@ private ExecResult clearCache(String hostName, String hostAndPort) {
486507
}
487508

488509
private boolean checkCoheranceApp(String hostAndPort, String hostHeader) {
489-
490510
StringBuffer curlCmd = new StringBuffer("curl -g --silent --show-error --noproxy '*' ");
491511
curlCmd
492512
.append("-d 'action=clear' ")
@@ -509,5 +529,4 @@ private boolean checkCoheranceApp(String hostAndPort, String hostHeader) {
509529
curlCmd);
510530
return true;
511531
}
512-
513532
}

0 commit comments

Comments
 (0)