|
32 | 32 | external/ External plugin support |
33 | 33 | docs/book/ mdBook sources + tutorial samples |
34 | 34 | test/ |
35 | | - e2e/ End-to-end tests (v4, helm, deployimage, alpha*) |
| 35 | + e2e/ End-to-end tests requiring Kubernetes cluster (v4, helm, deployimage) |
36 | 36 | testdata/ Testdata generation scripts |
37 | 37 | testdata/ Generated sample projects (DO NOT EDIT) |
38 | 38 | hack/docs/ Documentation generation scripts |
@@ -82,8 +82,7 @@ make lint-fix # Auto-fix Go code |
82 | 82 | ### Testing |
83 | 83 | ```bash |
84 | 84 | make test-unit # Fast unit tests (./pkg/..., ./test/e2e/utils/...) |
85 | | -make test-integration # Integration tests |
86 | | -make test-features # Feature tests |
| 85 | +make test-integration # Integration tests (may create temp dirs, download binaries) |
87 | 86 | make test-testdata # Test all testdata projects |
88 | 87 | make test-e2e-local # Full e2e (creates kind cluster) |
89 | 88 | make test # CI aggregate (all of above + license) |
@@ -191,6 +190,17 @@ kubebuilder alpha update # Update to latest plugin versions |
191 | 190 | - Use **Ginkgo v2** + **Gomega** for BDD-style tests. |
192 | 191 | - Tests depending on the Kubebuilder binary should use: `utils.NewTestContext(util.KubebuilderBinName, "GO111MODULE=on")` |
193 | 192 |
|
| 193 | +### Test Organization |
| 194 | +- **Unit tests** (`*_test.go` in `pkg/`) - Test individual packages in isolation, fast |
| 195 | +- **Integration tests** (`*_integration_test.go` in `pkg/`) - Test multiple components together without cluster |
| 196 | + - Must have `//go:build integration` tag at the top |
| 197 | + - May create temp dirs, download binaries, or scaffold files |
| 198 | + - Examples: alpha update, grafana scaffolding, helm chart generation |
| 199 | +- **E2E tests** (`test/e2e/`) - **ONLY** for tests requiring a Kubernetes cluster (KIND) |
| 200 | + - `v4/plugin_cluster_test.go` - Test v4 plugin deployment |
| 201 | + - `helm/plugin_cluster_test.go` - Test Helm chart deployment |
| 202 | + - `deployimage/plugin_cluster_test.go` - Test deploy-image plugin |
| 203 | + |
194 | 204 | ### Scaffolding |
195 | 205 | - Use library helpers from `pkg/plugin/util/` |
196 | 206 | - Use markers for extensibility |
|
0 commit comments