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

rm EnableAllSupportedFeatures & add AllGatewayFeatures #1907

Closed
Closed
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
15 changes: 7 additions & 8 deletions conformance/conformance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,15 @@ func TestConformance(t *testing.T) {
supportedFeatures.Delete(feature)
}

t.Logf("Running conformance tests with %s GatewayClass\n cleanup: %t\n debug: %t\n enable all features: %t \n supported features: [%v]\n exempt features: [%v]",
*flags.GatewayClassName, *flags.CleanupBaseResources, *flags.ShowDebug, *flags.EnableAllSupportedFeatures, *flags.SupportedFeatures, *flags.ExemptFeatures)
t.Logf("Running conformance tests with %s GatewayClass\n cleanup: %t\n debug: %t\n supported features: [%v]\n exempt features: [%v]",
*flags.GatewayClassName, *flags.CleanupBaseResources, *flags.ShowDebug, *flags.SupportedFeatures, *flags.ExemptFeatures)

cSuite := suite.New(suite.Options{
Client: client,
GatewayClassName: *flags.GatewayClassName,
Debug: *flags.ShowDebug,
CleanupBaseResources: *flags.CleanupBaseResources,
SupportedFeatures: supportedFeatures,
EnableAllSupportedFeatures: *flags.EnableAllSupportedFeatures,
Client: client,
GatewayClassName: *flags.GatewayClassName,
Debug: *flags.ShowDebug,
CleanupBaseResources: *flags.CleanupBaseResources,
SupportedFeatures: supportedFeatures,
})
cSuite.Setup(t)

Expand Down
11 changes: 5 additions & 6 deletions conformance/utils/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@ import (
)

var (
GatewayClassName = flag.String("gateway-class", "gateway-conformance", "Name of GatewayClass to use for tests")
ShowDebug = flag.Bool("debug", false, "Whether to print debug logs")
CleanupBaseResources = flag.Bool("cleanup-base-resources", true, "Whether to cleanup base test resources after the run")
SupportedFeatures = flag.String("supported-features", "", "Supported features included in conformance tests suites")
ExemptFeatures = flag.String("exempt-features", "", "Exempt Features excluded from conformance tests suites")
EnableAllSupportedFeatures = flag.Bool("all-features", false, "Whether to enable all supported features for conformance tests")
GatewayClassName = flag.String("gateway-class", "gateway-conformance", "Name of GatewayClass to use for tests")
ShowDebug = flag.Bool("debug", false, "Whether to print debug logs")
CleanupBaseResources = flag.Bool("cleanup-base-resources", true, "Whether to cleanup base test resources after the run")
SupportedFeatures = flag.String("supported-features", "", "Supported features included in conformance tests suites")
ExemptFeatures = flag.String("exempt-features", "", "Exempt Features excluded from conformance tests suites")
)

// Mesh specific flags
Expand Down
15 changes: 10 additions & 5 deletions conformance/utils/suite/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,18 @@ var MeshCoreFeatures = sets.New(
// Features - Compilations
// -----------------------------------------------------------------------------

// AllFeatures contains all the supported features and can be used to run all
// conformance tests with `all-features` flag.
//
// AllGatewayFeatures are all the features applicable for Gateway (Ingress).
// NOTE: as new feature sets are added they should be inserted into this set.
var AllFeatures = sets.New[SupportedFeature]().
var AllGatewayFeatures = sets.New[SupportedFeature]().
Insert(StandardExtendedFeatures.UnsortedList()...).
Insert(ExperimentalExtendedFeatures.UnsortedList()...).
Insert(HTTPExtendedFeatures.UnsortedList()...).
Insert(TLSCoreFeatures.UnsortedList()...).
Insert(TLSCoreFeatures.UnsortedList()...)

// AllFeatures contains all the supported features and can be used to run all
// conformance tests.
//
// NOTE: as new feature sets are added they should be inserted into this set.
var AllFeatures = sets.New[SupportedFeature]().
Insert(AllGatewayFeatures.UnsortedList()...).
Insert(MeshCoreFeatures.UnsortedList()...)
11 changes: 4 additions & 7 deletions conformance/utils/suite/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,9 @@ type Options struct {

// CleanupBaseResources indicates whether or not the base test
// resources such as Gateways should be cleaned up after the run.
CleanupBaseResources bool
SupportedFeatures sets.Set[SupportedFeature]
EnableAllSupportedFeatures bool
TimeoutConfig config.TimeoutConfig
CleanupBaseResources bool
SupportedFeatures sets.Set[SupportedFeature]
TimeoutConfig config.TimeoutConfig
// SkipTests contains all the tests not to be run and can be used to opt out
// of specific tests
SkipTests []string
Expand All @@ -87,9 +86,7 @@ func New(s Options) *ConformanceTestSuite {
roundTripper = &roundtripper.DefaultRoundTripper{Debug: s.Debug, TimeoutConfig: s.TimeoutConfig}
}

if s.EnableAllSupportedFeatures == true {
s.SupportedFeatures = AllFeatures
} else if s.SupportedFeatures == nil {
if s.SupportedFeatures == nil {
s.SupportedFeatures = StandardCoreFeatures
} else {
for feature := range StandardCoreFeatures {
Expand Down