On all PRs, a suite of static and cluster tests is run against your changes in a CI environment. These tests can also be run locally, which is discussed below.
Static tests consist of unit, formatting, and doc link tests.
Cluster tests consist of several test types:
- End-to-end (e2e): simulate the “happy path” usage of the
operator-sdkbinary and resulting operator project.
- Integration: test components of the
operator-sdkbinary and features of scaffolded projects that are bound to external projects, such as OLM.
- Subcommand: ensure individual subcommands function as intended with a variety of input options.
Local Test Environment
If running tests locally, access to a Kubernetes cluster of server version v1.11.3 or higher is required.
These tests require
KUBECONFIG be set or kubeconfig file be present in a default location like
You will also need to set up an
envtest environment for cluster tests. Follow this doc
for setup instructions.
On any PR, the entire test suite is run against your changes in a CI environment. Therefore it is advantageous to run all tests before pushing changes to the remote repo:
make test-sanity test-links test-unit test-subcommand test-integration test-e2e
All the tests are run through the
make help for a full list of available tests.