Build Deploy and E2E test Automation Framework
This is the folder in which we can invoke e2e tests for tce addons packages.
Prerequisites
- Dependent packages or tools (like ytt) would be handled in respective addons package suites.
Supported flags
- --kubeconfig : Use to set the kube config path
- --kube-context : Use to set cluster context
- --packages : Use to filter out the addon package tests to run
- --version: Provide respective version for packages mentioned.
- --provider : The environment in which test should run (eg: docker, aws, vsphere etc)
- --cluster-type : Set type of cluster (eg: management)
- --create-cluster : Provide true if cluster has to provision. Provide false if the cluster is already exist. If true automation creates cluster based on the provider and cluster type.
- --tce-version : Provide tce release version to install(eg: "v0.7.0"). If not provided then build it from source code.
- --guest-cluster-name: Provide cluster name (for workload cluster incase of managed)
- --management-cluster-name: Provide cluster name for management cluster.
- --cluster-plan: Provide Cluster Plan (eg: dev, prod etc). By default it will be set to "dev".
- --cleanup-cluster: Provide true for tearing down the cluster.
How to run framework to install TCE release from github page, provision cluster and test
ginkgo -v -- --kubeconfig=$KUBECONFIG --packages="external-dns" --version="0.8.0" --provider="docker" --cluster-type="management" --guest-cluster-name="tce-mycluster" --create-cluster --tce-version="v0.7.0"
How to create management cluster on docker
ginkgo -v -- --kubeconfig=$KUBECONFIG --packages="external-dns" --version="0.8.0" --provider="docker" --cluster-type="managed" --tce-version="v0.7.0" --management-cluster-name="tce-management-cluster" --create-cluster --guest-cluster-name="tce-workload-cluster"
How to run framework to install TCE by building release from source code, provision cluster and test
ginkgo -v -- --kubeconfig=$KUBECONFIG --packages="all" --provider="docker" --cluster-type="management" --guest-cluster-name="tce-mycluster" --create-cluster
How to run addons package test if cluster is already available
-
to run individual packages test
ginkgo -v -- --packages="calico,contour" --version="3.11.3,1.17.1" --guest-cluster-name="tce-mycluster"
or
ginkgo -v -- --packages="contour" --version="1.17.1" --guest-cluster-name="tce-mycluster"
-
to run all addons package tests
ginkgo -v -- --kubeconfig=$KUBECONFIG --packages="all" --guest-cluster-name="tce-mycluster"
-
how to pass cluster context
ginkgo -v -- --kubeconfig=$KUBECONFIG --packages="antrea" --version="0.11.3" --kube-context="cluster-dev-test-admin@cluster-dev-test"
Notes
- If all packages tests need to run then --version is not required along with --packages="all"
- By default --packages="all" will run the package testing for the latest version of respective packages. One can modify the required package version in addons_config.yaml if they wanted to test lower version of supported packages.
- Default cluster plan is dev.
- Provide release version of TCE in --tce-version to fetch it from github and install. If value is not provided then automation code checks if the tanzu cli already available in the environment, if not it will create a release from source code and installs tce.
- In case of any failures, created cluster will be tear down.
- Cluster tearing down is optional. One can delete cluster passing --cleanup-cluster.