From dc95c43cf49d71bdc04ef113222f6160b9f42104 Mon Sep 17 00:00:00 2001 From: Beka Modebadze Date: Tue, 7 Oct 2025 03:18:20 +0000 Subject: [PATCH 1/4] Cover case when --all-features and --exempt-features flags are supplied. --- conformance/utils/suite/suite.go | 53 ++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 19 deletions(-) diff --git a/conformance/utils/suite/suite.go b/conformance/utils/suite/suite.go index 5df2c722d9..9fb0bef3d8 100644 --- a/conformance/utils/suite/suite.go +++ b/conformance/utils/suite/suite.go @@ -206,7 +206,7 @@ func NewConformanceTestSuite(options ConformanceOptions) (*ConformanceTestSuite, supportedFeatures := options.SupportedFeatures.Difference(options.ExemptFeatures) source := supportedFeaturesSourceManual if options.EnableAllSupportedFeatures { - supportedFeatures = features.SetsToNamesSet(features.AllFeatures) + supportedFeatures = features.SetsToNamesSet(features.AllFeatures).Difference(options.ExemptFeatures) } else if shouldInferSupportedFeatures(&options) { var err error if options.GatewayClassName != "" { @@ -233,22 +233,6 @@ func NewConformanceTestSuite(options ConformanceOptions) (*ConformanceTestSuite, return nil, fmt.Errorf("no supported features were determined for test suite") } - extendedSupportedFeatures := make(map[ConformanceProfileName]FeaturesSet, 0) - extendedUnsupportedFeatures := make(map[ConformanceProfileName]FeaturesSet, 0) - - for _, conformanceProfileName := range options.ConformanceProfiles.UnsortedList() { - conformanceProfile, err := getConformanceProfileForName(conformanceProfileName) - if err != nil { - return nil, fmt.Errorf("failed to retrieve conformance profile: %w", err) - } - // the use of a conformance profile implicitly enables any features of - // that profile which are supported at a Core level of support. - supportedFeatures = supportedFeatures.Union(conformanceProfile.CoreFeatures) - - extendedSupportedFeatures[conformanceProfileName] = conformanceProfile.ExtendedFeatures.Intersection(supportedFeatures) - extendedUnsupportedFeatures[conformanceProfileName] = conformanceProfile.ExtendedFeatures.Difference(supportedFeatures) - } - config.SetupTimeoutConfig(&options.TimeoutConfig) roundTripper := options.RoundTripper @@ -306,8 +290,8 @@ func NewConformanceTestSuite(options ConformanceOptions) (*ConformanceTestSuite, UsableNetworkAddresses: options.UsableNetworkAddresses, UnusableNetworkAddresses: options.UnusableNetworkAddresses, results: make(map[string]testResult), - extendedUnsupportedFeatures: extendedUnsupportedFeatures, - extendedSupportedFeatures: extendedSupportedFeatures, + extendedUnsupportedFeatures: make(map[ConformanceProfileName]sets.Set[features.FeatureName]), + extendedSupportedFeatures: make(map[ConformanceProfileName]sets.Set[features.FeatureName]), conformanceProfiles: options.ConformanceProfiles, implementation: options.Implementation, mode: mode, @@ -317,6 +301,37 @@ func NewConformanceTestSuite(options ConformanceOptions) (*ConformanceTestSuite, Hook: options.Hook, } + for _, conformanceProfileName := range options.ConformanceProfiles.UnsortedList() { + conformanceProfile, err := getConformanceProfileForName(conformanceProfileName) + if err != nil { + return nil, fmt.Errorf("failed to retrieve conformance profile: %w", err) + } + // the use of a conformance profile implicitly enables any features of + // that profile which are supported at a Core level of support. + for _, f := range conformanceProfile.CoreFeatures.UnsortedList() { + if !options.SupportedFeatures.Has(f) { + suite.SupportedFeatures.Insert(f) + } + } + for _, f := range conformanceProfile.ExtendedFeatures.UnsortedList() { + if options.SupportedFeatures.Has(f) { + if suite.extendedSupportedFeatures[conformanceProfileName] == nil { + suite.extendedSupportedFeatures[conformanceProfileName] = FeaturesSet{} + } + suite.extendedSupportedFeatures[conformanceProfileName].Insert(f) + } else { + if suite.extendedUnsupportedFeatures[conformanceProfileName] == nil { + suite.extendedUnsupportedFeatures[conformanceProfileName] = FeaturesSet{} + } + suite.extendedUnsupportedFeatures[conformanceProfileName].Insert(f) + } + // Add Exempt Features into unsupported features list + if options.ExemptFeatures.Has(f) { + suite.extendedUnsupportedFeatures[conformanceProfileName].Insert(f) + } + } + } + // apply defaults if suite.BaseManifests == "" { suite.BaseManifests = "base/manifests.yaml" From 1623e6349d335293c02e8a168f5035e33e6b953f Mon Sep 17 00:00:00 2001 From: Beka Modebadze Date: Tue, 7 Oct 2025 03:38:14 +0000 Subject: [PATCH 2/4] Added unit test. --- conformance/utils/suite/suite_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/conformance/utils/suite/suite_test.go b/conformance/utils/suite/suite_test.go index 0b692b56c7..8988332794 100644 --- a/conformance/utils/suite/suite_test.go +++ b/conformance/utils/suite/suite_test.go @@ -487,6 +487,13 @@ func TestInferGWCSupportedFeatures(t *testing.T) { }), }, }, + { + name: "all features combined with exampt features", + allowAllFeatures: true, + exemptFeatures: sets.New[features.FeatureName]("ReferenceGrant", "HTTPRoute"), + expectedSource: supportedFeaturesSourceManual, + expectedFeatures: features.SetsToNamesSet(features.AllFeatures).Difference(sets.New[features.FeatureName]("ReferenceGrant", "HTTPRoute")), + }, } gwcName := "ochopintre" From 29433cf8ba9ca7a7b709d90192b38847772c0f78 Mon Sep 17 00:00:00 2001 From: Beka Modebadze Date: Tue, 7 Oct 2025 03:40:55 +0000 Subject: [PATCH 3/4] Sync with head --- conformance/utils/suite/suite.go | 51 +++++++++++--------------------- 1 file changed, 18 insertions(+), 33 deletions(-) diff --git a/conformance/utils/suite/suite.go b/conformance/utils/suite/suite.go index 9fb0bef3d8..a17131ccde 100644 --- a/conformance/utils/suite/suite.go +++ b/conformance/utils/suite/suite.go @@ -233,6 +233,22 @@ func NewConformanceTestSuite(options ConformanceOptions) (*ConformanceTestSuite, return nil, fmt.Errorf("no supported features were determined for test suite") } + extendedSupportedFeatures := make(map[ConformanceProfileName]FeaturesSet, 0) + extendedUnsupportedFeatures := make(map[ConformanceProfileName]FeaturesSet, 0) + + for _, conformanceProfileName := range options.ConformanceProfiles.UnsortedList() { + conformanceProfile, err := getConformanceProfileForName(conformanceProfileName) + if err != nil { + return nil, fmt.Errorf("failed to retrieve conformance profile: %w", err) + } + // the use of a conformance profile implicitly enables any features of + // that profile which are supported at a Core level of support. + supportedFeatures = supportedFeatures.Union(conformanceProfile.CoreFeatures) + + extendedSupportedFeatures[conformanceProfileName] = conformanceProfile.ExtendedFeatures.Intersection(supportedFeatures) + extendedUnsupportedFeatures[conformanceProfileName] = conformanceProfile.ExtendedFeatures.Difference(supportedFeatures) + } + config.SetupTimeoutConfig(&options.TimeoutConfig) roundTripper := options.RoundTripper @@ -290,8 +306,8 @@ func NewConformanceTestSuite(options ConformanceOptions) (*ConformanceTestSuite, UsableNetworkAddresses: options.UsableNetworkAddresses, UnusableNetworkAddresses: options.UnusableNetworkAddresses, results: make(map[string]testResult), - extendedUnsupportedFeatures: make(map[ConformanceProfileName]sets.Set[features.FeatureName]), - extendedSupportedFeatures: make(map[ConformanceProfileName]sets.Set[features.FeatureName]), + extendedUnsupportedFeatures: extendedUnsupportedFeatures, + extendedSupportedFeatures: extendedSupportedFeatures, conformanceProfiles: options.ConformanceProfiles, implementation: options.Implementation, mode: mode, @@ -301,37 +317,6 @@ func NewConformanceTestSuite(options ConformanceOptions) (*ConformanceTestSuite, Hook: options.Hook, } - for _, conformanceProfileName := range options.ConformanceProfiles.UnsortedList() { - conformanceProfile, err := getConformanceProfileForName(conformanceProfileName) - if err != nil { - return nil, fmt.Errorf("failed to retrieve conformance profile: %w", err) - } - // the use of a conformance profile implicitly enables any features of - // that profile which are supported at a Core level of support. - for _, f := range conformanceProfile.CoreFeatures.UnsortedList() { - if !options.SupportedFeatures.Has(f) { - suite.SupportedFeatures.Insert(f) - } - } - for _, f := range conformanceProfile.ExtendedFeatures.UnsortedList() { - if options.SupportedFeatures.Has(f) { - if suite.extendedSupportedFeatures[conformanceProfileName] == nil { - suite.extendedSupportedFeatures[conformanceProfileName] = FeaturesSet{} - } - suite.extendedSupportedFeatures[conformanceProfileName].Insert(f) - } else { - if suite.extendedUnsupportedFeatures[conformanceProfileName] == nil { - suite.extendedUnsupportedFeatures[conformanceProfileName] = FeaturesSet{} - } - suite.extendedUnsupportedFeatures[conformanceProfileName].Insert(f) - } - // Add Exempt Features into unsupported features list - if options.ExemptFeatures.Has(f) { - suite.extendedUnsupportedFeatures[conformanceProfileName].Insert(f) - } - } - } - // apply defaults if suite.BaseManifests == "" { suite.BaseManifests = "base/manifests.yaml" From 5acc678699f06a2704de9162a6a83617b93be0e0 Mon Sep 17 00:00:00 2001 From: Beka Modebadze Date: Fri, 31 Oct 2025 15:37:24 +0000 Subject: [PATCH 4/4] Typo. --- conformance/utils/suite/suite_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conformance/utils/suite/suite_test.go b/conformance/utils/suite/suite_test.go index 8988332794..084672dcfa 100644 --- a/conformance/utils/suite/suite_test.go +++ b/conformance/utils/suite/suite_test.go @@ -488,7 +488,7 @@ func TestInferGWCSupportedFeatures(t *testing.T) { }, }, { - name: "all features combined with exampt features", + name: "all features combined with exempt features", allowAllFeatures: true, exemptFeatures: sets.New[features.FeatureName]("ReferenceGrant", "HTTPRoute"), expectedSource: supportedFeaturesSourceManual,