Skip to content

Commit 86ea1bf

Browse files
committed
Address review comments.
Signed-off-by: Revital Sur <eres@il.ibm.com>
1 parent bc61f82 commit 86ea1bf

2 files changed

Lines changed: 13 additions & 17 deletions

File tree

test/coordinator/e2e/coordinator/e2e_suite_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ var _ = ginkgo.BeforeSuite(func() {
135135

136136
// Coordinator and EPP Services/RBAC are created once and kept stable across
137137
// specs (see createStableInfra).
138-
stableInfraObjects = createStableInfra()
138+
createStableInfra()
139139
})
140140

141141
var _ = ginkgo.ReportAfterSuite("cleanup", func(report ginkgo.Report) {

test/coordinator/e2e/coordinator/setup_test.go

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -238,28 +238,24 @@ func applyManifest(path string, subs map[string]string, excludeKinds ...string)
238238
}
239239

240240
// createStableInfra creates the coordinator and per-phase EPP Services,
241-
// ServiceAccounts, and RoleBindings once, up front, and returns their ids for
242-
// suite teardown. Envoy fronts the Services via STRICT_DNS clusters and outlives
243-
// the per-spec workload; recreating a Service each spec would rotate its
244-
// ClusterIP and force Envoy to re-resolve, so only the Deployments behind them
245-
// churn per spec. Mirrors the non-coordinator e2e, which creates the EPP
246-
// Services and RBAC once in its setup and recreates only the Deployment per test.
247-
func createStableInfra() []string {
248-
eppManifests := []string{encodeEPPManifest, prefillEPPManifest, decodeEPPManifest}
249-
// Coordinator Service + ServiceAccount, plus Service + ServiceAccount +
250-
// RoleBinding per EPP.
251-
objects := make([]string, 0, 2+len(eppManifests)*3)
252-
241+
// ServiceAccounts, and RoleBindings once, up front. It appends each created id to
242+
// stableInfraObjects as it goes rather than returning them at the end, so a
243+
// partial failure still leaves the already-created objects tracked for suite
244+
// teardown. Envoy fronts the Services via STRICT_DNS clusters and outlives the
245+
// per-spec workload; recreating a Service each spec would rotate its ClusterIP and
246+
// force Envoy to re-resolve, so only the Deployments behind them churn per spec.
247+
// Mirrors the non-coordinator e2e, which creates the EPP Services and RBAC once in
248+
// its setup and recreates only the Deployment per test.
249+
func createStableInfra() {
253250
docs := e2eutil.RunKustomize(coordinatorComponentDir)
254251
docs = e2eutil.FilterKinds(docs, "ConfigMap", "Deployment")
255252
docs = e2eutil.SubstituteMany(docs, coordinatorSubstitutions())
256253
docs = e2eutil.RemoveEmptyArgs(docs)
257-
objects = append(objects, testutils.CreateObjsFromYaml(testConfig, docs, getNamespace())...)
254+
stableInfraObjects = append(stableInfraObjects, testutils.CreateObjsFromYaml(testConfig, docs, getNamespace())...)
258255

259-
for _, manifest := range eppManifests {
260-
objects = append(objects, applyManifest(manifest, eppSubstitutions(), "Deployment")...)
256+
for _, manifest := range []string{encodeEPPManifest, prefillEPPManifest, decodeEPPManifest} {
257+
stableInfraObjects = append(stableInfraObjects, applyManifest(manifest, eppSubstitutions(), "Deployment")...)
261258
}
262-
return objects
263259
}
264260

265261
func eppSubstitutions() map[string]string {

0 commit comments

Comments
 (0)