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

[TEST] Feature/kuberay multikueue adapter test #3919

Closed
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
2 changes: 1 addition & 1 deletion Makefile-test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ test-integration: gomod-download envtest ginkgo dep-crds kueuectl ginkgo-top ##
KUEUE_BIN=$(PROJECT_DIR)/bin \
ENVTEST_K8S_VERSION=$(ENVTEST_K8S_VERSION) \
API_LOG_LEVEL=$(INTEGRATION_API_LOG_LEVEL) \
$(GINKGO) $(INTEGRATION_FILTERS) $(GINKGO_ARGS) -procs=$(INTEGRATION_NPROCS) --race --junit-report=junit.xml --json-report=integration.json --output-dir=$(ARTIFACTS) -v $(INTEGRATION_TARGET)
$(GINKGO) $(INTEGRATION_FILTERS) $(GINKGO_ARGS) -procs=$(INTEGRATION_NPROCS) --output-interceptor-mode=none --race --junit-report=junit.xml --json-report=integration.json --output-dir=$(ARTIFACTS) -v $(INTEGRATION_TARGET)
$(PROJECT_DIR)/bin/ginkgo-top -i $(ARTIFACTS)/integration.json > $(ARTIFACTS)/integration-top.yaml

CREATE_KIND_CLUSTER ?= true
Expand Down
8 changes: 6 additions & 2 deletions test/integration/framework/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ type Framework struct {
}

var setupLogger = sync.OnceFunc(func() {
ctrl.SetLogger(util.NewTestingLogger(ginkgo.GinkgoWriter, -3))
ctrl.SetLogger(util.NewTestingLogger(os.Stdout, -3))
})

func (f *Framework) Init() *rest.Config {
Expand All @@ -77,7 +77,10 @@ func (f *Framework) Init() *rest.Config {
var cfg *rest.Config
ginkgo.By("bootstrapping test environment", func() {
f.testEnv = &envtest.Environment{
CRDDirectoryPaths: append(f.DepCRDPaths, f.CRDPath),
CRDDirectoryPaths: append(f.DepCRDPaths, f.CRDPath),
CRDInstallOptions: envtest.CRDInstallOptions{
MaxTime: time.Minute,
},
ErrorIfCRDPathMissing: true,
}
if len(f.WebhookPath) > 0 {
Expand All @@ -96,6 +99,7 @@ func (f *Framework) Init() *rest.Config {

var err error
cfg, err = f.testEnv.Start()
fmt.Println("KACZKA", err)
gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred())
gomega.ExpectWithOffset(1, cfg).NotTo(gomega.BeNil())
})
Expand Down
52 changes: 30 additions & 22 deletions test/integration/multikueue/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ package multikueue

import (
"context"
"fmt"
"os"
"path/filepath"
"sync"
"testing"
"time"

Expand Down Expand Up @@ -92,9 +92,11 @@ func createCluster(setupFnc framework.ManagerSetup, apiFeatureGates ...string) c
c.fwk = &framework.Framework{
CRDPath: filepath.Join("..", "..", "..", "config", "components", "crd", "bases"),
WebhookPath: filepath.Join("..", "..", "..", "config", "components", "webhook"),
DepCRDPaths: []string{filepath.Join("..", "..", "..", "dep-crds", "jobset-operator"),
DepCRDPaths: []string{
filepath.Join("..", "..", "..", "dep-crds", "jobset-operator"),
filepath.Join("..", "..", "..", "dep-crds", "training-operator-crds"),
filepath.Join("..", "..", "..", "dep-crds", "mpi-operator"),
filepath.Join("..", "..", "..", "dep-crds", "ray-operator"),
},
APIServerFeatureGates: apiFeatureGates,
}
Expand Down Expand Up @@ -206,6 +208,9 @@ func managerSetup(ctx context.Context, mgr manager.Manager) {

err = workloadmpijob.SetupMPIJobWebhook(mgr, jobframework.WithCache(cCache), jobframework.WithQueues(queues))
gomega.Expect(err).NotTo(gomega.HaveOccurred())

names := jobframework.GetIntegrationsList()
fmt.Println("KROWA", names)
}

func managerAndMultiKueueSetup(ctx context.Context, mgr manager.Manager, gcInterval time.Duration, enabledIntegrations sets.Set[string]) {
Expand All @@ -219,7 +224,7 @@ func managerAndMultiKueueSetup(ctx context.Context, mgr manager.Manager, gcInter

err = multikueue.SetupControllers(mgr, managersConfigNamespace.Name,
multikueue.WithGCInterval(gcInterval),
multikueue.WithWorkerLostTimeout(testingWorkerLostTimeout),
multikueue.WithWorkerLostTimeout(5*testingWorkerLostTimeout),
multikueue.WithEventsBatchPeriod(100*time.Millisecond),
multikueue.WithAdapters(adapters),
)
Expand All @@ -234,25 +239,28 @@ var _ = ginkgo.BeforeSuite(func() {
}

ginkgo.By("creating the clusters", func() {
wg := sync.WaitGroup{}
wg.Add(3)
go func() {
defer wg.Done()
// pass nil setup since the manager for the manage cluster is different in some specs.
c := createCluster(nil, managerFeatureGates...)
managerTestCluster = c
}()
go func() {
defer wg.Done()
c := createCluster(managerSetup)
worker1TestCluster = c
}()
go func() {
defer wg.Done()
c := createCluster(managerSetup)
worker2TestCluster = c
}()
wg.Wait()
//wg := sync.WaitGroup{}
//wg.Add(3)
//go func() {
// defer wg.Done()
// defer ginkgo.GinkgoRecover()
// pass nil setup since the manager for the manage cluster is different in some specs.
//c :=
managerTestCluster = createCluster(nil, managerFeatureGates...)
//}()
//go func() {
// defer wg.Done()
// defer ginkgo.GinkgoRecover()
// c :=
worker1TestCluster = createCluster(managerSetup)
//}()
//go func() {
// defer wg.Done()
// defer ginkgo.GinkgoRecover()
// c :=
worker2TestCluster = createCluster(managerSetup)
//}()
//wg.Wait()
})

discoveryClient, err := discovery.NewDiscoveryClientForConfig(managerTestCluster.cfg)
Expand Down