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: e2e/README.MD
+21-51
Original file line number
Diff line number
Diff line change
@@ -1,68 +1,38 @@
1
1
# E2E Framework
2
2
3
-
The E2E framework uses Kuttl under the hood. Kuttl is a simple and most importantly static tool.
4
-
That means there is no way to dynamically generate manifests.
5
-
The solution is KIK (Kuttl-In-Kuttl)!
3
+
The E2E framework uses Kuttl under the hood. Kuttl is a simple and most importantly static tool that handles applying manifests for running assertions in a namespace it generates for each test.
6
4
7
-
## Kuttl-In-Kuttl
5
+
In order to dynamically generate manifests, Kuttl supports declaring a `TestStep` manifest which includes an option for running scripts. This allows us apply manifests with dynamic values from stdin.
8
6
9
-
## How does it work
7
+
Additionally, helper functions can be invoked in the scripts by creating a Makefile in each test folder that references `../../Makefile` (i.e. `e2e/Makefile`).
10
8
11
-
- Instead of creating a static Kuttl manifest, you can create template. Template extension must be `.yml` otherwise Kuttl starts executing it.
12
-
- Template is rendered via `envsubst`, so you can use Bash variables for dynamic data injection.
- Helper tools are available, please create a Makefile in your test folder. In this way you can use built in helpers without including any script in the test, plus this file is a good place for test specific helpers.
35
-
36
-
Example Makefile
37
-
```makefile
38
-
include ../../Makefile
39
-
```
40
-
41
-
- Template is nothing without a runner, please use helpers provided in Makefile to render and run template.
42
-
43
-
Example template runner
44
11
```yaml
45
12
apiVersion: kuttl.dev/v1beta1
46
13
kind: TestStep
47
14
commands:
48
15
- script: |-
49
-
MACHINE_UID="$(OBJ=machines/machine-sample make getKubeUid)" \
50
-
TS="$(TPL="$PWD/02-create-linodemachine.tpl.yml" make renderTestCase)" make runTestSuit
uid: $(OBJ=machines/machine-sample make getKubeUid)
25
+
name: linodemachine-sample
26
+
spec:
27
+
region: us-sea
28
+
type: g5-nanode-1
29
+
EOF
51
30
```
52
31
53
-
- You can run testsuits (which can contain template rendering).
54
-
55
-
Example testsuit runner:
56
-
```yaml
57
-
apiVersion: kuttl.dev/v1beta1
58
-
kind: TestStep
59
-
commands:
60
-
- script: TS="$PWD/testsuit" make runTestSuit
61
-
```
32
+
## Test Execution
62
33
63
-
- Test execution order is not guaranteed. If a test depends on another resource it is strongly suggested to create `assert` files to wait for an event. Almost every test depends on CAPI providers, so there is a good chance, you have to create a `00-assert.yaml` in your test folder.
34
+
Note that test execution order is not guaranteed. If a test depends on another resource it is strongly suggested to create `assert` files to wait for an event. Almost every test depends on CAPI providers, so there is a good chance you have to create a `00-assert.yaml` in your test folder that asserts the following:
0 commit comments