e2e

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTestSuite

func GetTestSuite() []func(*testing.T)

GetTestSuite returns all e2e tests that should be run.

func TestDataPlaneValidatingWebhook

func TestDataPlaneValidatingWebhook(t *testing.T)

func TestDeployAndUpgradeFromLatestTagToOverride

func TestDeployAndUpgradeFromLatestTagToOverride(t *testing.T)

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 TestOperatorLogs

func TestOperatorLogs(t *testing.T)

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 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.

Jump to

Keyboard shortcuts

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