Skip to content

Commit

Permalink
[test][integration] Drop fwk.RunManager in favor of SetupClient a…
Browse files Browse the repository at this point in the history
…nd `StartManager` (kubernetes-sigs#3179)
  • Loading branch information
trasc authored Oct 2, 2024
1 parent f920c18 commit 1247fa3
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 12 deletions.
6 changes: 0 additions & 6 deletions test/integration/framework/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,6 @@ func (f *Framework) StopManager(ctx context.Context) {
})
}

func (f *Framework) RunManager(cfg *rest.Config, managerSetup ManagerSetup) (context.Context, client.Client) {
ctx, k8sClient := f.SetupClient(cfg)
f.StartManager(ctx, cfg, managerSetup)
return ctx, k8sClient
}

func (f *Framework) Teardown() {
ginkgo.By("tearing down the test environment")
if f.cancel != nil {
Expand Down
3 changes: 2 additions & 1 deletion test/integration/kueuectl/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ func TestKueuectl(t *testing.T) {
var _ = ginkgo.BeforeSuite(func() {
fwk = &framework.Framework{CRDPath: crdPath, WebhookPath: webhookPath}
cfg = fwk.Init()
ctx, k8sClient = fwk.RunManager(cfg, managerSetup)
ctx, k8sClient = fwk.SetupClient(cfg)
fwk.StartManager(ctx, cfg, managerSetup)

kassetsPath = os.Getenv("KUBEBUILDER_ASSETS")
kueuectlPath = path.Join(os.Getenv("KUEUE_BIN"), "kubectl-kueue")
Expand Down
3 changes: 2 additions & 1 deletion test/integration/scheduler/fairsharing/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ var _ = ginkgo.BeforeSuite(func() {
WebhookPath: filepath.Join("..", "..", "..", "..", "config", "components", "webhook"),
}
cfg = fwk.Init()
ctx, k8sClient = fwk.RunManager(cfg, managerAndSchedulerSetup)
ctx, k8sClient = fwk.SetupClient(cfg)
fwk.StartManager(ctx, cfg, managerAndSchedulerSetup)
})

var _ = ginkgo.AfterSuite(func() {
Expand Down
3 changes: 2 additions & 1 deletion test/integration/scheduler/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ var _ = ginkgo.BeforeSuite(func() {
WebhookPath: filepath.Join("..", "..", "..", "config", "components", "webhook"),
}
cfg = fwk.Init()
ctx, k8sClient = fwk.RunManager(cfg, managerAndSchedulerSetup)
ctx, k8sClient = fwk.SetupClient(cfg)
fwk.StartManager(ctx, cfg, managerAndSchedulerSetup)
})

var _ = ginkgo.AfterSuite(func() {
Expand Down
3 changes: 2 additions & 1 deletion test/integration/webhook/core/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ var _ = ginkgo.BeforeSuite(func() {
WebhookPath: filepath.Join("..", "..", "..", "..", "config", "components", "webhook"),
}
cfg = fwk.Init()
ctx, k8sClient = fwk.RunManager(cfg, func(ctx context.Context, mgr manager.Manager) {
ctx, k8sClient = fwk.SetupClient(cfg)
fwk.StartManager(ctx, cfg, func(ctx context.Context, mgr manager.Manager) {
err := indexer.Setup(ctx, mgr.GetFieldIndexer())
gomega.Expect(err).NotTo(gomega.HaveOccurred())

Expand Down
2 changes: 1 addition & 1 deletion test/integration/webhook/jobs/pod_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ var _ = ginkgo.Describe("Pod Webhook", func() {
err = serverVersionFetcher.FetchServerVersion()
gomega.Expect(err).NotTo(gomega.HaveOccurred())

fwk.RunManager(cfg, managerSetup(
fwk.StartManager(ctx, cfg, managerSetup(
pod.SetupWebhook,
jobframework.WithManageJobsWithoutQueueName(true),
jobframework.WithKubeServerVersion(serverVersionFetcher),
Expand Down
2 changes: 1 addition & 1 deletion test/integration/webhook/jobs/raycluster_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ var _ = ginkgo.Describe("RayCluster Webhook", func() {

ginkgo.When("With manageJobsWithoutQueueName enabled", ginkgo.Ordered, ginkgo.ContinueOnFailure, func() {
ginkgo.BeforeAll(func() {
fwk.RunManager(cfg, managerSetup(func(mgr ctrl.Manager, opts ...jobframework.Option) error {
fwk.StartManager(ctx, cfg, managerSetup(func(mgr ctrl.Manager, opts ...jobframework.Option) error {
reconciler := raycluster.NewReconciler(
mgr.GetClient(),
mgr.GetEventRecorderFor(constants.JobControllerName),
Expand Down

0 comments on commit 1247fa3

Please sign in to comment.