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
tests/chainsaw/ # Chainsaw E2E test suites (label-application, label-truncation, node-observer, slinky)
45
46
config/ # Sample topograph-config.yaml
46
47
scripts/ # Build scripts (deb, rpm, SSL, clean)
47
48
localdev/ # Developer-local workspace — not tracked; personal scratch files
@@ -94,6 +95,20 @@ make coverage # human-readable per-package summary
94
95
95
96
Run `make qualify` before pushing. The individual targets are available if you want to run a single check during iteration. Run `make chart-test` when you change `charts/topograph/` or its subcharts; CI runs it on every workflow trigger.
96
97
98
+
### E2E tests (Chainsaw)
99
+
100
+
Chainsaw conformance tests live in `tests/chainsaw/` and exercise the full Helm deploy → generate → assert cycle against a real cluster.
101
+
102
+
```bash
103
+
make e2e-local # build image, create kind cluster, run all suites, delete cluster
104
+
make kind-load KIND_CLUSTER=<name># load image into an existing kind cluster (run before make e2e)
105
+
make e2e # run suites against current KUBECONFIG context
106
+
```
107
+
108
+
`make e2e` uses `E2E_IMAGE_TAG` (defaults to the short commit SHA) as the image tag. For a local kind cluster, run `make image-build && make kind-load KIND_CLUSTER=<name>` before each `make e2e` — the tag changes with every commit, so both steps are needed after any new commit. Prerequisites: `chainsaw`, `kind`, `helm`, `kubectl`, `docker`. See `tests/chainsaw/README.md` for details.
109
+
110
+
These tests are triggered manually via `.github/workflows/e2e.yml` (`workflow_dispatch`). Run them before merging changes to the Helm chart, Node Observer, or engine output.
111
+
97
112
### Coverage policy
98
113
99
114
From `codecov.yml`:
@@ -109,6 +124,7 @@ Coverage checks run on pull requests. A drop below target with no matching uplif
tests/chainsaw/ # Chainsaw E2E test suites (label-application, label-truncation, node-observer, slinky)
45
46
config/ # Sample topograph-config.yaml
46
47
scripts/ # Build scripts (deb, rpm, SSL, clean)
47
48
localdev/ # Developer-local workspace — not tracked; personal scratch files
@@ -94,6 +95,20 @@ make coverage # human-readable per-package summary
94
95
95
96
Run `make qualify` before pushing. The individual targets are available if you want to run a single check during iteration. Run `make chart-test` when you change `charts/topograph/` or its subcharts; CI runs it on every workflow trigger.
96
97
98
+
### E2E tests (Chainsaw)
99
+
100
+
Chainsaw conformance tests live in `tests/chainsaw/` and exercise the full Helm deploy → generate → assert cycle against a real cluster.
101
+
102
+
```bash
103
+
make e2e-local # build image, create kind cluster, run all suites, delete cluster
104
+
make kind-load KIND_CLUSTER=<name># load image into an existing kind cluster (run before make e2e)
105
+
make e2e # run suites against current KUBECONFIG context
106
+
```
107
+
108
+
`make e2e` uses `E2E_IMAGE_TAG` (defaults to the short commit SHA) as the image tag. For a local kind cluster, run `make image-build && make kind-load KIND_CLUSTER=<name>` before each `make e2e` — the tag changes with every commit, so both steps are needed after any new commit. Prerequisites: `chainsaw`, `kind`, `helm`, `kubectl`, `docker`. See `tests/chainsaw/README.md` for details.
109
+
110
+
These tests are triggered manually via `.github/workflows/e2e.yml` (`workflow_dispatch`). Run them before merging changes to the Helm chart, Node Observer, or engine output.
111
+
97
112
### Coverage policy
98
113
99
114
From `codecov.yml`:
@@ -109,6 +124,7 @@ Coverage checks run on pull requests. A drop below target with no matching uplif
Copy file name to clipboardExpand all lines: docs/engines/k8s.md
+46Lines changed: 46 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -344,6 +344,52 @@ tests:
344
344
enabled: false
345
345
```
346
346
347
+
### Conformance testing with Chainsaw
348
+
349
+
`helm test`verifies that a deployed instance is healthy. To verify that the engine actually **applies correct topology labels** to nodes, use the Chainsaw E2E suite in `tests/chainsaw/`.
350
+
351
+
[Chainsaw](https://kyverno.github.io/chainsaw/) is Kyverno's declarative E2E framework. Each suite drives `apply → wait → assert → cleanup` against a real cluster using the built-in **test provider** — no cloud credentials required.
352
+
353
+
#### Test suites
354
+
355
+
| Suite | What it checks |
356
+
|---|---|
357
+
| `k8s/label-application` | `leaf`, `spine`, and `accelerator` labels applied to nodes after generation |
358
+
| `k8s/label-truncation` | Switch names >63 chars replaced with an FNV64a hash (valid label value) |
359
+
| `k8s/node-observer` | Node Observer auto-triggers generation when it starts and detects the fake node objects |
360
+
| `slinky/configmap-output` | Slinky engine writes correct `topology.conf` into a ConfigMap |
361
+
362
+
#### How suites map topology to nodes
363
+
364
+
Each suite ships a `topology-model.yaml` in its directory. The suite creates
365
+
fake K8s Node objects whose names match the node IDs in that file, loads the
366
+
file into a ConfigMap, and mounts it at `/etc/topograph/models/` inside the
367
+
pod. The `/v1/generate` request passes `modelFileName` pointing at the mounted
# Full lifecycle — build, create cluster, run all suites, delete cluster:
376
+
make e2e-local
377
+
378
+
# Against an existing local kind cluster (repeat after each commit):
379
+
make image-build # rebuild with the current commit SHA tag
380
+
make kind-load KIND_CLUSTER=<cluster-name> # load into the cluster
381
+
make e2e
382
+
383
+
# Single suite only:
384
+
chainsaw test --test-dir tests/chainsaw/k8s/label-application
385
+
```
386
+
387
+
See `tests/chainsaw/README.md` for full prerequisites and environment variable reference.
388
+
389
+
#### Running in CI
390
+
391
+
The `.github/workflows/e2e.yml` workflow runs on `workflow_dispatch`. Trigger it manually from the GitHub UI before merging changes to the Helm chart, Node Observer, or engine output code paths.
392
+
347
393
### Chart README
348
394
349
395
For installation, prerequisites, values reference, and configuration examples, see [`charts/topograph/README.md`](../../charts/topograph/README.md) — also surfaced via `helm show readme topograph/topograph`.
0 commit comments