diff --git a/pkg/common/common_suite_test.go b/pkg/common/common_suite_test.go new file mode 100644 index 00000000000..8484ecc38c6 --- /dev/null +++ b/pkg/common/common_suite_test.go @@ -0,0 +1,29 @@ +/* +Copyright 2022 The Fluid Authors. + +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 common + +import ( + "testing" + + "github.com/onsi/ginkgo/v2" + "github.com/onsi/gomega" +) + +func TestCommon(t *testing.T) { + gomega.RegisterFailHandler(ginkgo.Fail) + ginkgo.RunSpecs(t, "Package Common Suite") +} diff --git a/pkg/common/critical_fuse_pod_test.go b/pkg/common/critical_fuse_pod_test.go index d8d23666354..126d7060459 100644 --- a/pkg/common/critical_fuse_pod_test.go +++ b/pkg/common/critical_fuse_pod_test.go @@ -17,23 +17,18 @@ limitations under the License. package common import ( - "testing" + "github.com/onsi/ginkgo/v2" + "github.com/onsi/gomega" ) -func TestCriticalFusePodEnabled(t *testing.T) { - want := false - got := CriticalFusePodEnabled() - - if got != want { - t.Errorf("want %v, got %v", want, got) - } -} - -func TestPortCheckEnabled(t *testing.T) { - want := false - got := PortCheckEnabled() - - if got != want { - t.Errorf("want %v, got %v", want, got) - } -} +var _ = ginkgo.Describe("CriticalFusePodEnabled", func() { + ginkgo.It("should return false by default", func() { + gomega.Expect(CriticalFusePodEnabled()).To(gomega.BeFalse()) + }) +}) + +var _ = ginkgo.Describe("PortCheckEnabled", func() { + ginkgo.It("should return false by default", func() { + gomega.Expect(PortCheckEnabled()).To(gomega.BeFalse()) + }) +})