We should add a test tier between unit tests and the GCE suite that can be run locally.
NPD currently has two test tiers:
- Unit tests
- GCE e2e tests (Prow)
The e2e suite today only asserts against a local metrics endpoint on a GCE VM; yet, we cannot easily run the same functionality locally. This is because make e2e-test requires a GCP project, a zone, an image, and SSH keys. Not all important behaviors are unit-testable, and having the ability to run e2e tests locally will help author better improvements to NPD.
We should have two additional forms of testing to enable local e2e testing:
| Form |
What it covers |
Sketch |
| Process-level |
log parsing through condition/event |
run NPD against fixed log files and assert emitted events against a local fake apiserver ( via --apiserver-override) |
| KIND |
DaemonSet lifecycle, NodeCondition transitions |
run NPD as a DaemonSet in a KIND cluster and inject faults, assert conditions and cleanup on shutdown |
This pattern is the standard in other Kubernetes repositories. Kubernetes has an integration test tier and only merges PRs when unit, integration, and e2e tests all pass (https://github.com/kubernetes/community/blob/master/contributors/devel/sig-testing/testing.md). Furthermore, cert-manager and cilium run KIND-based e2e locally as well.
Together with #1328, this allows extensive coverage of NPD behavior before reaching a VM.
/sig node
/kind cleanup
We should add a test tier between unit tests and the GCE suite that can be run locally.
NPD currently has two test tiers:
The e2e suite today only asserts against a local metrics endpoint on a GCE VM; yet, we cannot easily run the same functionality locally. This is because
make e2e-testrequires a GCP project, a zone, an image, and SSH keys. Not all important behaviors are unit-testable, and having the ability to run e2e tests locally will help author better improvements to NPD.We should have two additional forms of testing to enable local e2e testing:
This pattern is the standard in other Kubernetes repositories. Kubernetes has an integration test tier and only merges PRs when unit, integration, and e2e tests all pass (https://github.com/kubernetes/community/blob/master/contributors/devel/sig-testing/testing.md). Furthermore, cert-manager and cilium run KIND-based e2e locally as well.
Together with #1328, this allows extensive coverage of NPD behavior before reaching a VM.
/sig node
/kind cleanup