Skip to content

Commit 2b17fc7

Browse files
committed
feat: skip-tests flag added to conformance CLI.
Signed-off-by: Mattia Lavacca <[email protected]>
1 parent 995b170 commit 2b17fc7

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

conformance/conformance_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func TestConformance(t *testing.T) {
5252

5353
supportedFeatures := suite.ParseSupportedFeatures(*flags.SupportedFeatures)
5454
exemptFeatures := suite.ParseSupportedFeatures(*flags.ExemptFeatures)
55-
55+
skipTests := suite.ParseSkipTests(*flags.SkipTests)
5656
namespaceLabels := suite.ParseNamespaceLabels(*flags.NamespaceLabels)
5757

5858
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]",
@@ -72,6 +72,7 @@ func TestConformance(t *testing.T) {
7272
ExemptFeatures: exemptFeatures,
7373
EnableAllSupportedFeatures: *flags.EnableAllSupportedFeatures,
7474
NamespaceLabels: namespaceLabels,
75+
SkipTests: skipTests,
7576
})
7677
cSuite.Setup(t)
7778

conformance/utils/flags/flags.go

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ var (
2828
ShowDebug = flag.Bool("debug", false, "Whether to print debug logs")
2929
CleanupBaseResources = flag.Bool("cleanup-base-resources", true, "Whether to cleanup base test resources after the run")
3030
SupportedFeatures = flag.String("supported-features", "", "Supported features included in conformance tests suites")
31+
SkipTests = flag.String("skip-tests", "", "Comma-separated list of tests to skip")
3132
ExemptFeatures = flag.String("exempt-features", "", "Exempt Features excluded from conformance tests suites")
3233
EnableAllSupportedFeatures = flag.Bool("all-features", false, "Whether to enable all supported features for conformance tests")
3334
NamespaceLabels = flag.String("namespace-labels", "", "Comma-separated list of name=value labels to add to test namespaces")

conformance/utils/suite/suite.go

+9
Original file line numberDiff line numberDiff line change
@@ -261,3 +261,12 @@ func ParseNamespaceLabels(f string) map[string]string {
261261
}
262262
return res
263263
}
264+
265+
// ParseSkipTests parses flag arguments and converts the string to
266+
// []string containing the tests to be skipped.
267+
func ParseSkipTests(t string) []string {
268+
if t == "" {
269+
return nil
270+
}
271+
return strings.Split(t, ",")
272+
}

0 commit comments

Comments
 (0)