Skip to content

Commit c62c112

Browse files
marinakogjshum2479
authored andcommitted
Split OKE internal sequential runs into two
1 parent 955f928 commit c62c112

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+719
-116
lines changed

Jenkinsfile.oke

Lines changed: 52 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
// Copyright (c) 2023, Oracle and/or its affiliates.
1+
// Copyright (c) 2023, 2024, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33
//
44

5+
CRON_SETTINGS = '''H 3 * * * % MAVEN_PROFILE_NAME=oke-gate;CLUSTER_NAME=seqone;PARALLEL_RUN=false
6+
H 1 * * * % MAVEN_PROFILE_NAME=oke-sequential1;CLUSTER_NAME=seqtwo;PARALLEL_RUN=false'''
7+
58
pipeline {
69
agent { label 'large' }
710
options {
811
timeout(time: 1800, unit: 'MINUTES')
9-
disableConcurrentBuilds()
12+
//disableConcurrentBuilds()
1013
}
1114

1215
tools {
@@ -49,12 +52,9 @@ pipeline {
4952

5053
start_time = sh(script: 'date +"%Y-%m-%d %H:%M:%S"', returnStdout: true).trim()
5154
wle_download_url="https://github.com/oracle/weblogic-logging-exporter/releases/latest"
52-
53-
CLUSTER_NAME = "${env.JOB_NAME == 'wko-oke-nightly-parallel' ? 'parcluster' : 'seqcluster'}"
5455
kubeconfig_file = "${WORKSPACE}/terraform/${CLUSTER_NAME}_kubeconfig"
55-
MAVEN_PROFILE_NAME = "${env.JOB_NAME == 'wko-oke-nightly-parallel' ? 'oke-gate' : 'oke-gate'}"
5656
availability_domain = "${env.JOB_NAME == 'wko-oke-nightly-parallel' ? 'mFEn:PHX-AD-1' : 'mFEn:PHX-AD-1'}"
57-
PARALLEL_RUN = "${env.JOB_NAME == 'wko-oke-nightly-parallel' ? true : false}"
57+
5858
}
5959

6060
parameters {
@@ -64,6 +64,11 @@ pipeline {
6464
defaultValue: ''
6565
)
6666

67+
booleanParam(name: 'PARALLEL_RUN',
68+
description: 'Runs tests in parallel. Default is false.',
69+
defaultValue: false
70+
)
71+
6772
string(name: 'OKE_KUBE_VERSION',
6873
description: 'kube version for oke cluster',
6974
defaultValue: '1.28.2'
@@ -95,7 +100,22 @@ pipeline {
95100
'1.9.9'
96101
]
97102
)
98-
103+
choice(name: 'CLUSTER_NAME',
104+
description: 'Oke cluster name.',
105+
choices: [
106+
'parone',
107+
'seqone',
108+
'seqtwo'
109+
]
110+
)
111+
choice(name: 'MAVEN_PROFILE_NAME',
112+
description: 'Profile to use in mvn command to run the tests. Possible values are oke-gate, oke-sequential1,oke-parallelnew. Refer to weblogic-kubernetes-operator/integration-tests/pom.xml on the branch.',
113+
choices: [
114+
'oke-gate',
115+
'oke-sequential1',
116+
'oke-parallelnew'
117+
]
118+
)
99119
string(name: 'NUMBER_OF_THREADS',
100120
description: 'Number of threads to run the classes in parallel, default is 3.',
101121
defaultValue: "3"
@@ -391,6 +411,7 @@ EOF
391411
sh ${WORKSPACE}/terraform/oke.create.sh ${OCI_PROP_FILE} ${WORKSPACE}/terraform
392412

393413
clusterIP=$(oci ce cluster list --compartment-id=${compartment_id} | jq '.data[] | select(."name" == '\"$CLUSTER_NAME}\"' and (."lifecycle-state" == "ACTIVE"))' | jq ' ."endpoints" | ."public-endpoint"')
414+
394415
echo "clusterIp : $clusterIP"
395416
clusterPublicIP=${clusterIP:1:-6}
396417
echo " clusterPublicIP : ${clusterPublicIP}"
@@ -455,12 +476,13 @@ EOF
455476
environment {
456477
runtime_path = "${WORKSPACE}/bin:${PATH}"
457478
clusterName = "${CLUSTER_NAME}"
458-
FSS_DIR = "/oketest1,/oketest2,/oketest3,/oketest4,/oketest5,/oketest6,/oketest7,/oketest8,/oketest9,/oketest10,/oketest11,/oketest12,/oketest13,/oketest14,/oketest15"
479+
FSS_DIR = "/oketest1,/oketest2,/oketest3"
459480

460481
}
461482
steps {
462483
script {
463484
def res = 0
485+
currentBuild.description = "${GIT_BRANCH} ${MAVEN_PROFILE_NAME}"
464486
res = sh(script: '''
465487
if [ -z "${IT_TEST}" ] && [ "${MAVEN_PROFILE_NAME}" = "integration-tests" ]; then
466488
echo 'ERROR: All tests cannot be run with integration-tests profile'
@@ -505,17 +527,25 @@ EOF
505527
fi
506528

507529
export K8S_NODEPORT_HOST=${NODE_IP}
530+
export AVAILABILITY_DOMAIN=${availability_domain}
508531
NODE_IP=`kubectl get nodes -o wide| awk '{print $7}'| head -n2 | tail -n1`
509532
echo "second node external IP ${NODE_IP}"
510533
export NODE_IP=${NODE_IP}
511534

512535
mt_privateip_id=`oci fs mount-target list --compartment-id=${compartment_ocid} --display-name=${clusterName}-mt --availability-domain=${availability_domain} | jq -r '.data[] | ."private-ip-ids"[]'`
536+
# Check if the mt_privateip_id is an array
537+
if [ "$(declare -p mt_privateip_id 2>/dev/null | grep -o 'declare -a')" == "declare -a" ]; then
538+
# Select first
539+
mt_private_ip=`oci network private-ip get --private-ip-id "${mt_privateip_id[0]}" | jq -r '.data | ."ip-address"'`
540+
else
541+
mt_private_ip=`oci network private-ip get --private-ip-id "${mt_privateip_id}" | jq -r '.data | ."ip-address"'`
542+
fi
543+
513544

514-
mt_private_ip=`oci network private-ip get --private-ip-id "${mt_privateip_id}" | jq -r '.data | ."ip-address"'`
515545

516546
if [ -z "${mt_private_ip}" ]; then
517547
echo "Mount Target was not setup properly , clean up Kubernetes cluster"
518-
sh ${WORKSPACE}/terraform/oke.delete.sh ${OCI_PROP_FILE} ${WORKSPACE}/terraform
548+
sh ${WORKSPACE}/terraform/oke.delete.sh ${OCI_PROP_FILE} ${WORKSPACE}/terraform ${AVAILABILITY_DOMAIN}
519549
exit -1
520550
fi
521551
export NFS_SERVER=$mt_private_ip
@@ -554,7 +584,7 @@ EOF
554584
echo "-Dwko.it.grafana.chart.version=\"${GRAFANA_CHART_VERSION}\"" >> ${WORKSPACE}/.mvn/maven.config
555585
echo "-Dwko.it.collect.logs.on.success=\"${COLLECT_LOGS_ON_SUCCESS}\"" >> ${WORKSPACE}/.mvn/maven.config
556586
echo "-Dwko.it.remoteconsole.version=\"${REMOTECONSOLE_VERSION}\"" >> ${WORKSPACE}/.mvn/maven.config
557-
echo "-Djdk.httpclient.allowRestrictedHeaders=\"host\"" >> ${WORKSPACE}/.mvn/maven.config
587+
echo "-Djdk.httpclient.allowRestrictedHeaders=\"host\"" >> ${WORKSPACE}/.mvn/maven.config
558588

559589
echo "${WORKSPACE}/.mvn/maven.config contents:"
560590
cat "${WORKSPACE}/.mvn/maven.config"
@@ -592,11 +622,12 @@ EOF
592622
export PATH="${WORKSPACE}/bin:${PATH}"
593623
export KUBECONFIG=${kubeconfig_file}
594624
export OCI_CLI_CONFIG_FILE=${WORKSPACE}/oci/config
625+
export AVAILABILITY_DOMAIN=${availability_domain}
595626
export OCI_CLI_PROFILE=${oci_profile}
596627
mkdir -m777 -p ${result_root}/kubelogs
597628
mkdir -m777 -p "${WORKSPACE}/logdir/${BUILD_TAG}/wl_k8s_test_results"
598629
sudo mv -f ${result_root}/* "${WORKSPACE}/logdir/${BUILD_TAG}/wl_k8s_test_results"
599-
${WORKSPACE}/terraform/oke.delete.sh ${OCI_PROP_FILE} ${WORKSPACE}/terraform
630+
${WORKSPACE}/terraform/oke.delete.sh ${OCI_PROP_FILE} ${WORKSPACE}/terraform ${AVAILABILITY_DOMAIN}
600631

601632
'''
602633

@@ -612,11 +643,19 @@ EOF
612643
sh '''
613644
export PATH="${WORKSPACE}/bin:${PATH}"
614645
export KUBECONFIG=${kubeconfig_file}
646+
export AVAILABILITY_DOMAIN=${availability_domain}
615647

616648
echo 'Remove old OKE cluster (if any)...'
617649

618650
if [ -f "$OCI_PROP_FILE" ] && [ -f "${WORKSPACE}/terraform/oke.delete.sh" ]; then
619-
${WORKSPACE}/terraform/oke.delete.sh ${OCI_PROP_FILE} ${WORKSPACE}/terraform
651+
${WORKSPACE}/terraform/oke.delete.sh ${OCI_PROP_FILE} ${WORKSPACE}/terraform ${AVAILABILITY_DOMAIN}
652+
fi
653+
654+
if [ "${MAVEN_PROFILE_NAME}" = "oke-gate" ]; then
655+
compname="wkt"
656+
wkt_compartment_ocid=$(oci iam compartment list --compartment-id-in-subtree true --all | jq --arg compname "$compname" '.data[] | select(."name"==$compname)' | jq -r ."id")
657+
sec_list_id=$(oci network security-list list --compartment-id="$wkt_compartment_ocid" --display-name=Security-List-wktiso1 | jq -r '.data[] | ."id"')
658+
oci network security-list update --security-list-id="$sec_list_id" --ingress-security-rules='[{"description": "east west","icmp-options": null,"is-stateless": false,"protocol": "all","source": "10.196.0.0/16","source-type": "CIDR_BLOCK","tcp-options": null,"udp-options": null},{"description": null,"icmp-options": {"code": null,"type": 3},"is-stateless": false,"protocol": "1", "source": "10.196.0.0/16", "source-type": "CIDR_BLOCK","tcp-options": null, "udp-options": null}, {"description": null, "icmp-options": {"code": 4, "type": 3},"is-stateless": false, "protocol": "1", "source": "0.0.0.0/0","source-type": "CIDR_BLOCK", "tcp-options": null, "udp-options": null}, {"description": null, "icmp-options": null, "is-stateless": false, "protocol": "6","source": "0.0.0.0/0", "source-type": "CIDR_BLOCK", "tcp-options": null, "udp-options": null}, {"description": null, "icmp-options": null, "is-stateless": false,"protocol": "6", "source": "0.0.0.0/0", "source-type": "CIDR_BLOCK", "tcp-options": {"destination-port-range": {"max": 22, "min": 22}, "source-port-range": null}, "udp-options": null}]' --egress-security-rules='[{"description": null, "destination": "0.0.0.0/0", "destinationType": "CIDR_BLOCK", "icmpOptions": null, "isStateless": false, "protocol": "all", "tcpOptions": null, "udpOptions": null}, {"description": null, "destination": "oci-phx-objectstorage", "destinationType": "SERVICE_CIDR_BLOCK", "icmpOptions": null, "isStateless": false, "protocol": "6", "tcpOptions": null, "udpOptions": null}]' --force
620659
fi
621660
rm -f ${jenkins_home_directory}/.oci/config
622661
rm -f ${jenkins_home_directory}/.oci/oci-signing-key.pem

integration-tests/pom.xml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- Copyright (c) 2020, 2023, Oracle and/or its affiliates.
1+
<!-- Copyright (c) 2020, 2024, Oracle and/or its affiliates.
22
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -->
33
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
@@ -472,6 +472,20 @@
472472
<groups>oke-gate</groups>
473473
</properties>
474474
</profile>
475+
<profile>
476+
<id>oke-sequential1</id>
477+
<properties>
478+
<skipITs>false</skipITs>
479+
<groups>oke-sequential1</groups>
480+
</properties>
481+
</profile>
482+
<profile>
483+
<id>oke-parallelnew</id>
484+
<properties>
485+
<skipITs>false</skipITs>
486+
<groups>oke-parallelnew</groups>
487+
</properties>
488+
</profile>
475489
<profile>
476490
<id>oke-arm</id>
477491
<properties>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2022, 2023, Oracle and/or its affiliates.
1+
// Copyright (c) 2022, 2024, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package oracle.weblogic.kubernetes;
@@ -51,7 +51,7 @@
5151
@IntegrationTest
5252
@Tag("kind-parallel")
5353
@Tag("olcne-mrg")
54-
@Tag("oke-gate")
54+
@Tag("oke-sequential1")
5555
class ItAddNewDynamicClusterUsingWlst {
5656

5757
// domain constants

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2020, 2022, Oracle and/or its affiliates.
1+
// Copyright (c) 2020, 2024, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package oracle.weblogic.kubernetes;
@@ -71,7 +71,7 @@
7171
@IntegrationTest
7272
@Tag("kind-parallel")
7373
@Tag("okd-wls-mrg")
74-
@Tag("oke-gate")
74+
@Tag("oke-sequential1")
7575
@Tag("oke-arm")
7676
class ItCoherenceTests {
7777

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2020, 2023, Oracle and/or its affiliates.
1+
// Copyright (c) 2020, 2024, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package oracle.weblogic.kubernetes;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2022, 2023, Oracle and/or its affiliates.
1+
// Copyright (c) 2022, 2024, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package oracle.weblogic.kubernetes;
@@ -38,7 +38,7 @@
3838
@IntegrationTest
3939
@Tag("kind-parallel")
4040
@Tag("olcne-mrg")
41-
@Tag("oke-gate")
41+
@Tag("oke-sequential1")
4242
@Tag("oke-arm")
4343
class ItConsensusLeasingValidation {
4444

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2022, 2023, Oracle and/or its affiliates.
1+
// Copyright (c) 2022, 2024, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package oracle.weblogic.kubernetes;
@@ -46,7 +46,7 @@
4646
@IntegrationTest
4747
@Tag("kind-parallel")
4848
@Tag("olcne-mrg")
49-
@Tag("oke-gate")
49+
@Tag("oke-sequential1")
5050
@Tag("oke-arm")
5151
class ItDataHomeOverride {
5252

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2022, 2023, Oracle and/or its affiliates.
1+
// Copyright (c) 2022, 2024, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package oracle.weblogic.kubernetes;
@@ -61,7 +61,7 @@
6161
@Tag("olcne-mrg")
6262
@Tag("kind-parallel")
6363
@Tag("okd-wls-mrg")
64-
@Tag("oke-gate")
64+
@Tag("oke-sequential1")
6565
@Tag("oke-arm")
6666
class ItDiagnosticsCompleteAvailableCondition {
6767

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
@Tag("olcne-mrg")
110110
@Tag("kind-parallel")
111111
@Tag("okd-wls-mrg")
112-
@Tag("oke-gate")
112+
@Tag("oke-sequential1")
113113
@Tag("oke-arm")
114114
class ItDiagnosticsFailedCondition {
115115

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2020, 2023, Oracle and/or its affiliates.
1+
// Copyright (c) 2020, 2024, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package oracle.weblogic.kubernetes;
@@ -101,7 +101,7 @@
101101
@Tag("olcne-mrg")
102102
@Tag("kind-parallel")
103103
@Tag("okd-wls-mrg")
104-
@Tag("oke-gate")
104+
@Tag("oke-sequential1")
105105
class ItElasticLogging {
106106

107107
// constants for creating domain image using model in image

0 commit comments

Comments
 (0)