Note
This directory houses legacy tests. All new tests should instead be added to the test/kubernetes/e2e
directory.
These are our legacy Kubernetes E2E tests. We are migrating them to
../kubernetes/e2e
. Create new E2E tests there using the new framework.
See the developer kube-e2e testing guide for more information about the philosophy of these tests.
Note: All commands should be run from the root directory of the Gloo repository
It is possible to run these tests against a previously released version of Gloo Edge. This is useful for testing a release candidate, or a nightly build.
There is no setup required for this option, as the test suite will download the helm chart archive and glooctl
binary from the specified release. You will use the RELEASED_VERSION
environment variable when running the tests. See the variable definition for more details.
For these tests to run, we require the following conditions:
- Gloo Edge Helm chart archive is present in the
_test
folder, glooctl
is built in the_output
folder- A KinD cluster is set up and loaded with the images to be installed by the helm chart
ci/kind/setup-kind.sh gets run in CI to setup the test environment for the above requirements. It accepts a number of environment variables, to control the creation of a kind cluster and deployment of Gloo resources to that kind cluster.
Name | Default | Description |
---|---|---|
CLUSTER_NAME | kind | The name of the cluster that will be generated |
CLUSTER_NODE_VERSION | v1.28.0 | The version of the Node Docker image to use for booting the cluster |
VERSION | 1.0.0-ci1 | The version used to tag Gloo images that are deployed to the cluster |
SKIP_DOCKER | false | Skip building docker images (used when testing a release version) |
RELEASED_VERSION | '' | Used if you want to test a previously released version. 'LATEST' will find the latest release |
Example:
CLUSTER_NAME=solo-test-cluster CLUSTER_NODE_VERSION=v1.28.0 VERSION=v1.0.0-solo-test ci/kind/setup-kind.sh
Before running your tests, it's worthwhile to verify that a cluster was created, and the proper images have been loaded.
CLUSTER_NAME=solo-test-cluster make kind-list-images
You should see the list of images in the cluster, including the ones you just uploaded
Error: validation: chart.metadata.version "solo" is invalid
In newer versions of helm (>3.5), the version used to build the helm chart (ie the VERSION env variable), needs to respect semantic versioning. This error implies that the version provided does not.
Prepend a valid semver to avoid the error. (ie kind
can become 0.0.0-kind1
)
To run the regression tests, your kubeconfig file must point to a running Kubernetes cluster.
kubectl config current-context
should run kind-<CLUSTER_NAME>
Use the same command that CI relies on:
CLUSTER_NAME=solo-test-cluster KUBE2E_TESTS=<test-to-run> make run-kube-e2e-tests
The below table contains the environment variables that can be used to configure the test execution.
Name | Default | Description |
---|---|---|
TEAR_DOWN | true | Set to true to uninstall Gloo after the test suite completes |
SKIP_INSTALL | false | Set to true to use previously installed Gloo for the tests |
PERSIST_INSTALL | false | Set to true to conditionally install Gloo if it is not already installed and leave Gloo installed after the test run. Useful when running tests repeatedly. If TEAR_DOWN or SKIP_INSTALL values are defined (not just using the default values) and conflict with PERSIST_INSTALL behavior, the TEAR_DOWN or SKIP_INSTALL values will be considered to be more specific and will take precedence. |
CLUSTER_NAME | kind | Used to control which Kind cluster to run the tests inside |
getting Helm chart version: expected a single entry with name [gloo], found: 5
The test helm charts are written to the _test
directory, with the index.yaml
file containing references to all available charts. The tests require that this file contain only 1 entry. Delete the other entries manually, or run make clean
to delete this folder entirely, and then re-build the test helm chart.