Skip to content

Commit 3fa1e9e

Browse files
authored
Merge pull request #573 from karlkfi/karl-e2e-names
chore: Add make target for e2e test focus
2 parents 8aaf739 + 80e2c16 commit 3fa1e9e

File tree

3 files changed

+23
-18
lines changed

3 files changed

+23
-18
lines changed

Makefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,17 @@ test:
6969
go test -race -cover ./cmd/... ./pkg/...
7070

7171
test-e2e: $(MYGOBIN)/ginkgo $(MYGOBIN)/kind
72-
kind delete cluster --name=cli-utils-e2e && kind create cluster --name=cli-utils-e2e
72+
kind delete cluster --name=cli-utils-e2e && kind create cluster --name=cli-utils-e2e --wait 5m
7373
$(GOPATH)/bin/ginkgo ./test/e2e/...
7474

75+
.PHONY: test-e2e-focus
76+
test-e2e-focus: $(MYGOBIN)/ginkgo $(MYGOBIN)/kind
77+
kind delete cluster --name=cli-utils-e2e && kind create cluster --name=cli-utils-e2e --wait 5m
78+
$(GOPATH)/bin/ginkgo -v -focus ".*$(FOCUS).*" ./test/e2e/... -- -v 5
79+
7580
test-stress: $(MYGOBIN)/ginkgo $(MYGOBIN)/kind
76-
kind delete cluster --name=cli-utils-e2e && kind create cluster --name=cli-utils-e2e
77-
$(GOPATH)/bin/ginkgo -v ./test/stress/... -- -v 5
81+
kind delete cluster --name=cli-utils-e2e && kind create cluster --name=cli-utils-e2e --wait 5m
82+
$(GOPATH)/bin/ginkgo -v ./test/stress/... -- -v 3
7883

7984
vet:
8085
go vet ./...

test/e2e/e2e_test.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,14 @@ var _ = Describe("Applier", func() {
8989

9090
for i := range inventoryConfigTypes {
9191
invType := inventoryConfigTypes[i]
92-
Context(fmt.Sprintf("Inventory: %s", invType), func() {
92+
Context(fmt.Sprintf("Inventory%s", invType), func() {
9393
var invConfig invconfig.InventoryConfig
9494

9595
BeforeEach(func() {
9696
invConfig = inventoryConfigs[invType]
9797
})
9898

99-
Context("Apply and destroy", func() {
99+
Context("Basic", func() {
100100
var namespace *v1.Namespace
101101
var inventoryName string
102102
var ctx context.Context
@@ -133,7 +133,7 @@ var _ = Describe("Applier", func() {
133133
e2eutil.DeleteNamespace(ctx, c, namespace)
134134
})
135135

136-
It("Apply and destroy", func() {
136+
It("ApplyDestroy", func() {
137137
applyAndDestroyTest(ctx, c, invConfig, inventoryName, namespace.GetName())
138138
})
139139

@@ -145,27 +145,27 @@ var _ = Describe("Applier", func() {
145145
emptySetTest(ctx, c, invConfig, inventoryName, namespace.GetName())
146146
})
147147

148-
It("Deletion Prevention", func() {
148+
It("DeletionPrevention", func() {
149149
deletionPreventionTest(ctx, c, invConfig, inventoryName, namespace.GetName())
150150
})
151151

152-
It("Apply CRD and CR", func() {
152+
It("CustomResource", func() {
153153
crdTest(ctx, c, invConfig, inventoryName, namespace.GetName())
154154
})
155155

156-
It("Apply continues on error", func() {
156+
It("ContinueOnError", func() {
157157
continueOnErrorTest(ctx, c, invConfig, inventoryName, namespace.GetName())
158158
})
159159

160-
It("Server-Side Apply", func() {
160+
It("ServerSideApply", func() {
161161
serversideApplyTest(ctx, c, invConfig, inventoryName, namespace.GetName())
162162
})
163163

164-
It("Implements depends-on apply ordering", func() {
164+
It("DependsOn", func() {
165165
dependsOnTest(ctx, c, invConfig, inventoryName, namespace.GetName())
166166
})
167167

168-
It("Implements apply-time-mutation", func() {
168+
It("ApplyTimeMutation", func() {
169169
mutationTest(ctx, c, invConfig, inventoryName, namespace.GetName())
170170
})
171171

@@ -177,15 +177,15 @@ var _ = Describe("Applier", func() {
177177
namespaceFilterTest(ctx, c, invConfig, inventoryName, namespace.GetName())
178178
})
179179

180-
It("Prune retrieval error correctly handled", func() {
180+
It("PruneRetrievalError", func() {
181181
pruneRetrieveErrorTest(ctx, c, invConfig, inventoryName, namespace.GetName())
182182
})
183183

184-
It("Reconciliation failure and timeout", func() {
184+
It("ReconciliationFailure", func() {
185185
reconciliationFailed(ctx, invConfig, inventoryName, namespace.GetName())
186186
})
187187

188-
It("Reconciliation timeout", func() {
188+
It("ReconciliationTimeout", func() {
189189
reconciliationTimeout(ctx, invConfig, inventoryName, namespace.GetName())
190190
})
191191

@@ -233,7 +233,7 @@ var _ = Describe("Applier", func() {
233233
})
234234
}
235235

236-
Context("Strategy: Name", func() {
236+
Context("NameStrategy", func() {
237237
var namespace *v1.Namespace
238238
var inventoryName string
239239
var ctx context.Context
@@ -255,7 +255,7 @@ var _ = Describe("Applier", func() {
255255
e2eutil.DeleteNamespace(ctx, c, namespace)
256256
})
257257

258-
It("Apply with existing inventory", func() {
258+
It("InventoryIDMismatch", func() {
259259
applyWithExistingInvTest(ctx, c, inventoryConfigs[CustomTypeInvConfig], inventoryName, namespace.GetName())
260260
})
261261
})

test/stress/stress_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ var _ = Describe("Applier", func() {
9595
e2eutil.DeleteNamespace(ctx, c, namespace)
9696
})
9797

98-
It("Thousand Namespaces", func() {
98+
It("ThousandNamespaces", func() {
9999
thousandNamespacesTest(ctx, c, invConfig, inventoryName, namespace.GetName())
100100
})
101101
})

0 commit comments

Comments
 (0)