@@ -233,6 +233,22 @@ func NewConformanceTestSuite(options ConformanceOptions) (*ConformanceTestSuite,
233
233
return nil , fmt .Errorf ("no supported features were determined for test suite" )
234
234
}
235
235
236
+ extendedSupportedFeatures := make (map [ConformanceProfileName ]FeaturesSet , 0 )
237
+ extendedUnsupportedFeatures := make (map [ConformanceProfileName ]FeaturesSet , 0 )
238
+
239
+ for _ , conformanceProfileName := range options .ConformanceProfiles .UnsortedList () {
240
+ conformanceProfile , err := getConformanceProfileForName (conformanceProfileName )
241
+ if err != nil {
242
+ return nil , fmt .Errorf ("failed to retrieve conformance profile: %w" , err )
243
+ }
244
+ // the use of a conformance profile implicitly enables any features of
245
+ // that profile which are supported at a Core level of support.
246
+ supportedFeatures = supportedFeatures .Union (conformanceProfile .CoreFeatures )
247
+
248
+ extendedSupportedFeatures [conformanceProfileName ] = conformanceProfile .ExtendedFeatures .Intersection (supportedFeatures )
249
+ extendedUnsupportedFeatures [conformanceProfileName ] = conformanceProfile .ExtendedFeatures .Difference (supportedFeatures )
250
+ }
251
+
236
252
config .SetupTimeoutConfig (& options .TimeoutConfig )
237
253
238
254
roundTripper := options .RoundTripper
@@ -290,8 +306,8 @@ func NewConformanceTestSuite(options ConformanceOptions) (*ConformanceTestSuite,
290
306
UsableNetworkAddresses : options .UsableNetworkAddresses ,
291
307
UnusableNetworkAddresses : options .UnusableNetworkAddresses ,
292
308
results : make (map [string ]testResult ),
293
- extendedUnsupportedFeatures : make ( map [ ConformanceProfileName ]sets. Set [features. FeatureName ]) ,
294
- extendedSupportedFeatures : make ( map [ ConformanceProfileName ]sets. Set [features. FeatureName ]) ,
309
+ extendedUnsupportedFeatures : extendedUnsupportedFeatures ,
310
+ extendedSupportedFeatures : extendedSupportedFeatures ,
295
311
conformanceProfiles : options .ConformanceProfiles ,
296
312
implementation : options .Implementation ,
297
313
mode : mode ,
@@ -301,37 +317,6 @@ func NewConformanceTestSuite(options ConformanceOptions) (*ConformanceTestSuite,
301
317
Hook : options .Hook ,
302
318
}
303
319
304
- for _ , conformanceProfileName := range options .ConformanceProfiles .UnsortedList () {
305
- conformanceProfile , err := getConformanceProfileForName (conformanceProfileName )
306
- if err != nil {
307
- return nil , fmt .Errorf ("failed to retrieve conformance profile: %w" , err )
308
- }
309
- // the use of a conformance profile implicitly enables any features of
310
- // that profile which are supported at a Core level of support.
311
- for _ , f := range conformanceProfile .CoreFeatures .UnsortedList () {
312
- if ! options .SupportedFeatures .Has (f ) {
313
- suite .SupportedFeatures .Insert (f )
314
- }
315
- }
316
- for _ , f := range conformanceProfile .ExtendedFeatures .UnsortedList () {
317
- if options .SupportedFeatures .Has (f ) {
318
- if suite .extendedSupportedFeatures [conformanceProfileName ] == nil {
319
- suite .extendedSupportedFeatures [conformanceProfileName ] = FeaturesSet {}
320
- }
321
- suite .extendedSupportedFeatures [conformanceProfileName ].Insert (f )
322
- } else {
323
- if suite .extendedUnsupportedFeatures [conformanceProfileName ] == nil {
324
- suite .extendedUnsupportedFeatures [conformanceProfileName ] = FeaturesSet {}
325
- }
326
- suite .extendedUnsupportedFeatures [conformanceProfileName ].Insert (f )
327
- }
328
- // Add Exempt Features into unsupported features list
329
- if options .ExemptFeatures .Has (f ) {
330
- suite .extendedUnsupportedFeatures [conformanceProfileName ].Insert (f )
331
- }
332
- }
333
- }
334
-
335
320
// apply defaults
336
321
if suite .BaseManifests == "" {
337
322
suite .BaseManifests = "base/manifests.yaml"
0 commit comments