README
¶
Test
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:
Running unit tests
To run all unit tests:
go test ./...
By default go test
will not run the e2e tests,
which need -tags=e2e
to be enabled.
Running end to end tests
Environment requirements
Setting up a running Knative Build
cluster.
-
A Kubernetes cluster v1.10 or newer with the
MutatingAdmissionWebhook
admission controller enabled.kubectl
v1.10 is also required. see here -
Configure
ko
to point to your registry. see here
Go e2e tests
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.
YAML e2e tests
To run the YAML e2e tests, you need to have a running environment that meets the e2e test environment requirements.
./test/e2e-tests-yaml.sh
One test case
To 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>