Skip to content

Latest commit

 

History

History
71 lines (56 loc) · 3.28 KB

DEVELOPMENT.md

File metadata and controls

71 lines (56 loc) · 3.28 KB

Development

This doc explains how to setup a development environment so you can get started contributing to Knative net-gateway-api.

Before submitting a PR, see also:

Notes

If you use the konk script to setup your cluster, your cluster will be named knative. However, most of the scripts expect it to be the default kind name. Set the kind cluster name env export KIND_CLUSTER_NAME=knative to point to knative cluster. KO requires a registry which if you are developing locally you could use export KO_DOCKER_REPO=kind.local to use the local one on kind. Please see official KO documentation for more information.

Versions to be installed are listed in hack/test-env.sh.

Tests are currently wip. Please see README#tests

Requirements

  1. A running cluster
  2. Knative serving installed
  3. ko (for development and testing)
  4. kubectl (for managing development environments)
  5. bash v4 or later. On macOS the default bash is too old, you can use Homebrew to install a later version.

Environment

To start your environment you'll need to set KO_DOCKER_REPO: The repository to which developer/test images should be pushed. Ex:

export KO_DOCKER_REPO='gcr.io/my-gcloud-project-id'

Notes

  • If you are using Docker Hub to store your images your KO_DOCKER_REPO variable should be docker.io/<username>.
  • Currently Docker Hub doesn't let you create subdirs under your username.
  • You'll need to be authenticated with your KO_DOCKER_REPO before pushing images.
    • Google Container Registry: gcloud auth configure-docker
    • Docker Hub: docker login

Building the test images

NOTE: this is only required when you run conformance/e2e tests locally with go test commands, and may be required periodically.

The upload-test-images.sh script can be used to build and push the test images used by the conformance and e2e tests.

./test/upload-test-images.sh

Tests

Conformance and HA

  • Calling the script without arguments will create a new cluster in your current GCP project (assuming you have one) and run the tests against it.
  • Calling the script with --run-tests and the variable KO_DOCKER_REPO set will immediately start the tests against the cluster currently configured for kubectl.
  • Use the script with --kind to run the tests against a kind cluster.

Examples

./test/e2e-tests.sh --istio --run-tests --kind --skip-dump-on-failure ./test/e2e-tests.sh --contour --run-tests --kind --skip-dump-on-failure

Individual tests

To run an individual test use

# Prepare environment
cd test
source e2e-common.sh
initialize --istio --run-tests --kind --skip-dump-on-failure
cd ..

# Running a single conformance test
go_test_e2e -tags=e2e -parallel=1 ./test/conformance \
    -enable-alpha \
    -enable-beta \
    -run ^TestIngressConformance/basics$ \
    -ingressClass=gateway-api.ingress.networking.knative.dev