assertions

package
v1.17.0-beta22 Latest Latest
Warning

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

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

README

Assertion

A ClusterAssertion is a function which asserts a given behavior of a cluster, at a point in time.

If you intend to introduce a new assertion, please follow this approach:

  • We want to avoid writing generic assertions, that are specific to certain tests. Assertions should contain no custom logic, and instead support dependency injection.
  • If you are unsure if an assertion is generic, start by adding it directly to your test, and then you can make it more generic in a follow-up.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterAssertion

type ClusterAssertion func(ctx context.Context)

ClusterAssertion is a function which asserts a given behavior at a point in time If it succeeds, it will not return anything If it fails, it must panic We typically rely on the onsi.Gomega library to implement these assertions

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider is the entity that creates a ClusterAssertion These assertions occur against a running instance of Gloo Gateway, within a Kubernetes Cluster. So this provider maintains state about the install/cluster it is using, and then provides operations.ClusterAssertion to match

func NewProvider

func NewProvider(testingFramework testing.TB) *Provider

NewProvider returns a Provider that will provide Assertions that can be executed against an installation of Gloo Gateway

func (*Provider) CheckResources

func (p *Provider) CheckResources() ClusterAssertion

CheckResources returns the ClusterAssertion that performs a `glooctl check`

func (*Provider) EnvoyAdminApiAssertion

func (p *Provider) EnvoyAdminApiAssertion(
	envoyDeployment metav1.ObjectMeta,
	adminAssertion func(ctx context.Context, adminClient *admincli.Client),
) ClusterAssertion

func (*Provider) InstallationWasSuccessful

func (p *Provider) InstallationWasSuccessful() ClusterAssertion

func (*Provider) NamespaceNotExist

func (p *Provider) NamespaceNotExist(ns string) ClusterAssertion

func (*Provider) ObjectsExist

func (p *Provider) ObjectsExist(objects ...client.Object) ClusterAssertion

func (*Provider) ObjectsNotExist

func (p *Provider) ObjectsNotExist(objects ...client.Object) ClusterAssertion

func (*Provider) RunningReplicas

func (p *Provider) RunningReplicas(deploymentMeta metav1.ObjectMeta, replicaMatcher types.GomegaMatcher) ClusterAssertion

func (*Provider) UninstallationWasSuccessful

func (p *Provider) UninstallationWasSuccessful() ClusterAssertion

func (*Provider) WithClusterContext

func (p *Provider) WithClusterContext(clusterContext *cluster.Context) *Provider

WithClusterContext sets the provider to point to the provided cluster

func (*Provider) WithGlooGatewayContext

func (p *Provider) WithGlooGatewayContext(ggCtx *gloogateway.Context) *Provider

WithGlooGatewayContext sets the providers to point to a particular installation of Gloo Gateway

func (*Provider) WithProgressWriter

func (p *Provider) WithProgressWriter(progressWriter io.Writer) *Provider

WithProgressWriter sets the io.Writer for the provider

Jump to

Keyboard shortcuts

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