-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use upstream gateway-api conformance tests
- make all implementations use upstream gateway-api conformance tests - patch gateway-api to inject test and feature information in user-agent
- Loading branch information
1 parent
871006b
commit 23a2424
Showing
11 changed files
with
156 additions
and
290 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
diff --git a/conformance/conformance_test.go b/conformance/conformance_test.go | ||
index bbd65634..de2e5222 100644 | ||
--- a/conformance/conformance_test.go | ||
+++ b/conformance/conformance_test.go | ||
@@ -38,6 +38,7 @@ func TestConformance(t *testing.T) { | ||
if err != nil { | ||
t.Fatalf("Error loading Kubernetes config: %v", err) | ||
} | ||
+ cfg.UserAgent = "gateway-api-conformance.test::v1.0.0::::" | ||
client, err := client.New(cfg, client.Options{}) | ||
if err != nil { | ||
t.Fatalf("Error initializing Kubernetes client: %v", err) | ||
diff --git a/conformance/utils/suite/suite.go b/conformance/utils/suite/suite.go | ||
index 58a55624..c852ac5c 100644 | ||
--- a/conformance/utils/suite/suite.go | ||
+++ b/conformance/utils/suite/suite.go | ||
@@ -21,10 +21,12 @@ import ( | ||
"strings" | ||
"testing" | ||
|
||
+ "github.com/stretchr/testify/require" | ||
"k8s.io/apimachinery/pkg/util/sets" | ||
clientset "k8s.io/client-go/kubernetes" | ||
"k8s.io/client-go/rest" | ||
"sigs.k8s.io/controller-runtime/pkg/client" | ||
+ clicfg "sigs.k8s.io/controller-runtime/pkg/client/config" | ||
|
||
"sigs.k8s.io/gateway-api/apis/v1beta1" | ||
"sigs.k8s.io/gateway-api/conformance" | ||
@@ -210,6 +212,22 @@ func (suite *ConformanceTestSuite) Setup(t *testing.T) { | ||
func (suite *ConformanceTestSuite) Run(t *testing.T, tests []ConformanceTest) { | ||
for _, test := range tests { | ||
t.Run(test.ShortName, func(t *testing.T) { | ||
+ cfg, err := clicfg.GetConfig() | ||
+ require.NoError(t, err, "error getting Kubernetes config") | ||
+ featureNames := []string{} | ||
+ for _, v := range test.Features { | ||
+ featureNames = append(featureNames, string(v)) | ||
+ } | ||
+ cfg.UserAgent = "gateway-api-conformance.test::" + | ||
+ "v1.0.0" + "::" + test.ShortName + "::" + strings.Join(featureNames, ",") | ||
+ require.NoError(t, err, "error loading Kubernetes config") | ||
+ client, err := client.New(cfg, client.Options{}) | ||
+ require.NoError(t, err, "error initializing Kubernetes client") | ||
+ clientset, err := clientset.NewForConfig(cfg) | ||
+ require.NoError(t, err, "error initializing Kubernetes clientset") | ||
+ suite.Client = client | ||
+ suite.Clientset = clientset | ||
+ | ||
test.Run(t, suite) | ||
}) | ||
} |
Oops, something went wrong.