You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: integration-tests/README.md
+51-35Lines changed: 51 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,16 @@
1
1
# Integration Tests for Oracle WebLogic Server Kubernetes Operator
2
2
3
-
This documentation describes the functional use cases that are covered in integration testing for the Oracle WebLogic Server Kubernetes Operator. The tests are written in Java (JUnit tests) and driven by Maven profile.
3
+
This documentation describes the functional use cases that are covered in integration testing for the Oracle WebLogic Server Kubernetes Operator. The tests are written in Java (JUnit tests) and driven by Maven profile.
4
4
5
5
# Environments
6
6
7
-
The tests currently run 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".
7
+
The tests currently run 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".
8
8
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/ - Jenkins Run is restricted to Oracle Internal development Process
9
+
* "Standalone" Oracle Linux, i.e, run the tests manually with the `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/ - Jenkins Run is restricted to Oracle Internal development process.
12
12
13
-
Wercker runs only Quick test use cases, Jenkins run both Quick and Full test use cases.
13
+
Wercker runs only Quick test use cases, Jenkins runs both Quick and Full test use cases.
14
14
15
15
# Use Cases
16
16
@@ -20,27 +20,28 @@ Quick test Configuration & Use Cases -
20
20
21
21
|||
22
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 |
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
25
26
26
Basic Use Cases
27
27
28
-
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
29
-
2.create domain domain1 in default namespace and verify the pods, services are created and servers are in Ready
30
-
3.verify admin external service by accessing admin REST endpoint with nodeport in URL
31
-
4.verify admin t3 channel port by exec into the admin pod and deploying webapp using the channel port for WLST
32
-
5.verify web app load balancing by accessing the webapp using loadBalancerWebPort
28
+
1.Create operator `operator1` which manages `default` and `test1` namespaces, verify it's deployed successfully, pods created, operator ready and verify external REST service, if configured.
29
+
2.Create domain `domain1` in `default` namespace and verify the pods, services are created and servers are in ready state.
30
+
3.Verify the admin external service by accessing the admin REST endpoint with `nodeport` in URL.
31
+
4.Verify admin t3 channel port by exec into the admin pod and deploying webapp using the channel port for WLST.
32
+
5.Verify web app load balancing by accessing the webapp using `loadBalancerWebPort`.
33
33
34
34
Advanced Use Cases
35
35
36
-
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
37
-
7.cluster scale up/down using Operator REST endpoint, webapp load balancing should adjust accordingly.
38
-
8. Operator life cycle(destroy and create) should not impact the running domain
36
+
6.Verify domain life cycle(destroy and create) should not have any impact on operator managing the domain and web app load balancing and admin external service.
37
+
7.Cluster scale up/down using operator REST endpoint, webapp load balancing should adjust accordingly.
38
+
8. Operator life cycle(destroy and create) should not impact the running domain.
39
39
40
-
Also the below use cases are covered for Quick test
40
+
Also the below use cases are covered for Quick test:
41
+
42
+
9. Verify the liveness probe by killing managed server 1 process 3 times to kick pod auto-restart.
43
+
10. Shutdown the domain by changing domain `serverStartPolicy` to `NEVER`.
41
44
42
-
9. verify liveness probe by killing managed server 1 process 3 times to kick pod auto-restart
43
-
10. shutdown the domain by changing domain serverStartPolicy to NEVER
44
45
45
46
Full test Configuration & Use Cases - Runs Quick test Configuration & Use cases and the below
46
47
@@ -68,22 +69,22 @@ Basic Use Cases described above are verified in all the domain configurations. A
68
69
69
70
Directory structure of source code:
70
71
71
-
A new module "integration-tests" is added to the Maven project weblogic-kubernetes-operator.
72
+
A new module "integration-tests" is added to the Maven project `weblogic-kubernetes-operator`.
72
73
73
-
weblogic-kubernetes-operator/integration-tests - location of module pom.xml
74
-
weblogic-kubernetes-operator/integration-tests/src/test/java - integration test(JUnit) classes and utility classes
75
-
weblogic-kubernetes-operator/integration-tests/src/test/resources - properties, yaml files(see Configuration Files section) and other scripts
74
+
`weblogic-kubernetes-operator/integration-tests` - location of module pom.xml
75
+
`weblogic-kubernetes-operator/integration-tests/src/test/java` - integration test(JUnit) classes and utility classes
76
+
`weblogic-kubernetes-operator/integration-tests/src/test/resources` - properties, YAML files(see Configuration Files section) and other scripts.
76
77
77
78
Directory structure used for the test run:
78
79
79
-
Main external env vars:
80
+
Main external `env vars`:
80
81
81
82
| Variable | Description |
82
83
| --- | --- |
83
84
| RESULT_ROOT | Root path for local test files. |
84
85
| PV_ROOT | Root NFS path behind PV/C directories. This must have permissions suitable for WL pods to add files |
85
86
86
-
Defaults for RESULT_ROOT & PV_ROOT:
87
+
Defaults for `RESULT_ROOT` & `PV_ROOT`:
87
88
88
89
| Test Mode | RESULT_ROOT | PV_ROOT | Where initialized |
89
90
| --- | --- | --- | --- |
@@ -175,7 +176,7 @@ Integration test classes:
175
176
176
177
When the integration test class ITOperator is executed, staticPrepare() method is called once before any of the test methods in the class and staticUnPrepare() method once at the end.
177
178
178
-
staticPrepare() - initializes the application properties from OperatorIT.properties and creates resultRoot, pvRoot, userprojectsDir directories by calling initialize() method from the base class BaseTest.
179
+
staticPrepare() - initializes the application properties from OperatorIT.properties and creates resultRoot, pvRoot, userprojectsDir directories by calling initialize() method from the base class BaseTest.
179
180
180
181
staticUnPrepare() - releases the cluster lease on wercker env.
@@ -311,7 +312,7 @@ $RESULT_ROOT/acceptance_test_tmp is archived under $RESULT_ROOT/acceptance_test_
311
312
312
313
$PV_ROOT/acceptance_test_pv is archived under $PV_ROOT/acceptance_test_pv_archive
313
314
314
-
On Wercker, these logs can be downloaded by clicking "Download artifact" on cleanup and store step.
315
+
On Wercker, these logs can be downloaded by clicking "Download artifact" on cleanup and store step.
315
316
316
317
# How to add a new test
317
318
@@ -324,3 +325,18 @@ ITOperator.java - take a look at this test for reference
324
325
# Future enhancement
325
326
326
327
Add functional tests
328
+
329
+
## Troubleshooting
330
+
331
+
The integration tests are not completely independent of the environment.
332
+
333
+
You may run into one or more of the following errors when you attempt to execute the command:
334
+
```
335
+
mvn clean verify -P java-integration-tests 2>&1 | tee log.txt
336
+
```
337
+
1.`[ERROR] No permision to create directory /scratch/...`
338
+
339
+
There are a couple ways to resolve this issue:
340
+
341
+
* Create a world writable directory named `/scratch`.
342
+
* Create some other world writable directory and then define the environment variables `RESULT_ROOT` and `PV_ROOT` to point to that directory. If you want, you can create two directories to keep things separated. See [Directory Configuration and Structure](#directory-configuration-and-structure) for more details.
0 commit comments