From 83acc3b54d036be05cba4caf17a92f2273745691 Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Thu, 6 Jun 2024 00:48:45 -0700 Subject: [PATCH] Fix fuzz tests Signed-off-by: Tamal Saha --- apis/authentication/install/roundtrip_test.go | 4 +-- apis/cost/install/roundtrip_test.go | 4 +-- apis/offline/install/roundtrip_test.go | 4 +-- apis/policy/install/roundtrip_test.go | 4 +-- pkg/apiserver/scheme_test.go | 29 ------------------- 5 files changed, 8 insertions(+), 37 deletions(-) delete mode 100644 pkg/apiserver/scheme_test.go diff --git a/apis/authentication/install/roundtrip_test.go b/apis/authentication/install/roundtrip_test.go index a52f5b57e9..cc4074bcc4 100644 --- a/apis/authentication/install/roundtrip_test.go +++ b/apis/authentication/install/roundtrip_test.go @@ -19,13 +19,13 @@ package install import ( "testing" - identityfuzzer "kubeops.dev/ui-server/apis/identity/fuzzer" + "kubeops.dev/ui-server/apis/authentication/fuzzer" "k8s.io/apimachinery/pkg/api/apitesting/roundtrip" ) func TestRoundTripTypes(t *testing.T) { - roundtrip.RoundTripTestForAPIGroup(t, Install, identityfuzzer.Funcs) + roundtrip.RoundTripTestForAPIGroup(t, Install, fuzzer.Funcs) // TODO: enable protobuf generation for the sample-apiserver // roundtrip.RoundTripProtobufTestForAPIGroup(t, Install, identityfuzzer.Funcs) } diff --git a/apis/cost/install/roundtrip_test.go b/apis/cost/install/roundtrip_test.go index 5b274bd2fd..750dcf39d0 100644 --- a/apis/cost/install/roundtrip_test.go +++ b/apis/cost/install/roundtrip_test.go @@ -19,13 +19,13 @@ package install import ( "testing" - costfuzzer "kubeops.dev/ui-server/apis/cost/fuzzer" + "kubeops.dev/ui-server/apis/cost/fuzzer" "k8s.io/apimachinery/pkg/api/apitesting/roundtrip" ) func TestRoundTripTypes(t *testing.T) { - roundtrip.RoundTripTestForAPIGroup(t, Install, costfuzzer.Funcs) + roundtrip.RoundTripTestForAPIGroup(t, Install, fuzzer.Funcs) // TODO: enable protobuf generation for the sample-apiserver // roundtrip.RoundTripProtobufTestForAPIGroup(t, Install, identityfuzzer.Funcs) } diff --git a/apis/offline/install/roundtrip_test.go b/apis/offline/install/roundtrip_test.go index a52f5b57e9..5f87a22e52 100644 --- a/apis/offline/install/roundtrip_test.go +++ b/apis/offline/install/roundtrip_test.go @@ -19,13 +19,13 @@ package install import ( "testing" - identityfuzzer "kubeops.dev/ui-server/apis/identity/fuzzer" + "kubeops.dev/ui-server/apis/offline/fuzzer" "k8s.io/apimachinery/pkg/api/apitesting/roundtrip" ) func TestRoundTripTypes(t *testing.T) { - roundtrip.RoundTripTestForAPIGroup(t, Install, identityfuzzer.Funcs) + roundtrip.RoundTripTestForAPIGroup(t, Install, fuzzer.Funcs) // TODO: enable protobuf generation for the sample-apiserver // roundtrip.RoundTripProtobufTestForAPIGroup(t, Install, identityfuzzer.Funcs) } diff --git a/apis/policy/install/roundtrip_test.go b/apis/policy/install/roundtrip_test.go index a06d4f81de..fadfe6b257 100644 --- a/apis/policy/install/roundtrip_test.go +++ b/apis/policy/install/roundtrip_test.go @@ -19,13 +19,13 @@ package install import ( "testing" - policyfuzzer "kubeops.dev/ui-server/apis/policy/fuzzer" + "kubeops.dev/ui-server/apis/policy/fuzzer" "k8s.io/apimachinery/pkg/api/apitesting/roundtrip" ) func TestRoundTripTypes(t *testing.T) { - roundtrip.RoundTripTestForAPIGroup(t, Install, policyfuzzer.Funcs) + roundtrip.RoundTripTestForAPIGroup(t, Install, fuzzer.Funcs) // TODO: enable protobuf generation for the sample-apiserver // roundtrip.RoundTripProtobufTestForAPIGroup(t, Install, identityfuzzer.Funcs) } diff --git a/pkg/apiserver/scheme_test.go b/pkg/apiserver/scheme_test.go deleted file mode 100644 index 14ab7fa986..0000000000 --- a/pkg/apiserver/scheme_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright AppsCode Inc. and Contributors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package apiserver - -import ( - "testing" - - identityfuzzer "kubeops.dev/ui-server/apis/identity/fuzzer" - - "k8s.io/apimachinery/pkg/api/apitesting/roundtrip" -) - -func TestRoundTripTypes(t *testing.T) { - roundtrip.RoundTripTestForScheme(t, Scheme, identityfuzzer.Funcs) -}