The commands can be run concurrently, with the exception of e2e that has to be run after e2e-setup is done. The e2e target does not check whether cert-manager and the addons are installed. The two only scripts that were kept are: - make/e2e.sh (previously called ./devel/run-e2e.sh) - make/cluster.sh (previsouly called ./devel/cluster/create.sh) The reason for the removal of the other scripts is that they didn't have that much logic and could easily ported to Make, improving greatly the execution speed thanks to make's concurrency. make/e2e.sh now behaves "as expected" when using -ginkgo.focus or GINKGO_FOCUS; previously, the logs would not be shown before the end of the test. make/cluster.sh has lost the ability to create an OpenShift 3.11 cluster. for running the end-to-end tests. The two reasons are that OpenShift 4 wasn't supported by the script devel/cluster/create.sh, and OpenShift 3.11 is not supported by cert-manager anymore. The Makefile targets that were used in the Prow jobs (verify, verify_deps, verify_chart, verify_upgrade, and cluster) have been kept around. They now show a warning to encourage people to use the new Make-based targets. When running one of the deprecated targets the Makefile won't check the presence of the system tools such as Go and jq, since Bazel takes care of these dependencies. On version change, downloaded tools and images are re-downloaded. The command 'make clean' now keeps the downloaded images and tools. Note that a lot of attention has been put into having a Make system that works flawlessly both on Linux and on BSDs (such as macOS). You will note that some recursive calls to make are made, and $(MAKE) instead of plain "make" is used in that case. If we didn't use $(MAKE), we would have concurrency issues, and warnings such as: make[1]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule. Signed-off-by: Maël Valais <mael@vls.dev> |
||
|---|---|---|
| .. | ||
| config | ||
| base_images.mk | ||
| ci.mk | ||
| cluster.sh | ||
| cmctl.mk | ||
| containers.mk | ||
| e2e-setup.mk | ||
| e2e.sh | ||
| git.mk | ||
| help.mk | ||
| licenses.mk | ||
| manifests.mk | ||
| README.md | ||
| release.mk | ||
| server.mk | ||
| test.mk | ||
| tools.mk | ||
Development tooling
This directory contains tools and scripts used to create development and testing environments for cert-manager.
Tool dependencies
The scripts in this directory commonly require additional tooling, such as
access to kubectl, helm, kind and a bunch of other things.
If you already have these tools available on your host system, the scripts should just work, so long as the versions you have installed are roughly compatible.
If you are running into issues with your host-installed tools, you can
have them downloaded in bin/tools with the command:
# With "-j", the tools are downloaded in parallel.
make -j tools
To setup your shell to use the tools, run the following from the root of the repository:
export PATH="$PWD/bin/tools:$PATH"
Common usages
This section describes common usage patterns for development and testing.
Installing a development build of cert-manager
Once you have a kind cluster running, you can install a development version of cert-manager by running:
make -j e2e-setup-certmanager
This will create a kind cluster, build, load and install cert-manager from source into your kind development cluster.
Further invocations of this command will rebuild and upgrade the installed version of cert-manager, making it possible to iteratively work on the codebase and test changes.
Running end-to-end tests
Before running the end-to-end tests, you must install some additional components used during the tests into your kind cluster.
Run the following to setup cert-manager, Pebble, ingress-nginx, the sample DNS01 webhook and all the other components required for the end-to-end tests:
make -j e2e-setup
You only need to run this command once for the lifetime of your test cluster.
Finally, run the end-to-test tests using:
make e2e
You can run this command multiple times against the same cluster without adverse effects.
A common use-case is to run a single test case from the end-to-end tests.
This is explained in the --help:
./make/e2e.sh --help
Deleting the test cluster
Once you have finished with your testing environment, or if you have
encountered a strange state you cannot recover from, you can tear down the
testing environment by using kind directly:
kind delete cluster [--name=$KIND_CLUSTER_NAME]