suite

package
v0.5.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2022 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConformanceTest

type ConformanceTest struct {
	ShortName   string
	Description string
	Exemptions  []ExemptFeature
	Features    []SupportedFeature
	Manifests   []string
	Slow        bool
	Parallel    bool
	Test        func(*testing.T, *ConformanceTestSuite)
}

ConformanceTest is used to define each individual conformance test.

func (*ConformanceTest) Run

func (test *ConformanceTest) Run(t *testing.T, suite *ConformanceTestSuite)

Run runs an individual tests, applying and cleaning up the required manifests before calling the Test function.

type ConformanceTestSuite

type ConformanceTestSuite struct {
	Client            client.Client
	RoundTripper      roundtripper.RoundTripper
	GatewayClassName  string
	ControllerName    string
	Debug             bool
	Cleanup           bool
	BaseManifests     string
	Applier           kubernetes.Applier
	ExemptFeatures    []ExemptFeature
	SupportedFeatures []SupportedFeature
}

ConformanceTestSuite defines the test suite used to run Gateway API conformance tests.

func New

New returns a new ConformanceTestSuite.

func (*ConformanceTestSuite) Run

func (suite *ConformanceTestSuite) Run(t *testing.T, tests []ConformanceTest)

Run runs the provided set of conformance tests.

func (*ConformanceTestSuite) Setup

func (suite *ConformanceTestSuite) Setup(t *testing.T)

Setup ensures the base resources required for conformance tests are installed in the cluster. It also ensures that all relevant resources are ready.

type ExemptFeature

type ExemptFeature string

ExemptFeature allows opting out of core conformance tests at an individual feature granularity.

const (
	// This option indicates the implementation is exempting itself from the
	// requirement of a ReferenceGrant to allow cross-namespace references,
	// and has instead implemented alternative safeguards.
	ExemptReferenceGrant ExemptFeature = "ReferenceGrant"
)

type Options

type Options struct {
	Client           client.Client
	GatewayClassName string
	Debug            bool
	RoundTripper     roundtripper.RoundTripper
	BaseManifests    string
	NamespaceLabels  map[string]string
	// ValidUniqueListenerPorts maps each listener port of each Gateway in the
	// manifests to a valid, unique port. There must be as many
	// ValidUniqueListenerPorts as there are listeners in the set of manifests.
	// For example, given two Gateways, each with 2 listeners, there should be
	// four ValidUniqueListenerPorts.
	// If empty or nil, ports are not modified.
	ValidUniqueListenerPorts []v1alpha2.PortNumber

	// CleanupBaseResources indicates whether or not the base test
	// resources such as Gateways should be cleaned up after the run.
	CleanupBaseResources bool
	ExemptFeatures       []ExemptFeature
	SupportedFeatures    []SupportedFeature
}

Options can be used to initialize a ConformanceTestSuite.

type SupportedFeature

type SupportedFeature string

SupportedFeature allows opting in to additional conformance tests at an individual feature granularity.

const (
	// This option indicates support for the ReferenceGrant object.
	SupportReferenceGrant SupportedFeature = "ReferenceGrant"

	// This option indicates support for HTTPRoute query param matching (extended conformance).
	SupportHTTPRouteQueryParamMatching SupportedFeature = "HTTPRouteQueryParamMatching"
)

Jump to

Keyboard shortcuts

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