Skip to content

Commit 56483f8

Browse files
authored
Merge pull request #883 from oracle/optimize-sitconfig-tests
Updated java integration tests README.md with new changes
2 parents b631d6a + c0fee7f commit 56483f8

File tree

7 files changed

+82
-64
lines changed

7 files changed

+82
-64
lines changed

integration-tests/README.md

Lines changed: 60 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -16,45 +16,51 @@ Wercker runs only Quick test use cases, Jenkins run both Quick and Full test use
1616

1717
Java integration tests cover the below use cases:
1818

19-
Quick test use cases.
19+
Quick test use cases -
20+
21+
| | |
22+
| --- | --- |
23+
| Operator Configuration | operator1 deployed in weblogic-operator1 namespace and manages domains in default and test1 namespaces |
24+
| Domain Configuration | Domain on PV using WLST, traefik load balancer |
25+
26+
Basic Use Cases
2027

2128
1. create operator operator1 which manages default and test1 namespaces, verify its deployed successfully, pod created, operator Ready and verify external REST service if configured
2229
2. create domain domain1 in default namespace and verify the pods, services are created and servers are in Ready
2330
3. verify admin external service by accessing admin REST endpoint with nodeport in URL
2431
4. verify admin t3 channel port by exec into the admin pod and deploying webapp using the channel port for WLST
2532
5. verify web app load balancing by accessing the webapp using loadBalancerWebPort
33+
34+
Advanced Use Cases
35+
2636
6. verify domain life cycle(destroy and create) should not any impact on Operator managing the domain and web app load balancing and admin external service
2737
7. cluster scale up/down using Operator REST endpoint, webapp load balancing should adjust accordingly.
2838
8. Operator life cycle(destroy and create) should not impact the running domain
39+
40+
Also the below use cases are covered for Quick test
41+
2942
9. verify liveness probe by killing managed server 1 process 3 times to kick pod auto-restart
3043
10. shutdown the domain by changing domain serverStartPolicy to NEVER
3144

32-
Full test use cases
33-
34-
* keep the first operator running
35-
* create another domain domain2 in default namespace and verify the domain by doing the checks 2 - 5 listed in quick test
36-
* shutdown and delete domain domain2
37-
* create another domain domain3 with dynamic cluster using WDT in test1 namespace and verify the domain by doing the checks 2 - 5 listed in quick test
38-
* verify cluster scaling by doing scale up for domain3 using WLDF scaling
39-
* shutdown and delete domain domain3
40-
* create another operator operator2 which manages test2 namespace and verify domain1 is not affected
41-
* create another domain domain4 with dynamic cluster in default namespace and domain domain5 with Configured cluster using WDT in test2 namespace and verify the domain by doing the checks 2 - 5 listed in quick test
42-
* verify scaling for domain5 cluster from 2 to 3 servers and back to 2, plus verify no impact on domain4
43-
* cycle domain4 down and back up, plus verify no impact on domain5
44-
* shutdown and delete both domain4 and domain5
45-
* create domain6 in the default namespace with serverStartPolicy="ADMIN_ONLY", and verify that only admin server is created. on Jenkins, this domain will also test NFS instead of HOSTPATH PV storage
46-
* shutdown and delete domain6
47-
* create domain7 in the default namespace with pvReclaimPolicy="Recycle", and verify that the PV is deleted once the domain and PVC are deleted
48-
* shutdown and delete domain7
49-
* create domain domain8 and test that create domain fails when its pv is already populated by a shutdown domain
50-
* create another domain domain9 with APACHE load balancer and access admin console via LB port. shutdown domain.
51-
* create another domain domain10 with mostly default values from sample domain inputs, mainly exposeAdminT3Channel and exposeAdminNodePort which are false by default and verify domain startup and cluster scaling using operator rest endpoint works.
52-
* create another domain domain11 with listen address not set for admin server and t3 channel and incorrect file for admin server log
53-
* verify automatic situational config override works by bringing up the domain and by doing checks 2 - 5 listed in quick test
54-
* create another domain domain12 with some junk value for t3 channel public address and using custom situational config override replace with valid public address
55-
* verify the domain by doing checks 2 - 5 listed in quick test
56-
45+
Full test use cases -
5746

47+
| | |
48+
| --- | --- |
49+
| Operator Configuration | operator2 deployed in weblogic-operator2 namespace and manages domains test2 namespace |
50+
| Domain Configuration | Domain on PV using WDT, Domain with serverStartPolicy ADMIN_ONLY, Domain with auto and custom situational configuration, Two domains managed by two operators, Domain with Recycle weblogicDomainStorageReclaimPolicy, Domain with default sample values |
51+
52+
53+
Basic Use Cases described above are verified in all the domain configurations. Also the below use cases are covered:
54+
55+
| Domain | Use Case |
56+
| --- | --- |
57+
| Domain on PV using WDT | WLDF scaling |
58+
| Domain with ADMIN_ONLY | making sure only admin server is started and managed servers are not started. Shutdown domain by deleting domain CRD. Create domain on existing PV dir, pv is already populated by a shutdown domain. |
59+
| Domain with situational config | create domain with listen address not set for admin server and t3 channel/NAP and incorrect file for admin server log location. Introspector should override these with sit-config automatically. Also, with some junk value for t3 channel public address and using custom situational config override replace with valid public address using secret. Also, on Jenkins this domain uses NFS instead of HOSTPATH PV storage |
60+
| Two domains managed by two operators | verify scaling and restart of one domain doesn't impact another domain. Delete domain resources using delete script from samples. |
61+
| Domain with Recycle policy | create domain with pvReclaimPolicy="Recycle" Verify that the PV is deleted once the domain and PVC are deleted |
62+
| Domain with default sample values | create domain using mostly default values for inputs |
63+
5864

5965
# Directory Configuration and Structure
6066

@@ -85,6 +91,7 @@ Defaults for RESULT_ROOT & PV_ROOT:
8591

8692

8793
'Physical' subdirectories created by test:
94+
8895
Local tmp files: RESULT_ROOT/acceptance_test_tmp/...
8996

9097
PV dirs K8S NFS: PV_ROOT/acceptance_test_pv/persistentVolume-${domain_uid}/...
@@ -108,14 +115,13 @@ Below configuration files are used from src/integration-tests/resources:
108115
OperatorIT.properties
109116
operator1.yaml
110117
operator2.yaml
111-
domain1.yaml
112-
domain2.yaml
113-
domain3.yaml
114-
domain4.yaml
115-
domain5.yaml
116-
domain6.yaml
117-
domain7.yaml
118-
domain8.yaml
118+
operator_bc.yaml
119+
operator_chain.yaml
120+
domainonpvwlst.yaml
121+
domainonpvwdt.yaml
122+
domainadminonly.yaml
123+
domainrecyclepolicy.yaml
124+
domainsampledefaults.yaml
119125
```
120126

121127
src/integration-tests/resources/OperatorIT.properties - This file is used for configuring common attributes for all integration tests
@@ -138,12 +144,11 @@ externalRestEnabled: true
138144
javaLoggingLevel: FINE
139145
```
140146

141-
src/integration-tests/resources/domain1.yaml - input/customized properties for PV/Load Balancer/WebLogic Domain. Any property can be provided here from kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/create-domain-inputs.yaml and kubernetes/samples/scripts/create-weblogic-domain-pv-pvc/create-pv-pvc-inputs.yaml. For all the properties that are not defined here, the default values in the sample inputs are used while generating inputs yaml.
147+
src/integration-tests/resources/domainonpvwlst.yaml - input/customized properties for PV/Load Balancer/WebLogic Domain. Any property can be provided here from kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/create-domain-inputs.yaml and kubernetes/samples/scripts/create-weblogic-domain-pv-pvc/create-pv-pvc-inputs.yaml. For all the properties that are not defined here, the default values in the sample inputs are used while generating inputs yaml.
142148

143149
```
144150
adminServerName: admin-server
145-
domainName: base_domain
146-
domainUID: domain1
151+
domainUID: domainonpvwlst
147152
clusterName: cluster-1
148153
configuredManagedServerCount: 4
149154
initialManagedServerReplicas: 2
@@ -172,7 +177,7 @@ staticPrepare() - initializes the application properties from OperatorIT.propert
172177

173178
staticUnPrepare() - releases the cluster lease on wercker env.
174179

175-
test methods - test1CreateFirstOperatorAndDomain, test2CreateAnotherDomainInDefaultNS, test3CreateDomainInTest1NS, etc
180+
test methods - testDomainOnPVUsingWLST, testDomainOnPVUsingWDT, testTwoDomainsManagedByTwoOperators, testCreateDomainWithStartPolicyAdminOnly, testCreateDomainPVReclaimPolicyRecycle, testCreateDomainWithDefaultValuesInSampleInputs, testAutoAndCustomSitConfigOverrides, testOperatorRESTIdentityBackwardCompatibility, testOperatorRESTUsingCertificateChain
176181

177182
Utility classes:
178183

@@ -235,46 +240,48 @@ Successful run will have the output like below:
235240
[INFO] Final Memory: 60M/1236M
236241
237242
```
238-
Failed run will have the output
243+
Failed run will have the output like
239244
```
240245
241246
[INFO]
242247
[INFO] Results:
243248
[INFO]
244249
[ERROR] Errors:
245-
[ERROR] ITOperator.testBCreateDomainWithDefaultValuesInSampleInputs:287->testAllUseCasesForADomain:303->BaseTest.testClusterScaling:241 ? Runtime
250+
[ERROR] ITOperator.testDomainOnPVUsingWLST:145 ? Runtime FAILURE: Couldn't create serv...
246251
[INFO]
247-
[ERROR] Tests run: 11, Failures: 0, Errors: 1, Skipped: 0
252+
[ERROR] Tests run: 9, Failures: 0, Errors: 1, Skipped: 0
248253
[INFO]
249254
[INFO]
250255
[INFO] --- maven-failsafe-plugin:2.20.1:verify (integration-tests) @ operator-integration-tests ---
251256
[INFO] ------------------------------------------------------------------------
252257
[INFO] Reactor Summary:
253258
[INFO]
254-
[INFO] weblogic-kubernetes-operator ....................... SUCCESS [ 1.669 s]
255-
[INFO] operator-model ..................................... SUCCESS [ 22.159 s]
256-
[INFO] operator-swagger ................................... SUCCESS [ 1.426 s]
257-
[INFO] operator-runtime ................................... SUCCESS [ 54.559 s]
258-
[INFO] operator-integration-tests ......................... FAILURE [ 01:03 h]
259+
[INFO] Build Tools ........................................ SUCCESS [ 1.193 s]
260+
[INFO] weblogic-kubernetes-operator ....................... SUCCESS [ 2.671 s]
261+
[INFO] json-schema ........................................ SUCCESS [ 14.917 s]
262+
[INFO] jsonschema-maven-plugin Maven Mojo ................. SUCCESS [ 8.600 s]
263+
[INFO] operator-model ..................................... SUCCESS [ 23.065 s]
264+
[INFO] operator-swagger ................................... SUCCESS [ 4.487 s]
265+
[INFO] operator-runtime ................................... SUCCESS [ 53.675 s]
266+
[INFO] operator-integration-tests ......................... FAILURE [41:09 min]
259267
[INFO] installation-tests ................................. SKIPPED
268+
[INFO] Project Reports .................................... SKIPPED
260269
[INFO] ------------------------------------------------------------------------
261270
[INFO] BUILD FAILURE
262271
[INFO] ------------------------------------------------------------------------
263-
[INFO] Total time: 01:04 h
264-
[INFO] Finished at: 2018-10-31T15:19:46-07:00
265-
[INFO] Final Memory: 48M/1275M
266-
[INFO] ------------------------------------------------------------------------
267-
272+
[INFO] Total time: 42:58 min
273+
[INFO] Finished at: 2019-02-11T09:42:08-08:00
274+
[INFO] Final Memory: 124M/1534M
268275
```
269276
JUnit test results can be seen at "integration-tests/target/failsafe-reports/TEST-oracle.kubernetes.operator.ITOperator.xml". This file shows how much time each test case took to run and the failed test results if any.
270277

271278
# How to run a single test
272279

273-
mvn -Dit.test="ITOperator#test6CreateConfiguredDomainInTest2NS" -DfailIfNoTests=false integration-test -P java-integration-tests
280+
mvn -Dit.test="ITOperator#testDomainOnPVUsingWLST" -DfailIfNoTests=false integration-test -P java-integration-tests
274281

275282
# How to run multiple tests
276283

277-
mvn -Dit.test="ITOperator#test6CreateConfiguredDomainInTest2NS+test7CreateDomainPVReclaimPolicyRecycle" -DfailIfNoTests=false integration-test -P java-integration-tests
284+
mvn -Dit.test="ITOperator#testDomainOnPVUsingWLST+testDomainOnPVUsingWDT" -DfailIfNoTests=false integration-test -P java-integration-tests
278285

279286
# How to run cleanup script
280287

integration-tests/src/test/java/oracle/kubernetes/operator/ITOperator.java

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,12 @@ public void testDomainOnPVUsingWDT() throws Exception {
200200
}
201201

202202
/**
203-
* Create two operators if they are not running. Create domain domain4 with dynamic cluster in
204-
* default namespace, managed by operator1. Create domain domain5 with Configured cluster using
205-
* WDT in test2 namespace, managed by operator2 Verify scaling for domain5 cluster from 2 to 3
206-
* servers and back to 2, plus verify no impact on domain4 Cycle domain4 down and back up, plus
207-
* verify no impact on domain5 shutdown by deleting both domain4 and domain5 CRD's
203+
* Create two operators if they are not running. Create domain domain1 with dynamic cluster in
204+
* default namespace, managed by operator1. Create domain domain2 with Configured cluster using
205+
* WDT in test2 namespace, managed by operator2. Verify scaling for domain2 cluster from 2 to 3
206+
* servers and back to 2, plus verify no impact on domain1. Cycle domain1 down and back up, plus
207+
* verify no impact on domain2. shutdown by the domains using the delete resource script from
208+
* samples.
208209
*
209210
* <p>ToDo: configured cluster support is removed from samples, modify the test to create
210211
*
@@ -215,7 +216,7 @@ public void testTwoDomainsManagedByTwoOperators() throws Exception {
215216
Assume.assumeFalse(QUICKTEST);
216217
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
217218
logTestBegin(testMethodName);
218-
logger.info("Creating Domain domain4 & verifing the domain creation");
219+
logger.info("Creating Domain domain1 & verifing the domain creation");
219220

220221
logger.info("Checking if operator1 and domain1 are running, if not creating");
221222
if (operator1 == null) {
@@ -237,7 +238,7 @@ public void testTwoDomainsManagedByTwoOperators() throws Exception {
237238
if (operator2 == null) {
238239
operator2 = TestUtils.createOperator(operator2File);
239240
}
240-
// create domain5 with configured cluster
241+
// create domain2 with configured cluster
241242
// ToDo: configured cluster support is removed from samples, modify the test to create
242243
// configured cluster
243244
Map<String, Object> wdtDomainMap = TestUtils.loadYaml(domainonpvwdtFile);
@@ -256,7 +257,7 @@ public void testTwoDomainsManagedByTwoOperators() throws Exception {
256257
logger.info("Verify the only remaining running domain domain1 is unaffected");
257258
domain1.verifyDomainCreated();
258259

259-
logger.info("Destroy and create domain4 and verify no impact on domain2");
260+
logger.info("Destroy and create domain1 and verify no impact on domain2");
260261
domain1.destroy();
261262
domain1.create();
262263

@@ -299,7 +300,7 @@ public void testCreateDomainWithStartPolicyAdminOnly() throws Exception {
299300
operator1 = TestUtils.createOperator(operator1File);
300301
}
301302
logger.info("Creating Domain domain6 & verifing the domain creation");
302-
// create domain6
303+
// create domain
303304
Domain domain = null;
304305
boolean testCompletedSuccessfully = false;
305306
try {
@@ -332,8 +333,8 @@ public void testCreateDomainPVReclaimPolicyRecycle() throws Exception {
332333
if (operator1 == null) {
333334
operator1 = TestUtils.createOperator(operator1File);
334335
}
335-
logger.info("Creating Domain domain7 & verifing the domain creation");
336-
// create domain7
336+
logger.info("Creating Domain domain & verifing the domain creation");
337+
// create domain
337338
Domain domain = null;
338339

339340
try {

integration-tests/src/test/resources/domainadminonly.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Copyright 2018, Oracle Corporation and/or its affiliates. All rights reserved.
22
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
33

4+
# This domain inputs file is used to create domain on pv using wlst option and server start policy ADMIn_ONLY
5+
46
adminServerName: admin-server
57
domainUID: domainadminonly
68
clusterName: cluster-1

integration-tests/src/test/resources/domainonpvwdt.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Copyright 2018, Oracle Corporation and/or its affiliates. All rights reserved.
22
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
33

4+
# This domain inputs file is used to create domain on pv using wdt option.
5+
46
adminServerName: admin-server
57
domainUID: domainonpvwdt
68
clusterName: cluster-1

integration-tests/src/test/resources/domainonpvwlst.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Copyright 2018, Oracle Corporation and/or its affiliates. All rights reserved.
22
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
33

4+
# This domain inputs file is used to create domain on pv using wlst option and traefik load balancer.
5+
46
adminServerName: admin-server
57
domainUID: domainonpvwlst
68
clusterName: cluster-1

integration-tests/src/test/resources/domainrecyclepolicy.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Copyright 2018, Oracle Corporation and/or its affiliates. All rights reserved.
22
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
33

4+
# This domain inputs file is used to create domain on pv using wlst option and with recyle reclaim policy.
5+
46
adminServerName: admin-server
57
domainUID: domainrecyclepolicy
68
clusterName: cluster-1
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Copyright 2018, Oracle Corporation and/or its affiliates. All rights reserved.
22
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
33

4+
# This domain inputs file is used to create domain using default values from samples for most of the input values
5+
46
domainUID: domainsampledefaults
57
configuredManagedServerCount: 4

0 commit comments

Comments
 (0)