Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTestSuite ¶
GetTestSuite returns all e2e tests that should be run.
func TestDeployAndUpgradeFromLatestTagToOverride ¶
TestDeployAndUpgradeFromLatestTagToOverride tests an upgrade path from latest released tag to an override version provided by environment variables. The reason we need and override is to not test against latest main build because that would not provide accurate test results because when one changes code in a PR, the intention is to test this very code through CI, not a prior version without this change.
CI already has this override provided in https://github.com/Kong/gateway-operator/blob/0f3b726c33/.github/workflows/tests.yaml#L180-L190 so anyone pushing changes can expect those changes to be tested in this test.
func TestHelmUpgrade ¶ added in v1.3.0
func TestOperatorLogs ¶
Types ¶
type KustomizeDir ¶
type KustomizeDir string
KustomizeDir represents a path to a temporary kustomize directory that has everything from config dir plus the tests/ dir with kustomization.yaml that has the image patch in place.
func PrepareKustomizeDir ¶
func PrepareKustomizeDir(t *testing.T, image string) KustomizeDir
PrepareKustomizeDir prepares a temporary kustomize directory with operator image patch in place. It takes the provided image and uses it to append an "images:" section to resulting kustomization.yaml. It returns the KustomizeConfigPath that has methods to access particular paths.
func (KustomizeDir) CRD ¶
func (kcp KustomizeDir) CRD() string
CRD returns the path to the crd/ dir in the temporary kustomize directory.
func (KustomizeDir) ManagerKustomizationYAML ¶
func (kcp KustomizeDir) ManagerKustomizationYAML() string
ManagerKustomizationYAML returns the path to the file manager/kustomization.yaml
func (KustomizeDir) Tests ¶
func (kcp KustomizeDir) Tests() string
Tests returns the path to the tests/ dir in the temporary kustomize directory.
func (KustomizeDir) TestsKustomization ¶
func (kcp KustomizeDir) TestsKustomization() string
TestsKustomization returns the path to the tests/kustomization dir in the temporary kustomize directory.
type TestEnvOption ¶
type TestEnvOption func(opt *testEnvOptions)
TestEnvOption is a functional option for configuring a test environment.
func WithInstallViaKustomize ¶ added in v1.3.0
func WithInstallViaKustomize() TestEnvOption
WithInstallViaKustomize makes the test environment install the operator and all the dependencies via kustomize.
func WithOperatorImage ¶
func WithOperatorImage(image string) TestEnvOption
WithOperatorImage allows configuring the operator image to use in the test environment.
type TestEnvironment ¶
type TestEnvironment struct { Clients *testutils.K8sClients Namespace *corev1.Namespace Cleaner *clusters.Cleaner Environment environments.Environment }
TestEnvironment represents a testing environment (K8s cluster) for running isolated e2e test.
func CreateEnvironment ¶
func CreateEnvironment(t *testing.T, ctx context.Context, opts ...TestEnvOption) TestEnvironment
CreateEnvironment creates a new independent testing environment for running isolated e2e test. When running with Helm, the caller is responsible for cleaning up the environment.