test

package
Version: v0.0.0-...-d88a328 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

README

Test

This directory contains tests and testing docs for Knative Observability:

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 Setup

Setting up a running Knative Observability cluster.

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

  2. Deploy Knative Observability components as mentioned in Deploying Sink Resources

Go e2e tests

Once the environment has been setup and the kubectl targeting the correct cluster, run the Go E2E tests with the build tag.

go test -v -tags=e2e -count=1 -race ./test/e2e/...

-count=1 is the idiomatic way to bypass test caching, so that tests will always run.

YAML e2e tests

These tests asserts the validation logic for applying the various sink CRDs.

./test/crd/test.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 -race ./test/e2e/... -run=TestSimpleBuild

Developing End to End Tests

The e2e tests are used to test whether the Knative Observability components are functioning.

The e2e tests MUST:

  1. Provide frequent output describing what actions they are undertaking, especially before performing long running operations.
  2. Follow Golang best practices.

Documentation

The Go Gopher

There is no documentation for this package.

Source Files

Jump to

Keyboard shortcuts

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