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
This document describes how you can use the Kubernetes command-line integration test-suite.
4
+
5
+
## Running Tests
6
+
7
+
### All Tests
8
+
9
+
To run this entire suite, execute `make test-cmd` from the top level. This will import each file containing tests functions
10
+
11
+
### Specific Tests
12
+
13
+
To run a subset of tests (e.g. `run_deployment_test` and `run_impersonation_test`), execute `make test-cmd WHAT="deployment impersonation"`. Running specific
14
+
tests will not try and validate any required resources are available on the server.
15
+
16
+
## Adding Tests
17
+
18
+
Test functions need to have the format `run_*_test` so they can executed individually. Once a test has been added, insert a section in `legacy-script.sh` like
19
+
20
+
```bash
21
+
######################
22
+
# Replica Sets #
23
+
######################
24
+
25
+
if kube::test::if_supports_resource "${replicasets}";then
26
+
record_command run_rs_tests
27
+
fi
28
+
```
29
+
30
+
Be sure to validate any supported resouces required for the test by using the `kube::test::if_supports_resource` function.
31
+
32
+
33
+
### New File
34
+
35
+
If the test resides in a new file, source the file in the top of the `legacy-script.sh` file by adding a new line in
36
+
```bash
37
+
source"${KUBE_ROOT}/test/cmd/apply.sh"
38
+
source"${KUBE_ROOT}/test/cmd/apps.sh"
39
+
source"${KUBE_ROOT}/test/cmd/authorization.sh"
40
+
source"${KUBE_ROOT}/test/cmd/batch.sh"
41
+
...
42
+
```
43
+
44
+
Please keep the order of the source list alphabetical.
0 commit comments