Skip to content

Commit

Permalink
CRD Replicator unit tests fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cheina97 committed Sep 27, 2023
1 parent b3287dc commit 757db1f
Show file tree
Hide file tree
Showing 17 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion internal/auth-service/auth_service_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var _ = BeforeSuite(func() {
_ = tMan.createToken()

var err error
cluster, _, err = testutil.NewTestCluster([]string{filepath.Join("..", "..", "deployments", "liqo", "crds")})
cluster, _, err = testutil.NewTestCluster([]string{filepath.Join("..", "..", "deployments", "liqo", "crds", "charts", "liqo-crds", "crds")})
Expect(err).ToNot(HaveOccurred())

informerFactory := informers.NewSharedInformerFactoryWithOptions(cluster.GetClient(), 300*time.Second, informers.WithNamespace("default"))
Expand Down
4 changes: 3 additions & 1 deletion internal/crdReplicator/crdReplicator_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ var _ = BeforeSuite(func() {
ctx, cancel = context.WithCancel(context.Background())

// The same cluster is used both as local and remote, using different namespaces.
clsrt, mgr, err := testutil.NewTestCluster([]string{filepath.Join("..", "..", "deployments", "liqo", "crds")})
clsrt, mgr, err := testutil.NewTestCluster([]string{
filepath.Join("..", "..", "deployments", "liqo", "charts", "liqo-crds", "crds"),
})
Expect(err).ToNot(HaveOccurred())
cluster = clsrt

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestForeignclusterwatcher(t *testing.T) {

var _ = BeforeSuite(func() {
testutil.LogsToGinkgoWriter()
clstr, _, err := testutil.NewTestCluster([]string{filepath.Join("..", "..", "..", "..", "deployments", "liqo", "crds")})
clstr, _, err := testutil.NewTestCluster([]string{filepath.Join("..", "..", "..", "..", "deployments", "liqo", "crds", "charts", "liqo-crds", "crds")})

Check failure on line 38 in internal/liqonet/network-manager/netcfgcreator/netcfgcreator_suite_test.go

View workflow job for this annotation

GitHub Actions / Lint golang files

line is 152 characters (lll)
Expect(err).ToNot(HaveOccurred())

testcluster = clstr
Expand Down
2 changes: 1 addition & 1 deletion internal/liqonet/route-operator/overlayOperator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ func setupOverlayTestEnv() error {
return err
}
overlayEnvTest = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "deployments", "liqo", "crds")},
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "deployments", "liqo", "crds", "charts", "liqo-crds", "crds")},
}
config, err := overlayEnvTest.Start()
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ var _ = BeforeSuite(func() {
err = netv1alpha1.AddToScheme(scheme.Scheme)
Expect(err).ShouldNot(HaveOccurred())
envTest = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "deployments", "liqo", "crds")},
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "deployments", "liqo", "crds", "charts", "liqo-crds", "crds")},
}
config, err := envTest.Start()
Expect(err).ShouldNot(HaveOccurred())
Expand Down
2 changes: 1 addition & 1 deletion pkg/identityManager/identityManager_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ var _ = BeforeSuite(func() {
}, remoteCluster.ClusterID)

var err error
cluster, _, err = testutil.NewTestCluster([]string{filepath.Join("..", "..", "deployments", "liqo", "crds")})
cluster, _, err = testutil.NewTestCluster([]string{filepath.Join("..", "..", "deployments", "liqo", "crds", "charts", "liqo-crds", "crds")})
Expect(err).ToNot(HaveOccurred())

client = cluster.GetClient()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ var _ = Describe("ForeignClusterOperator", func() {
ctx, cancel = context.WithCancel(context.Background())

var err error
cluster, mgr, err = testutil.NewTestCluster([]string{filepath.Join("..", "..", "..", "deployments", "liqo", "crds")})
cluster, mgr, err = testutil.NewTestCluster([]string{filepath.Join("..", "..", "..", "deployments", "liqo", "crds", "charts", "liqo-crds", "crds")})
if err != nil {
By(err.Error())
os.Exit(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ var _ = BeforeSuite(func() {
testutil.LogsToGinkgoWriter()

homeClusterEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "deployments", "liqo", "crds")},
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "deployments", "liqo", "crds", "charts", "liqo-crds", "crds")},
}

var err error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func createCluster() {
ctx, cancel = context.WithCancel(context.Background())
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{
filepath.Join("..", "..", "..", "deployments", "liqo", "crds"),
filepath.Join("..", "..", "..", "deployments", "liqo", "crds", "charts", "liqo-crds", "crds"),
},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ var _ = Describe("ResourceOffer Controller", func() {

BeforeEach(func() {
var err error
cluster, mgr, err = testutil.NewTestCluster([]string{filepath.Join("..", "..", "..", "deployments", "liqo", "crds")})
cluster, mgr, err = testutil.NewTestCluster([]string{filepath.Join("..", "..", "..", "deployments", "liqo", "crds", "charts", "liqo-crds", "crds")})
if err != nil {
By(err.Error())
os.Exit(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var _ = BeforeSuite(func() {

By("bootstrapping test environment")
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "deployments", "liqo", "crds")},
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "deployments", "liqo", "crds", "charts", "liqo-crds", "crds")},
ErrorIfCRDPathMissing: true,
}
cfg, err := testEnv.Start()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func TestVirtualNode(t *testing.T) {
var _ = BeforeSuite(func() {
By("bootstrapping test environment")
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "deployments", "liqo", "crds")},
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "deployments", "liqo", "crds", "charts", "liqo-crds", "crds")},
}

ctx, cancel = context.WithCancel(context.Background())
Expand Down
2 changes: 1 addition & 1 deletion pkg/tenantNamespace/tenantNamespace_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var _ = BeforeSuite(func() {
}

var err error
cluster, _, err = testutil.NewTestCluster([]string{filepath.Join("..", "..", "deployments", "liqo", "crds")})
cluster, _, err = testutil.NewTestCluster([]string{filepath.Join("..", "..", "deployments", "liqo", "crds", "charts", "liqo-crds", "crds")})
Expect(err).ToNot(HaveOccurred())

namespaceManager = NewCachedManager(ctx, cluster.GetClient())
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/authenticationtoken/authenticationtoken_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func createCluster() {
ctx, cancel = context.WithCancel(context.Background())
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{
filepath.Join("..", "..", "..", "deployments", "liqo", "crds"),
filepath.Join("..", "..", "..", "deployments", "liqo", "crds", "charts", "liqo-crds", "crds"),
},
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/csr/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var (
var _ = BeforeSuite(func() {
ctx, cancel = context.WithCancel(context.Background())

cluster, _, err = testutil.NewTestCluster([]string{filepath.Join("..", "..", "..", "deployments", "liqo", "crds")})
cluster, _, err = testutil.NewTestCluster([]string{filepath.Join("..", "..", "..", "deployments", "liqo", "crds", "charts", "liqo-crds", "crds")})
Expect(err).To(BeNil())
})

Expand Down
2 changes: 1 addition & 1 deletion pkg/virtualKubelet/liqoNodeProvider/nodeProvider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ var _ = Describe("NodeProvider", func() {
BeforeEach(func() {
ctx, cancel = context.WithCancel(context.Background())

cluster, _, err = testutil.NewTestCluster([]string{filepath.Join("..", "..", "..", "deployments", "liqo", "crds")})
cluster, _, err = testutil.NewTestCluster([]string{filepath.Join("..", "..", "..", "deployments", "liqo", "crds", "charts", "liqo-crds", "crds")})
Expect(err).To(BeNil())

client := kubernetes.NewForConfigOrDie(cluster.GetCfg())
Expand Down
2 changes: 1 addition & 1 deletion test/integration/integration_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func initNatMappingController() error {
return err
}
envTest = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "deployments", "liqo", "crds")},
CRDDirectoryPaths: []string{filepath.Join("..", "..", "deployments", "liqo", "crds", "charts", "liqo-crds", "crds")},
}
config, err := envTest.Start()
if err != nil {
Expand Down

0 comments on commit 757db1f

Please sign in to comment.