Skip to content

Commit 37029b6

Browse files
Update README.md
1 parent 0076ec5 commit 37029b6

File tree

1 file changed

+44
-50
lines changed

1 file changed

+44
-50
lines changed

integration-tests/README.md

Lines changed: 44 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,44 @@
11
# Integration Tests for Operator
22

3-
This documentation describes the functional use cases that are covered in integration testing for Weblogic Operator. The tests are written in java(Junit tests) and driven by maven profile. Currently, run.sh is used to run integration tests for Operator. All the use cases covered in run.sh will be covered in java integration tests. Currently, QUICK_TEST use cases and some of non-quick test(till domain4) use cases are covered in java tests.
3+
This documentation describes the functional use cases that are covered in integration testing for Weblogic Operator. The tests are written in java(Junit tests) and driven by maven profile. Currently run.sh is used to run integration tests for Operator. All the use cases covered in run.sh will be covered in java integration tests. Currently, QUICK_TEST use cases and some of non-quick test(till domain4) use cases are covered in java tests.
44

55
# Environments
66

77
The tests currently runs in three modes, "Wercker", "Jenkins", and "standalone" Oracle Linux, where the mode is controlled by the WERCKER and JENKINS environment variables described below. The default is "standalone".
88

9-
"Standalone" Oracle Linux, i.e, run the tests manually with mvn command.
10-
Wercker - https://app.wercker.com/Oracle/weblogic-kubernetes-operator/runs - integration-test-java is the pipeline name
11-
Jenkins - http://wls-jenkins.us.oracle.com/view/weblogic-operator/job/weblogic-kubernetes-operator-javatest/
9+
* "Standalone" Oracle Linux, i.e, run the tests manually with mvn command.
10+
* Wercker - https://app.wercker.com/Oracle/weblogic-kubernetes-operator/runs - integration-test-java is the pipeline name
11+
* Jenkins - http://wls-jenkins.us.oracle.com/view/weblogic-operator/job/weblogic-kubernetes-operator-javatest/
1212

1313
# Use Cases
1414

1515
Currently java integration tests cover only QUICK_TEST use cases from run.sh. The below are the use cases:
1616

17-
create operator operator1 which manages default and test1 namespaces, verify its deployed successfully, pod created, operator Ready and verify external REST service if configured
18-
create domain domain1 in default namespace and verify the pods, services are created and servers are in Ready
19-
verify admin external service by accessing admin REST endpoint with nodeport in URL
20-
verify admin t3 channel port by exec into the admin pod and deploying webapp using the channel port for WLST
21-
verify web app load balancing – TO DO, Apache, Voyager
22-
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
23-
cluster scale up/down using Operator REST endpoint, webapp load balancing should adjust accordingly. (run.sh does scaling by editing the replicas in domain-custom-resource.yaml.)
24-
Operator life cycle(destroy and create) should not impact the running domain
17+
* create operator operator1 which manages default and test1 namespaces, verify its deployed successfully, pod created, operator Ready and verify external REST service if configured
18+
* create domain domain1 in default namespace and verify the pods, services are created and servers are in Ready
19+
* verify admin external service by accessing admin REST endpoint with nodeport in URL
20+
* verify admin t3 channel port by exec into the admin pod and deploying webapp using the channel port for WLST
21+
* verify web app load balancing – TO DO, Apache, Voyager
22+
* 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
23+
* cluster scale up/down using Operator REST endpoint, webapp load balancing should adjust accordingly. (run.sh does scaling by editing the replicas in domain-custom-resource.yaml.)
24+
* Operator life cycle(destroy and create) should not impact the running domain
2525

2626
Non-quick test use cases
2727

28-
keep the first domain and operator running
29-
create another domain domain2 in default namespace and verify the domain by doing the checks 2 - 5 listed in quick test
30-
destroy domain domain2
31-
create another domain domain3 in test1 namespace and verify the domain by doing the checks 2 - 5 listed in quick test
32-
destroy domain domain3
33-
create another operator operator2 which manages test2 namespace and verify domain1 is not affected
34-
create another domain domain4 in test2 namespace and verify the domain by doing the checks 2 - 5 listed in quick test
35-
verify scaling for domain4 cluster from 2 to 3 servers and back to 2, plus verify no impact on domain1
36-
cycle domain1 down and back up, plus verify no impact on domain4
37-
38-
create domain5 in the default namespace with startupControl="ADMIN", and verify that only admin server is created. on Jenkins, this domain will also test NFS instead of HOSTPATH PV storage – all the remaining use cases are covered in QA functional tests, so not adding these tests or will be added later.
39-
40-
create domain6 in the default namespace with pvReclaimPolicy="Recycle", and verify that the PV is deleted once the domain and PVC are deleted
41-
42-
test managed server 1 pod auto-restart in domain1
43-
44-
destroy domain1
45-
46-
test that create domain fails when its pv is already populated by a shutdown domain
28+
* keep the first domain and operator running
29+
* create another domain domain2 in default namespace and verify the domain by doing the checks 2 - 5 listed in quick test
30+
* destroy domain domain2
31+
* create another domain domain3 in test1 namespace and verify the domain by doing the checks 2 - 5 listed in quick test
32+
* destroy domain domain3
33+
* create another operator operator2 which manages test2 namespace and verify domain1 is not affected
34+
* create another domain domain4 in test2 namespace and verify the domain by doing the checks 2 - 5 listed in quick test
35+
* verify scaling for domain4 cluster from 2 to 3 servers and back to 2, plus verify no impact on domain1
36+
* cycle domain1 down and back up, plus verify no impact on domain4
37+
* create domain5 in the default namespace with startupControl="ADMIN", and verify that only admin server is created. on Jenkins, this domain will also test NFS instead of HOSTPATH PV storage
38+
* create domain6 in the default namespace with pvReclaimPolicy="Recycle", and verify that the PV is deleted once the domain and PVC are deleted
39+
* test managed server 1 pod auto-restart in domain1
40+
* destroy domain1
41+
* test that create domain fails when its pv is already populated by a shutdown domain
4742

4843

4944
# Directory Configuration and Structure
@@ -62,8 +57,8 @@ Directory structure used for the test run:
6257

6358
Main external env vars:
6459

65-
RESULT_ROOT Root path for local test files.
66-
PV_ROOT Root NFS path behind PV/C directories. This must have permissions suitable for WL pods to add files (default UID 1000 group ???)
60+
| RESULT_ROOT | Root path for local test files. |
61+
| PV_ROOT | Root NFS path behind PV/C directories. This must have permissions suitable for WL pods to add files |
6762

6863
Defaults for RESULT_ROOT & PV_ROOT:
6964

@@ -83,40 +78,39 @@ Defaults for RESULT_ROOT & PV_ROOT:
8378
RESULT_ROOT/acceptance_test_tmp_archive/...
8479

8580
'Logical' to 'Physical' K8S PV/PVC mappings:
86-
'Logical' 'Actual'
87-
job.sh job: /scratch <--> PV_ROOT on K8S machines
88-
domain pod: /shared <--> PV_ROOT/acceptance_test_pv/persistentVolume-${domain_uid} on K8S machines
81+
| 'Logical' | 'Actual' |
82+
| --- | --- |
83+
| job.sh job: | /scratch <--> PV_ROOT on K8S machines |
84+
| domain pod: | /shared <--> PV_ROOT/acceptance_test_pv/persistentVolume-${domain_uid} on K8S machines |
8985

9086
# Configuration Files
9187

9288
A module "integration-tests" is added in maven weblogic-kubernetes-operator project.
9389

9490
Below configuration files are used:
91+
```
9592
src/integration-tests/resources/OperatorIT.properties - This file is used for configuring common attributes for all integration tests
93+
```
9694
baseDir=/scratch
97-
#wls admin user
9895
username=weblogic
9996
password=welcome1
10097
maxIterationsPod=50
10198
waitTimePod=5
10299

103-
src/integration-tests/resources/ITFirstOperator.properties - customized properties for operator
104-
#any property can be provided here from create-weblogic-operator-inputs.yaml
105-
#for all the properties that are not defined here, the default values in create-weblogic-operator-inputs.yaml
106-
# used while generating the operator inputs yaml file
100+
src/integration-tests/resources/ITFirstOperator.properties - customized properties for operator. Any property can be provided here from create-weblogic-operator-inputs.yaml, for all the properties that are not defined here default values in create-weblogic-operator-inputs.yaml are used while generating the operator inputs yaml file.
107101

102+
```
108103
serviceAccount= weblogic-operator
109104
namespace= weblogic-operator1
110105
targetNamespaces= default
111106
#if SELF_SIGNED_CERT, externalSans value is set to the local host name if not provided here
112107
externalRestOption= SELF_SIGNED_CERT
113108
elkIntegrationEnabled= false
109+
```
114110

115-
src/integration-tests/resources/ITFirstDomain.properties - customized properties for domain
116-
#any property can be provided here from create-weblogic-domain-inputs.yaml
117-
#for all the properties that are not defined here, the default values in create-weblogic-domain-inputs.yaml are
118-
# used while generating the domain inputs yaml file
111+
src/integration-tests/resources/ITFirstDomain.properties - customized properties for domain. Any property can be provided here from create-weblogic-domain-inputs.yaml. For all the properties that are not defined here, the default values in create-weblogic-domain-inputs.yaml are used while generating the domain inputs yaml file.
119112

113+
```
120114
adminServerName= admin-server
121115
domainName= base_domain
122116
domainUID= domain1
@@ -133,6 +127,7 @@ exposeAdminNodePort= true
133127
namespace= default
134128
javaOptions= -Dweblogic.StdoutDebugEnabled=false
135129
130+
```
136131
Certain properties like weblogicDomainStoragePath, weblogicOperatorImage, externalSans are populated at run time.
137132

138133

@@ -154,7 +149,6 @@ test methods - testAdminServerExternalService, testAdminT3Channel, testDomainLif
154149
Utility classes:
155150

156151
Operator - contains methods to create/destroy operator, verify operator created, scale using rest api, etc
157-
158152
Domain - contains methods to create/destroy domain, verify domain created,deploy webapp, load balancing, etc
159153
PersistentVolume - to create PV
160154
Secret - to create secret
@@ -216,7 +210,7 @@ WERCKER=true:
216210
mvn clean verify -P java-integration-tests 2>&1 | tee log.txt
217211

218212
Successful run will have the output like below:
219-
213+
```
220214
[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 970.765 s - in oracle.kubernetes.operator.ITSingleDomain
221215
[INFO]
222216
[INFO] Results:
@@ -246,9 +240,9 @@ Successful run will have the output like below:
246240
[INFO] ------------------------------------------------------------------------
247241
bash-4.2$
248242
249-
243+
```
250244
Failed run will have the output
251-
245+
```
252246
[ERROR] Tests run: 5, Failures: 0, Errors: 3, Skipped: 0, Time elapsed: 1,271.204 s <<< FAILURE! - in oracle.kubernetes.operator.ITSingleDomain
253247
[ERROR] testAdminT3Channel(oracle.kubernetes.operator.ITSingleDomain) Time elapsed: 145.59 s <<< ERROR!
254248
java.lang.RuntimeException: FAILURE: testwebapp did not return 200 status code, got 404
@@ -294,7 +288,7 @@ java.lang.RuntimeException: FAILURE: testwebapp did not return 200 status code,
294288
[ERROR] Please refer to /scratch/vmukkara/mychanges/weblogic-kubernetes-operator/integration-tests/target/failsafe-reports for the individual test results.
295289
[ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream
296290
297-
291+
```
298292
Junit test results can be seen at "integration-tests/target/failsafe-reports/TEST-oracle.kubernetes.operator.ITSingleDomain.xml". This file shows how much time each test case took to run and the failed test results if any.
299293

300294
# Logging/Archiving

0 commit comments

Comments
 (0)