These are the checks and tests encouraged to be provided and maintained by the developers of a given operator. This is intentionally focusing on the bottom of the test pyramid.
-
A common set of static analysis tools, stylers, linters aggregated into a single pre-commit run both locally and in CI:
- go standard tools: fmt, vet, mod tidy
- golangci-lint: a meta linter with a tons of linters included but only a small subset enabled by default
- operator-lint: a home grew linter automating operator development and testing specific rules
Each operator can extend the list of linters but we need a common minimum set across each operators.
-
Unit tests covering functions or types using go’s standard testing lib and gomega
-
Component tests (also called functional or service tests) covering the reconciliation of a single CRD or a set of CRDs from the same operator using EnvTest
-
Integration test using kuttl on OCP
- Covering a single operator and its dependencies (e.g. placement-operator tests will depend on keystone-operator and mariadb-operator)
- Covering our integrated set of operators via openstack-operator
- Each PR changing implementation logic have to include relevant EnvTest coverage
- Each PR changing implementation logic targeting the network controllers have to include relevant EnvTest coverage.
-
Adding new functionality needs
- either EnvTest coverage if the logic is calling k8s APIs. For example job
- or unit test coverage if it isn't calling k8s APIs. For example conditions
Except for the
test
andtest-operators
modules as they are test helpers already.