This directory contains tests and testing docs for Knative Build:
- Unit tests currently reside in the codebase alongside the code they test
- End-to-end tests, of which there are two types:
To run all unit tests:
go test ./...By default go test will not run the e2e tests,
which need -tags=e2e to be enabled.
Setting up a running Knative Build cluster.
-
A Kubernetes cluster v1.10 or newer with the
MutatingAdmissionWebhookadmission controller enabled.kubectlv1.10 is also required. see here -
Configure
koto point to your registry. see here
To run the Go e2e tests, you need to have a running environment that meets the e2e test environment requirements and stand up a version of this controller on-cluster.
Finally run the Go e2e tests with the build tag e2e.
go test -v -tags=e2e -count=1 ./test/e2e/...-count=1 is the idiomatic way to bypass test caching, so that tests will
always run.
To run the YAML e2e tests, you need to have a running environment that meets the e2e test environment requirements.
./test/e2e-tests-yaml.shTo run one e2e test case, e.g. TestSimpleBuild, use
the -run flag with go test:
go test -v -tags=e2e -count=1 ./test/e2e/... -run=<regex>