Documentation ¶
Index ¶
- Variables
- func ParseConformanceProfiles(p string) sets.Set[ConformanceProfileName]
- func ParseImplementation(org, project, url, version, contact string) confv1.Implementation
- func ParseKeyValuePairs(f string) map[string]string
- func ParseSkipTests(t string) []string
- func ParseSupportedFeatures(f string) sets.Set[features.FeatureName]
- func RegisterConformanceProfile(p ConformanceProfile)
- type ConformanceOptions
- type ConformanceProfile
- type ConformanceProfileName
- type ConformanceTest
- type ConformanceTestSuite
Constants ¶
This section is empty.
Variables ¶
var ( // GatewayHTTPConformanceProfile is a ConformanceProfile that covers testing HTTP // related functionality with Gateways. GatewayHTTPConformanceProfile = ConformanceProfile{ Name: GatewayHTTPConformanceProfileName, CoreFeatures: sets.New( features.SupportGateway, features.SupportReferenceGrant, features.SupportHTTPRoute, ), ExtendedFeatures: sets.New[features.FeatureName](). Insert(features.SetsToNamesSet( features.GatewayExtendedFeatures, features.HTTPRouteExtendedFeatures, ).UnsortedList()...), } // GatewayTLSConformanceProfile is a ConformanceProfile that covers testing TLS // related functionality with Gateways. GatewayTLSConformanceProfile = ConformanceProfile{ Name: GatewayTLSConformanceProfileName, CoreFeatures: sets.New( features.SupportGateway, features.SupportReferenceGrant, features.SupportTLSRoute, ), ExtendedFeatures: features.SetsToNamesSet(features.GatewayExtendedFeatures), } // GatewayGRPCConformanceProfile is a ConformanceProfile that covers testing GRPC // related functionality with Gateways. GatewayGRPCConformanceProfile = ConformanceProfile{ Name: GatewayGRPCConformanceProfileName, CoreFeatures: sets.New( features.SupportGateway, features.SupportReferenceGrant, features.SupportGRPCRoute, ), ExtendedFeatures: features.SetsToNamesSet(features.GatewayExtendedFeatures), } // MeshHTTPConformanceProfile is a ConformanceProfile that covers testing HTTP // service mesh related functionality. MeshHTTPConformanceProfile = ConformanceProfile{ Name: MeshHTTPConformanceProfileName, CoreFeatures: sets.New( features.SupportMesh, features.SupportHTTPRoute, ), ExtendedFeatures: sets.New[features.FeatureName](). Insert(features.SetsToNamesSet( features.MeshExtendedFeatures, features.HTTPRouteExtendedFeatures, ).UnsortedList()...), } // MeshGRPCConformanceProfile is a ConformanceProfile that covers testing GRPC // service mesh related functionality. MeshGRPCConformanceProfile = ConformanceProfile{ Name: MeshGRPCConformanceProfileName, CoreFeatures: sets.New( features.SupportMesh, features.SupportGRPCRoute, ), ExtendedFeatures: features.SetsToNamesSet(features.MeshExtendedFeatures), } )
Functions ¶
func ParseConformanceProfiles ¶ added in v0.8.0
func ParseConformanceProfiles(p string) sets.Set[ConformanceProfileName]
ParseConformanceProfiles parses flag arguments and converts the string to sets.Set[ConformanceProfileName].
func ParseImplementation ¶ added in v0.8.0
func ParseImplementation(org, project, url, version, contact string) confv1.Implementation
ParseImplementation parses implementation-specific flag arguments and creates a *confv1a1.Implementation.
func ParseKeyValuePairs ¶ added in v0.8.0
ParseKeyValuePairs parses flag arguments and converts the string to map[string]string containing label key/value pairs.
func ParseSkipTests ¶ added in v0.8.0
ParseSkipTests parses flag arguments and converts the string to []string containing the tests to be skipped.
func ParseSupportedFeatures ¶ added in v0.8.0
func ParseSupportedFeatures(f string) sets.Set[features.FeatureName]
ParseSupportedFeatures parses flag arguments and converts the string to sets.Set[features.FeatureName]
func RegisterConformanceProfile ¶ added in v1.1.0
func RegisterConformanceProfile(p ConformanceProfile)
RegisterConformanceProfile allows downstream tests to register unique profiles that define their own set of features
Types ¶
type ConformanceOptions ¶ added in v1.1.0
type ConformanceOptions struct { Client client.Client ClientOptions client.Options Clientset clientset.Interface RestConfig *rest.Config GatewayClassName string Debug bool RoundTripper roundtripper.RoundTripper GRPCClient grpc.Client BaseManifests string MeshManifests string NamespaceLabels map[string]string NamespaceAnnotations map[string]string ReportOutputPath string // CleanupBaseResources indicates whether or not the base test // resources such as Gateways should be cleaned up after the run. CleanupBaseResources bool SupportedFeatures sets.Set[features.FeatureName] ExemptFeatures sets.Set[features.FeatureName] EnableAllSupportedFeatures bool TimeoutConfig config.TimeoutConfig // SkipTests contains all the tests not to be run and can be used to opt out // of specific tests SkipTests []string // SkipProvisionalTests indicates whether or not to skip provisional tests. SkipProvisionalTests bool // RunTest is a single test to run, mostly for development/debugging convenience. RunTest string ManifestFS []fs.FS // UsableNetworkAddresses is an optional pool of usable addresses for // Gateways for tests which need to test manual address assignments. UsableNetworkAddresses []v1beta1.GatewayAddress // UnusableNetworkAddresses is an optional pool of unusable addresses for // Gateways for tests which need to test failures with manual Gateway // address assignment. UnusableNetworkAddresses []v1beta1.GatewayAddress Mode string AllowCRDsMismatch bool Implementation confv1.Implementation ConformanceProfiles sets.Set[ConformanceProfileName] }
Options can be used to initialize a ConformanceTestSuite.
type ConformanceProfile ¶ added in v0.8.0
type ConformanceProfile struct { Name ConformanceProfileName CoreFeatures sets.Set[features.FeatureName] ExtendedFeatures sets.Set[features.FeatureName] }
ConformanceProfile is a group of features that have a related purpose, e.g. to cover specific protocol support or a specific feature present in Gateway API.
For more details see the relevant GEP: https://gateway-api.sigs.k8s.io/geps/gep-1709/
type ConformanceProfileName ¶ added in v0.8.0
type ConformanceProfileName string
const ( // GatewayHTTPConformanceProfileName indicates the name of the conformance profile // which covers HTTP functionality with Gateways. GatewayHTTPConformanceProfileName ConformanceProfileName = "GATEWAY-HTTP" // GatewayTLSConformanceProfileName indicates the name of the conformance profile // which covers TLS stream functionality with Gateways. GatewayTLSConformanceProfileName ConformanceProfileName = "GATEWAY-TLS" // GatewayGRPCConformanceProfileName indicates the name of the conformance profile // which covers GRPC functionality with Gateways. GatewayGRPCConformanceProfileName ConformanceProfileName = "GATEWAY-GRPC" // MeshHTTPConformanceProfileName indicates the name of the conformance profile // which covers HTTP functionality with service mesh. MeshHTTPConformanceProfileName ConformanceProfileName = "MESH-HTTP" // MeshGRPCConformanceProfileName indicates the name of the conformance profile // which covers GRPC functionality with service mesh. MeshGRPCConformanceProfileName ConformanceProfileName = "MESH-GRPC" )
type ConformanceTest ¶
type ConformanceTest struct { ShortName string Description string Features []features.FeatureName Manifests []string Slow bool Parallel bool Test func(*testing.T, *ConformanceTestSuite) Provisional bool }
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 ClientOptions client.Options Clientset clientset.Interface RESTClient *rest.RESTClient RestConfig *rest.Config RoundTripper roundtripper.RoundTripper GRPCClient grpc.Client GatewayClassName string ControllerName string Debug bool Cleanup bool BaseManifests string MeshManifests string Applier kubernetes.Applier SupportedFeatures sets.Set[features.FeatureName] TimeoutConfig config.TimeoutConfig SkipTests sets.Set[string] SkipProvisionalTests bool RunTest string ManifestFS []fs.FS UsableNetworkAddresses []v1beta1.GatewayAddress UnusableNetworkAddresses []v1beta1.GatewayAddress // contains filtered or unexported fields }
ConformanceTestSuite defines the test suite used to run Gateway API conformance tests.
func NewConformanceTestSuite ¶ added in v1.1.0
func NewConformanceTestSuite(options ConformanceOptions) (*ConformanceTestSuite, error)
NewConformanceTestSuite is a helper to use for creating a new ConformanceTestSuite.
func (*ConformanceTestSuite) Report ¶ added in v1.1.0
func (suite *ConformanceTestSuite) Report() (*confv1.ConformanceReport, error)
Report emits a ConformanceReport for the previously completed test run. If no run completed prior to running the report, and error is emitted.
func (*ConformanceTestSuite) Run ¶
func (suite *ConformanceTestSuite) Run(t *testing.T, tests []ConformanceTest) error
Run runs the provided set of conformance tests.
func (*ConformanceTestSuite) Setup ¶
func (suite *ConformanceTestSuite) Setup(t *testing.T, tests []ConformanceTest)
Setup ensures the base resources required for conformance tests are installed in the cluster. It also ensures that all relevant resources are ready.