test/

directory
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2019 License: Apache-2.0

README

Test

This directory contains tests and testing docs for Knative Build:

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.

  1. A Kubernetes cluster v1.10 or newer with the MutatingAdmissionWebhook admission controller enabled. kubectl v1.10 is also required. see here

  2. 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>

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL