From e0af0a5a4557cfc0440561edb885def6ad5171de Mon Sep 17 00:00:00 2001 From: Daniel Vega-Myhre Date: Thu, 29 Jun 2023 21:51:15 +0000 Subject: [PATCH] add test case param for feature flag --- pkg/controller/job/job_controller_test.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pkg/controller/job/job_controller_test.go b/pkg/controller/job/job_controller_test.go index a0608acbad3..94c2b35519f 100644 --- a/pkg/controller/job/job_controller_test.go +++ b/pkg/controller/job/job_controller_test.go @@ -274,7 +274,8 @@ func TestControllerSyncJob(t *testing.T) { expectedPodPatches int // features - jobReadyPodsEnabled bool + jobReadyPodsEnabled bool + podIndexLabelEnabled bool }{ "job start": { parallelism: 2, @@ -781,11 +782,22 @@ func TestControllerSyncJob(t *testing.T) { expectedActive: 2, expectedPodPatches: 2, }, + "indexed job with podIndexLabel feature enabled": { + parallelism: 2, + completions: 5, + backoffLimit: 6, + completionMode: batch.IndexedCompletion, + expectedCreations: 2, + expectedActive: 2, + expectedCreatedIndexes: sets.New(0, 1), + podIndexLabelEnabled: true, + }, } for name, tc := range testCases { t.Run(name, func(t *testing.T) { defer featuregatetesting.SetFeatureGateDuringTest(t, feature.DefaultFeatureGate, features.JobReadyPods, tc.jobReadyPodsEnabled)() + defer featuregatetesting.SetFeatureGateDuringTest(t, feature.DefaultFeatureGate, features.PodIndexLabel, tc.podIndexLabelEnabled)() // job manager setup clientSet := clientset.NewForConfigOrDie(&restclient.Config{Host: "", ContentConfig: restclient.ContentConfig{GroupVersion: &schema.GroupVersion{Group: "", Version: "v1"}}})