-
Notifications
You must be signed in to change notification settings - Fork 738
Expand file tree
/
Copy pathconformance_test.go
More file actions
51 lines (42 loc) · 1.54 KB
/
conformance_test.go
File metadata and controls
51 lines (42 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright Envoy Gateway Authors
// SPDX-License-Identifier: Apache-2.0
// The full text of the Apache license is available in the LICENSE file at
// the root of the repo.
//go:build conformance
package conformance
import (
"flag"
"os"
"testing"
"sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
"sigs.k8s.io/gateway-api/conformance/tests"
"sigs.k8s.io/gateway-api/conformance/utils/flags"
"sigs.k8s.io/gateway-api/conformance/utils/suite"
"sigs.k8s.io/gateway-api/conformance/utils/tlog"
)
func TestGatewayAPIConformance(t *testing.T) {
flag.Parse()
log.SetLogger(zap.New(zap.WriteTo(os.Stderr), zap.UseDevMode(true)))
if flags.RunTest != nil && *flags.RunTest != "" {
tlog.Logf(t, "Running Conformance test %s with %s GatewayClass\n cleanup: %t\n debug: %t",
*flags.RunTest, *flags.GatewayClassName, *flags.CleanupBaseResources, *flags.ShowDebug)
} else {
tlog.Logf(t, "Running Conformance tests with %s GatewayClass\n cleanup: %t\n debug: %t",
*flags.GatewayClassName, *flags.CleanupBaseResources, *flags.ShowDebug)
}
opts := conformanceOpts(t)
opts.RunTest = *flags.RunTest
// If focusing on a single test, clear the skip list to ensure it runs.
if opts.RunTest != "" {
opts.SkipTests = nil
}
cSuite, err := suite.NewConformanceTestSuite(opts)
if err != nil {
t.Fatalf("Error creating conformance test suite: %v", err)
}
cSuite.Setup(t, tests.ConformanceTests)
if err := cSuite.Run(t, tests.ConformanceTests); err != nil {
t.Fatalf("Error running conformance tests: %v", err)
}
}