Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit tests: envtest server new crds path #2048

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 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,9 @@ 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", "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,9 @@ 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", "charts", "liqo-crds", "crds"),
})
Expect(err).ToNot(HaveOccurred())

testcluster = clstr
Expand Down
4 changes: 3 additions & 1 deletion internal/liqonet/route-operator/overlayOperator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,9 @@ func setupOverlayTestEnv() error {
return err
}
overlayEnvTest = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "deployments", "liqo", "crds")},
CRDDirectoryPaths: []string{
filepath.Join("..", "..", "..", "deployments", "liqo", "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,9 @@ 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", "charts", "liqo-crds", "crds"),
},
}
config, err := envTest.Start()
Expect(err).ShouldNot(HaveOccurred())
Expand Down
4 changes: 3 additions & 1 deletion pkg/identityManager/identityManager_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ 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", "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,9 @@ 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", "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,9 @@ var _ = BeforeSuite(func() {
testutil.LogsToGinkgoWriter()

homeClusterEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "deployments", "liqo", "crds")},
CRDDirectoryPaths: []string{
filepath.Join("..", "..", "..", "deployments", "liqo", "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", "charts", "liqo-crds", "crds"),
},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ 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", "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,9 @@ var _ = BeforeSuite(func() {

By("bootstrapping test environment")
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "deployments", "liqo", "crds")},
CRDDirectoryPaths: []string{
filepath.Join("..", "..", "..", "deployments", "liqo", "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,9 @@ 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", "charts", "liqo-crds", "crds"),
},
}

ctx, cancel = context.WithCancel(context.Background())
Expand Down
4 changes: 3 additions & 1 deletion pkg/tenantNamespace/tenantNamespace_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ 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", "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", "charts", "liqo-crds", "crds"),
},
}

Expand Down
4 changes: 3 additions & 1 deletion pkg/utils/csr/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ 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", "charts", "liqo-crds", "crds"),
})
Expect(err).To(BeNil())
})

Expand Down
4 changes: 3 additions & 1 deletion pkg/virtualKubelet/liqoNodeProvider/nodeProvider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ 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", "charts", "liqo-crds", "crds"),
})
Expect(err).To(BeNil())

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