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

[Cleanup] Use PROJECT_DIR for crd path instead of indirect path #4054

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
1 change: 1 addition & 0 deletions Makefile-test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ test: gotestsum ## Run tests.
.PHONY: test-integration
test-integration: gomod-download envtest ginkgo dep-crds kueuectl ginkgo-top ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" \
PROJECT_DIR=$(PROJECT_DIR)/ \
KUEUE_BIN=$(PROJECT_DIR)/bin \
ENVTEST_K8S_VERSION=$(ENVTEST_K8S_VERSION) \
API_LOG_LEVEL=$(INTEGRATION_API_LOG_LEVEL) \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package provisioning

import (
"context"
"path/filepath"
"testing"

"github.com/onsi/ginkgo/v2"
Expand All @@ -35,16 +34,14 @@ import (
"sigs.k8s.io/kueue/pkg/queue"
"sigs.k8s.io/kueue/pkg/webhooks"
"sigs.k8s.io/kueue/test/integration/framework"
"sigs.k8s.io/kueue/test/util"
)

var (
cfg *rest.Config
k8sClient client.Client
ctx context.Context
fwk *framework.Framework
crdPath = filepath.Join("..", "..", "..", "..", "..", "config", "components", "crd", "bases")
depCRDPaths = []string{filepath.Join("..", "..", "..", "..", "..", "dep-crds", "cluster-autoscaler")}
webhookPath = filepath.Join("..", "..", "..", "..", "..", "config", "components", "webhook")
cfg *rest.Config
k8sClient client.Client
ctx context.Context
fwk *framework.Framework
)

func TestProvisioning(t *testing.T) {
Expand All @@ -56,7 +53,12 @@ func TestProvisioning(t *testing.T) {
}

var _ = ginkgo.BeforeSuite(func() {
fwk = &framework.Framework{CRDPath: crdPath, DepCRDPaths: depCRDPaths, WebhookPath: webhookPath}
fwk = &framework.Framework{
DepCRDPaths: []string{
util.AutoscalerCrds,
},
WebhookPath: util.WebhookPath,
}
cfg = fwk.Init()
ctx, k8sClient = fwk.SetupClient(cfg)
})
Expand Down
16 changes: 8 additions & 8 deletions test/integration/controller/core/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package core

import (
"context"
"path/filepath"
"testing"

"github.com/onsi/ginkgo/v2"
Expand All @@ -34,15 +33,14 @@ import (
"sigs.k8s.io/kueue/pkg/queue"
"sigs.k8s.io/kueue/pkg/webhooks"
"sigs.k8s.io/kueue/test/integration/framework"
"sigs.k8s.io/kueue/test/util"
)

var (
cfg *rest.Config
k8sClient client.Client
ctx context.Context
fwk *framework.Framework
crdPath = filepath.Join("..", "..", "..", "..", "config", "components", "crd", "bases")
webhookPath = filepath.Join("..", "..", "..", "..", "config", "components", "webhook")
cfg *rest.Config
k8sClient client.Client
ctx context.Context
fwk *framework.Framework
)

func TestAPIs(t *testing.T) {
Expand All @@ -54,7 +52,9 @@ func TestAPIs(t *testing.T) {
}

var _ = ginkgo.BeforeSuite(func() {
fwk = &framework.Framework{CRDPath: crdPath, WebhookPath: webhookPath}
fwk = &framework.Framework{
WebhookPath: util.WebhookPath,
}
cfg = fwk.Init()
ctx, k8sClient = fwk.SetupClient(cfg)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ var _ = ginkgo.Describe("Setup Controllers", ginkgo.Ordered, ginkgo.ContinueOnFa
)

ginkgo.BeforeEach(func() {
fwk = &framework.Framework{CRDPath: crdPath}
fwk = &framework.Framework{}
cfg = fwk.Init()
ctx, k8sClient = fwk.SetupClient(cfg)
fwk.StartManager(ctx, cfg, managerSetup(jobframework.WithEnabledFrameworks([]string{jobset.FrameworkName})))
Expand Down Expand Up @@ -99,7 +99,7 @@ var _ = ginkgo.Describe("Setup Controllers", ginkgo.Ordered, ginkgo.ContinueOnFa

ginkgo.By("Install the JobSet CRDs", func() {
options := envtest.CRDInstallOptions{
Paths: []string{jobsetCrdPath},
Paths: []string{util.JobsetCrds},
ErrorIfPathMissing: true,
CleanUpAfterUse: true,
}
Expand Down
11 changes: 4 additions & 7 deletions test/integration/controller/jobframework/setup/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package job

import (
"context"
"path/filepath"
"testing"

"github.com/onsi/ginkgo/v2"
Expand All @@ -32,12 +31,10 @@ import (
)

var (
cfg *rest.Config
k8sClient client.Client
ctx context.Context
fwk *framework.Framework
crdPath = filepath.Join("..", "..", "..", "..", "..", "config", "components", "crd", "bases")
jobsetCrdPath = filepath.Join("..", "..", "..", "..", "..", "dep-crds", "jobset-operator")
cfg *rest.Config
k8sClient client.Client
ctx context.Context
fwk *framework.Framework
)

func TestAPIs(t *testing.T) {
Expand Down
15 changes: 6 additions & 9 deletions test/integration/controller/jobs/appwrapper/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package appwrapper

import (
"context"
"path/filepath"
"testing"

"github.com/onsi/ginkgo/v2"
Expand All @@ -39,15 +38,14 @@ import (
"sigs.k8s.io/kueue/pkg/queue"
"sigs.k8s.io/kueue/pkg/scheduler"
"sigs.k8s.io/kueue/test/integration/framework"
"sigs.k8s.io/kueue/test/util"
)

var (
cfg *rest.Config
k8sClient client.Client
ctx context.Context
fwk *framework.Framework
crdPath = filepath.Join("..", "..", "..", "..", "..", "config", "components", "crd", "bases")
appwrapperCrdPath = filepath.Join("..", "..", "..", "..", "..", "dep-crds", "appwrapper-crds")
cfg *rest.Config
k8sClient client.Client
ctx context.Context
fwk *framework.Framework
)

func TestAPIs(t *testing.T) {
Expand All @@ -60,8 +58,7 @@ func TestAPIs(t *testing.T) {

var _ = ginkgo.BeforeSuite(func() {
fwk = &framework.Framework{
CRDPath: crdPath,
DepCRDPaths: []string{appwrapperCrdPath},
DepCRDPaths: []string{util.AppWrapperCrds},
}
cfg = fwk.Init()
ctx, k8sClient = fwk.SetupClient(cfg)
Expand Down
6 changes: 1 addition & 5 deletions test/integration/controller/jobs/job/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package job

import (
"context"
"path/filepath"
"testing"

"github.com/onsi/ginkgo/v2"
Expand Down Expand Up @@ -46,7 +45,6 @@ var (
k8sClient client.Client
ctx context.Context
fwk *framework.Framework
crdPath = filepath.Join("..", "..", "..", "..", "..", "config", "components", "crd", "bases")
)

func TestAPIs(t *testing.T) {
Expand All @@ -58,9 +56,7 @@ func TestAPIs(t *testing.T) {
}

var _ = ginkgo.BeforeSuite(func() {
fwk = &framework.Framework{
CRDPath: crdPath,
}
fwk = &framework.Framework{}
cfg = fwk.Init()
ctx, k8sClient = fwk.SetupClient(cfg)
})
Expand Down
15 changes: 6 additions & 9 deletions test/integration/controller/jobs/jobset/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package jobset

import (
"context"
"path/filepath"
"testing"

"github.com/onsi/ginkgo/v2"
Expand All @@ -38,15 +37,14 @@ import (
"sigs.k8s.io/kueue/pkg/queue"
"sigs.k8s.io/kueue/pkg/scheduler"
"sigs.k8s.io/kueue/test/integration/framework"
"sigs.k8s.io/kueue/test/util"
)

var (
cfg *rest.Config
k8sClient client.Client
ctx context.Context
fwk *framework.Framework
crdPath = filepath.Join("..", "..", "..", "..", "..", "config", "components", "crd", "bases")
jobsetCrdPath = filepath.Join("..", "..", "..", "..", "..", "dep-crds", "jobset-operator")
cfg *rest.Config
k8sClient client.Client
ctx context.Context
fwk *framework.Framework
)

func TestAPIs(t *testing.T) {
Expand All @@ -59,8 +57,7 @@ func TestAPIs(t *testing.T) {

var _ = ginkgo.BeforeSuite(func() {
fwk = &framework.Framework{
CRDPath: crdPath,
DepCRDPaths: []string{jobsetCrdPath},
DepCRDPaths: []string{util.JobsetCrds},
}
cfg = fwk.Init()
ctx, k8sClient = fwk.SetupClient(cfg)
Expand Down
15 changes: 6 additions & 9 deletions test/integration/controller/jobs/mpijob/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package mpijob

import (
"context"
"path/filepath"
"testing"

"github.com/onsi/ginkgo/v2"
Expand All @@ -40,15 +39,14 @@ import (
"sigs.k8s.io/kueue/pkg/queue"
"sigs.k8s.io/kueue/pkg/scheduler"
"sigs.k8s.io/kueue/test/integration/framework"
"sigs.k8s.io/kueue/test/util"
)

var (
cfg *rest.Config
k8sClient client.Client
ctx context.Context
fwk *framework.Framework
crdPath = filepath.Join("..", "..", "..", "..", "..", "config", "components", "crd", "bases")
mpiCrdPath = filepath.Join("..", "..", "..", "..", "..", "dep-crds", "mpi-operator")
cfg *rest.Config
k8sClient client.Client
ctx context.Context
fwk *framework.Framework
)

func TestAPIs(t *testing.T) {
Expand All @@ -61,8 +59,7 @@ func TestAPIs(t *testing.T) {

var _ = ginkgo.BeforeSuite(func() {
fwk = &framework.Framework{
CRDPath: crdPath,
DepCRDPaths: []string{mpiCrdPath},
DepCRDPaths: []string{util.MpiOperatorCrds},
}

cfg = fwk.Init()
Expand Down
15 changes: 6 additions & 9 deletions test/integration/controller/jobs/mxjob/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package mxjob

import (
"context"
"path/filepath"
"testing"

"github.com/onsi/ginkgo/v2"
Expand All @@ -39,15 +38,14 @@ import (
"sigs.k8s.io/kueue/pkg/queue"
"sigs.k8s.io/kueue/pkg/scheduler"
"sigs.k8s.io/kueue/test/integration/framework"
"sigs.k8s.io/kueue/test/util"
)

var (
cfg *rest.Config
k8sClient client.Client
ctx context.Context
fwk *framework.Framework
crdPath = filepath.Join("..", "..", "..", "..", "..", "config", "components", "crd", "bases")
mxnetCrdPath = filepath.Join("..", "..", "..", "..", "..", "dep-crds", "training-operator-crds")
cfg *rest.Config
k8sClient client.Client
ctx context.Context
fwk *framework.Framework
)

func TestAPIs(t *testing.T) {
Expand All @@ -60,8 +58,7 @@ func TestAPIs(t *testing.T) {

var _ = ginkgo.BeforeSuite(func() {
fwk = &framework.Framework{
CRDPath: crdPath,
DepCRDPaths: []string{mxnetCrdPath},
DepCRDPaths: []string{util.TrainingOperatorCrds},
}
cfg = fwk.Init()
ctx, k8sClient = fwk.SetupClient(cfg)
Expand Down
15 changes: 6 additions & 9 deletions test/integration/controller/jobs/paddlejob/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package paddlejob

import (
"context"
"path/filepath"
"testing"

"github.com/onsi/ginkgo/v2"
Expand All @@ -39,15 +38,14 @@ import (
"sigs.k8s.io/kueue/pkg/queue"
"sigs.k8s.io/kueue/pkg/scheduler"
"sigs.k8s.io/kueue/test/integration/framework"
"sigs.k8s.io/kueue/test/util"
)

var (
cfg *rest.Config
k8sClient client.Client
ctx context.Context
fwk *framework.Framework
crdPath = filepath.Join("..", "..", "..", "..", "..", "config", "components", "crd", "bases")
paddleCrdPath = filepath.Join("..", "..", "..", "..", "..", "dep-crds", "training-operator-crds")
cfg *rest.Config
k8sClient client.Client
ctx context.Context
fwk *framework.Framework
)

func TestAPIs(t *testing.T) {
Expand All @@ -60,8 +58,7 @@ func TestAPIs(t *testing.T) {

var _ = ginkgo.BeforeSuite(func() {
fwk = &framework.Framework{
CRDPath: crdPath,
DepCRDPaths: []string{paddleCrdPath},
DepCRDPaths: []string{util.TrainingOperatorCrds},
}
cfg = fwk.Init()
ctx, k8sClient = fwk.SetupClient(cfg)
Expand Down
7 changes: 2 additions & 5 deletions test/integration/controller/jobs/pod/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package pod

import (
"context"
"path/filepath"
"testing"

"github.com/onsi/ginkgo/v2"
Expand All @@ -42,6 +41,7 @@ import (
"sigs.k8s.io/kueue/pkg/util/kubeversion"
"sigs.k8s.io/kueue/pkg/webhooks"
"sigs.k8s.io/kueue/test/integration/framework"
"sigs.k8s.io/kueue/test/util"
)

var (
Expand All @@ -50,8 +50,6 @@ var (
serverVersionFetcher *kubeversion.ServerVersionFetcher
ctx context.Context
fwk *framework.Framework
crdPath = filepath.Join("..", "..", "..", "..", "..", "config", "components", "crd", "bases")
webhookPath = filepath.Join("..", "..", "..", "..", "..", "config", "components", "webhook")
)

func TestAPIs(t *testing.T) {
Expand All @@ -64,8 +62,7 @@ func TestAPIs(t *testing.T) {

var _ = ginkgo.BeforeSuite(func() {
fwk = &framework.Framework{
CRDPath: crdPath,
WebhookPath: webhookPath,
WebhookPath: util.WebhookPath,
}
cfg = fwk.Init()
ctx, k8sClient = fwk.SetupClient(cfg)
Expand Down
Loading