Skip to content

Commit

Permalink
remove modules/test/helpers as its no longer used
Browse files Browse the repository at this point in the history
  • Loading branch information
stuggi committed Oct 11, 2023
1 parent 4e0cfd0 commit 61171ca
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 366 deletions.
1 change: 0 additions & 1 deletion modules/certmanager/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ require (
github.com/onsi/ginkgo/v2 v2.12.1
github.com/onsi/gomega v1.28.0
github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230919113507-d74c2f31d216
github.com/openstack-k8s-operators/lib-common/modules/test v0.1.2-0.20230919113507-d74c2f31d216
go.uber.org/zap v1.26.0
k8s.io/api v0.26.9
k8s.io/apimachinery v0.26.9
Expand Down
14 changes: 7 additions & 7 deletions modules/certmanager/test/functional/certmanager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var _ = Describe("certmanager module", func() {

_, err := i.CreateOrPatch(ctx, h)
Expect(err).ShouldNot(HaveOccurred())
issuer := thCertmanager.GetIssuer(names.SelfSignedIssuerName)
issuer := th.GetIssuer(names.SelfSignedIssuerName)
Expect(issuer.Spec.SelfSigned).NotTo(BeNil())
Expect(issuer.Labels["f"]).To(Equal("l"))

Expand All @@ -55,7 +55,7 @@ var _ = Describe("certmanager module", func() {

_, err := i.CreateOrPatch(ctx, h)
Expect(err).ShouldNot(HaveOccurred())
issuer := thCertmanager.GetIssuer(names.CAName)
issuer := th.GetIssuer(names.CAName)
Expect(issuer.Spec.CA).NotTo(BeNil())
Expect(issuer.Spec.CA.SecretName).To(Equal("secret"))
Expect(issuer.Labels["f"]).To(Equal("l"))
Expand All @@ -74,11 +74,11 @@ var _ = Describe("certmanager module", func() {

_, err := i.CreateOrPatch(ctx, h)
Expect(err).ShouldNot(HaveOccurred())
issuer := thCertmanager.GetIssuer(names.IssuerName)
issuer := th.GetIssuer(names.IssuerName)
Expect(issuer).NotTo(BeNil())
err = i.Delete(ctx, h)
Expect(err).ShouldNot(HaveOccurred())
thCertmanager.AssertIssuerDoesNotExist(names.IssuerName)
th.AssertIssuerDoesNotExist(names.IssuerName)
})

It("creates certificate", func() {
Expand All @@ -105,7 +105,7 @@ var _ = Describe("certmanager module", func() {

_, err := c.CreateOrPatch(ctx, h)
Expect(err).ShouldNot(HaveOccurred())
cert := thCertmanager.GetCert(names.CertName)
cert := th.GetCert(names.CertName)
Expect(cert.Spec.CommonName).To(Equal("keystone-public-openstack.apps-crc.testing"))
Expect(cert.Spec.SecretName).To(Equal("secret"))
Expect(cert.Labels["f"]).To(Equal("l"))
Expand Down Expand Up @@ -135,10 +135,10 @@ var _ = Describe("certmanager module", func() {

_, err := c.CreateOrPatch(ctx, h)
Expect(err).ShouldNot(HaveOccurred())
cert := thCertmanager.GetCert(names.CertName)
cert := th.GetCert(names.CertName)
Expect(cert).NotTo(BeNil())
err = c.Delete(ctx, h)
Expect(err).ShouldNot(HaveOccurred())
thCertmanager.AssertIssuerDoesNotExist(names.CertName)
th.AssertIssuerDoesNotExist(names.CertName)
})
})
26 changes: 11 additions & 15 deletions modules/certmanager/test/functional/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import (

certmanager_test "github.com/openstack-k8s-operators/lib-common/modules/certmanager/test/helpers"
"github.com/openstack-k8s-operators/lib-common/modules/common/helper"
common_test "github.com/openstack-k8s-operators/lib-common/modules/test/helpers"
//+kubebuilder:scaffold:imports
)

Expand All @@ -61,17 +60,16 @@ const (
)

var (
cfg *rest.Config
k8sClient client.Client
testEnv *envtest.Environment
ctx context.Context
cancel context.CancelFunc
logger logr.Logger
h *helper.Helper
th *common_test.TestHelper
thCertmanager *certmanager_test.TestHelper
namespace string
names Names
cfg *rest.Config
k8sClient client.Client
testEnv *envtest.Environment
ctx context.Context
cancel context.CancelFunc
logger logr.Logger
h *helper.Helper
th *certmanager_test.TestHelper
namespace string
names Names
)

func TestCommon(t *testing.T) {
Expand Down Expand Up @@ -116,10 +114,8 @@ var _ = BeforeSuite(func() {
k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme})
Expect(err).NotTo(HaveOccurred())
Expect(k8sClient).NotTo(BeNil())
th = common_test.NewTestHelper(ctx, k8sClient, timeout, interval, logger)
th = certmanager_test.NewTestHelper(ctx, k8sClient, timeout, interval, logger)
Expect(th).NotTo(BeNil())
thCertmanager = certmanager_test.NewTestHelper(ctx, k8sClient, timeout, interval, logger)
Expect(thCertmanager).NotTo(BeNil())

kclient, err := kubernetes.NewForConfig(cfg)
Expect(err).ToNot(HaveOccurred(), "failed to create kclient")
Expand Down
2 changes: 1 addition & 1 deletion modules/test/crd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestGetCRDDirFromModule(t *testing.T) {
// NOTE(gibi): this is not a good use case as k8s.io does not have
// CRDs stored. But in lib-common we have no go.mod deps on a repo
// that has such CRDs to test on.
path, err := GetCRDDirFromModule("k8s.io/api", "go.mod", "bases")
path, err := GetCRDDirFromModule("k8s.io/api", "../common/go.mod", "bases")
g.Expect(err).ShouldNot(HaveOccurred())
g.Expect(path).Should(MatchRegexp("/.*/k8s.io/api@v.*/bases"))
})
Expand Down
46 changes: 6 additions & 40 deletions modules/test/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,54 +5,20 @@ go 1.19
require (
github.com/go-logr/logr v1.2.4
github.com/onsi/gomega v1.28.0
github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230919113507-d74c2f31d216
golang.org/x/mod v0.12.0
sigs.k8s.io/controller-runtime v0.14.6
)

require github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.4.0 // indirect

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.10.1 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.1 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic v0.6.9 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/openshift/api v3.9.0+incompatible // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/onsi/ginkgo/v2 v2.12.1 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
golang.org/x/net v0.15.0 // indirect
golang.org/x/oauth2 v0.4.0 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/term v0.12.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
golang.org/x/tools v0.13.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/api v0.26.9 // indirect
k8s.io/apimachinery v0.26.9 // indirect
k8s.io/client-go v0.26.9 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230308215209-15aac26d736a // indirect
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

replace github.com/openstack-k8s-operators/lib-common/modules/common => ../common
Expand Down
Loading

0 comments on commit 61171ca

Please sign in to comment.