Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conformance profiles renamed #3019

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 44 additions & 28 deletions conformance/utils/suite/profiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,32 +42,36 @@ type ConformanceProfile struct {
type ConformanceProfileName string

const (
// HTTPConformanceProfileName indicates the name of the conformance profile
// which covers HTTP functionality, such as the HTTPRoute API.
HTTPConformanceProfileName ConformanceProfileName = "HTTP"
// GatewayHTTPConformanceProfileName indicates the name of the conformance profile
// which covers HTTP functionality with Gateways.
GatewayHTTPConformanceProfileName ConformanceProfileName = "GATEWAY-HTTP"

// TLSConformanceProfileName indicates the name of the conformance profile
// which covers TLS stream functionality, such as the TLSRoute API.
TLSConformanceProfileName ConformanceProfileName = "TLS"
// GatewayTLSConformanceProfileName indicates the name of the conformance profile
// which covers TLS stream functionality with Gateways.
GatewayTLSConformanceProfileName ConformanceProfileName = "GATEWAY-TLS"

// GRPCConformanceProfileName indicates the name of the conformance profile
// which covers GRPC functionality, such as the GRPCRoute API.
GRPCConformanceProfileName ConformanceProfileName = "GRPC"
// GatewayGRPCConformanceProfileName indicates the name of the conformance profile
// which covers GRPC functionality with Gateways.
GatewayGRPCConformanceProfileName ConformanceProfileName = "GATEWAY-GRPC"

// MeshConformanceProfileName indicates the name of the conformance profile
// which covers service mesh functionality.
MeshConformanceProfileName ConformanceProfileName = "MESH"
// 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"
)

// -----------------------------------------------------------------------------
// Conformance Profiles - Public Vars
// -----------------------------------------------------------------------------

var (
// HTTPConformanceProfile is a ConformanceProfile that covers testing HTTP
// GatewayHTTPConformanceProfile is a ConformanceProfile that covers testing HTTP
// related functionality with Gateways.
HTTPConformanceProfile = ConformanceProfile{
Name: HTTPConformanceProfileName,
GatewayHTTPConformanceProfile = ConformanceProfile{
Name: GatewayHTTPConformanceProfileName,
CoreFeatures: sets.New(
features.SupportGateway,
features.SupportReferenceGrant,
Expand All @@ -78,10 +82,10 @@ var (
Insert(features.HTTPRouteExtendedFeatures.UnsortedList()...),
}

// TLSConformanceProfile is a ConformanceProfile that covers testing TLS
// GatewayTLSConformanceProfile is a ConformanceProfile that covers testing TLS
// related functionality with Gateways.
TLSConformanceProfile = ConformanceProfile{
Name: TLSConformanceProfileName,
GatewayTLSConformanceProfile = ConformanceProfile{
Name: GatewayTLSConformanceProfileName,
CoreFeatures: sets.New(
features.SupportGateway,
features.SupportReferenceGrant,
Expand All @@ -90,27 +94,38 @@ var (
ExtendedFeatures: features.GatewayExtendedFeatures,
}

// GRPCConformanceProfile is a ConformanceProfile that covers testing GRPC
// GatewayGRPCConformanceProfile is a ConformanceProfile that covers testing GRPC
// related functionality with Gateways.
GRPCConformanceProfile = ConformanceProfile{
Name: GRPCConformanceProfileName,
GatewayGRPCConformanceProfile = ConformanceProfile{
Name: GatewayGRPCConformanceProfileName,
CoreFeatures: sets.New(
features.SupportGateway,
features.SupportReferenceGrant,
features.SupportGRPCRoute,
),
ExtendedFeatures: features.GatewayExtendedFeatures,
}

// MeshConformanceProfile is a ConformanceProfile that covers testing
// MeshHTTPConformanceProfile is a ConformanceProfile that covers testing HTTP
// service mesh related functionality.
MeshConformanceProfile = ConformanceProfile{
Name: MeshConformanceProfileName,
MeshHTTPConformanceProfile = ConformanceProfile{
Name: MeshHTTPConformanceProfileName,
CoreFeatures: sets.New(
features.SupportMesh,
features.SupportHTTPRoute,
),
ExtendedFeatures: features.HTTPRouteExtendedFeatures,
}

// MeshGRPCConformanceProfile is a ConformanceProfile that covers testing GRPC
// service mesh related functionality.
MeshGRPCConformanceProfile = ConformanceProfile{
Name: MeshHTTPConformanceProfileName,
CoreFeatures: sets.New(
features.SupportMesh,
features.SupportGRPCRoute,
),
}
)

// RegisterConformanceProfile allows downstream tests to register unique profiles that
Expand All @@ -130,10 +145,11 @@ func RegisterConformanceProfile(p ConformanceProfile) {
// conformanceProfileMap maps short human-readable names to their respective
// ConformanceProfiles.
var conformanceProfileMap = map[ConformanceProfileName]ConformanceProfile{
HTTPConformanceProfileName: HTTPConformanceProfile,
TLSConformanceProfileName: TLSConformanceProfile,
GRPCConformanceProfileName: GRPCConformanceProfile,
MeshConformanceProfileName: MeshConformanceProfile,
GatewayHTTPConformanceProfileName: GatewayHTTPConformanceProfile,
GatewayTLSConformanceProfileName: GatewayTLSConformanceProfile,
GatewayGRPCConformanceProfileName: GatewayGRPCConformanceProfile,
MeshHTTPConformanceProfileName: MeshHTTPConformanceProfile,
MeshGRPCConformanceProfileName: MeshGRPCConformanceProfile,
}

// getConformanceProfileForName retrieves a known ConformanceProfile by its simple
Expand Down
8 changes: 4 additions & 4 deletions conformance/utils/suite/reports_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestBuildSummary(t *testing.T) {
{
name: "core tests failed, no extended tests",
report: confv1.ProfileReport{
Name: string(HTTPConformanceProfileName),
Name: string(GatewayHTTPConformanceProfileName),
Core: confv1.Status{
Result: confv1.Failure,
Statistics: confv1.Statistics{
Expand All @@ -47,7 +47,7 @@ func TestBuildSummary(t *testing.T) {
{
name: "core tests succeeded, extended tests failed",
report: confv1.ProfileReport{
Name: string(HTTPConformanceProfileName),
Name: string(GatewayHTTPConformanceProfileName),
Core: confv1.Status{
Result: confv1.Success,
Statistics: confv1.Statistics{
Expand All @@ -69,7 +69,7 @@ func TestBuildSummary(t *testing.T) {
{
name: "core tests partially succeeded, extended tests succeeded",
report: confv1.ProfileReport{
Name: string(HTTPConformanceProfileName),
Name: string(GatewayHTTPConformanceProfileName),
Core: confv1.Status{
Result: confv1.Partial,
Statistics: confv1.Statistics{
Expand All @@ -91,7 +91,7 @@ func TestBuildSummary(t *testing.T) {
{
name: "core tests succeeded, extended tests partially succeeded",
report: confv1.ProfileReport{
Name: string(HTTPConformanceProfileName),
Name: string(GatewayHTTPConformanceProfileName),
Core: confv1.Status{
Result: confv1.Success,
Statistics: confv1.Statistics{
Expand Down