integration

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

README

Integration Test Framework

The integration test framework for Antrea multi-cluster is mainly using envtest which is provided by controller-runtime. There is an online book about kubebuilder that describes a few steps about how to configure envtest for integration tests. envtest supports using an existing cluster to run integration test by setting a config USE_EXISTING_CLUSTER. In Antrea multi-cluster, we choose to use an existing cluster to run tests with a real control plane and dependent controllers like Service, Endpoints controllers etc.

Running the Antrea Multi-cluster Integration tests

The tests must be run on an real Kubernetes cluster. At the moment, you can simply run make test-integration in antrea/multicluster folder. It will create a Kind cluster named antrea-integration-kind and execute the integration codes.

if you'd like to run the integration test in an existing Kubernetes cluster, you can save your kubeconfig file as mc-integration-kubeconfig in /tmp directly, the integration test codes will read the file /tmp/mc-integration-kubeconfig by default, then run below commands:

export KUBECONFIG=/tmp/mc-integration-kubeconfig
kubectl create namespace leader-ns
kubectl apply -f test/integration/cluster-admin.yml
go test -coverpkg=antrea.io/antrea/multicluster/controllers/multicluster/... -coverprofile=../.coverage/coverage-integration.txt -covermode=atomic -cover antrea.io/antrea/multicluster/test/integration/...

You should be able to see the overall results from terminal, if you'd like to check more details, you can go check the file .coverage/coverage-integration.txt.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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