Skip to content

Commit

Permalink
chore: conformance profiles renamed
Browse files Browse the repository at this point in the history
Signed-off-by: Mattia Lavacca <[email protected]>
  • Loading branch information
mlavacca committed Apr 24, 2024
1 parent 12d50fe commit 02158d5
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 32 deletions.
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
// service mesh related functionality.
MeshConformanceProfile = ConformanceProfile{
Name: MeshConformanceProfileName,
MeshHTTPConformanceProfile = ConformanceProfile{
Name: MeshHTTPConformanceProfileName,
CoreFeatures: sets.New(
features.SupportMesh,
features.SupportHTTPRoute,
),
ExtendedFeatures: features.HTTPRouteExtendedFeatures,
}

// MeshConformanceProfile is a ConformanceProfile that covers testing
// 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

0 comments on commit 02158d5

Please sign in to comment.