Skip to content

Commit

Permalink
conformance: support HTTPRouteMethodMatching
Browse files Browse the repository at this point in the history
  • Loading branch information
pmalek committed Jun 14, 2024
1 parent bda0eee commit 7f94d68
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions test/conformance/conformance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ var skippedTestsForTraditionalCompatibleRouter = []string{
tests.HTTPRouteWeight.ShortName,
}

var traditionalRoutesSupportedFeatures = sets.New(
features.SupportHTTPRouteResponseHeaderModification,
features.SupportHTTPRouteMethodMatching,
)

var expressionRoutesSupportedFeatures = sets.New(
features.SupportHTTPRouteResponseHeaderModification,
features.SupportHTTPRouteMethodMatching,
)

type ConformanceConfig struct {
KongRouterFlavor RouterFlavor
}
Expand All @@ -58,16 +68,19 @@ func TestGatewayConformance(t *testing.T) {
// Conformance tests are run for both available router flavours:
// traditional_compatible and expressions.
var (
config ConformanceConfig
skippedTests []string
config ConformanceConfig
skippedTests []string
supportedFeatures sets.Set[features.SupportedFeature]
)
switch rf := KongRouterFlavor(t); rf {
case RouterFlavorTraditionalCompatible:
skippedTests = skippedTestsForTraditionalCompatibleRouter
config.KongRouterFlavor = RouterFlavorTraditionalCompatible
supportedFeatures = traditionalRoutesSupportedFeatures
case RouterFlavorExpressions:
skippedTests = skippedTestsForExpressionsRouter
config.KongRouterFlavor = RouterFlavorExpressions
supportedFeatures = expressionRoutesSupportedFeatures
default:
t.Fatalf("unsupported KongRouterFlavor: %s", rf)
}
Expand Down Expand Up @@ -97,9 +110,7 @@ func TestGatewayConformance(t *testing.T) {
opts.ConformanceProfiles = sets.New(
suite.GatewayHTTPConformanceProfileName,
)
opts.SupportedFeatures = sets.New(
features.SupportHTTPRouteResponseHeaderModification,
)
opts.SupportedFeatures = supportedFeatures
opts.Implementation = conformancev1.Implementation{
Organization: metadata.Organization,
Project: metadata.ProjectName,
Expand Down

0 comments on commit 7f94d68

Please sign in to comment.