Skip to content

Commit b9585cc

Browse files
committed
chore: improve example test runner to check for new labels #15002
Since we have changed how we identify if an example runs correctly as test this commit applies to the new protocol in the test runner. Signed-off-by: Gianluca Arbezzano <[email protected]>
1 parent 3a677cf commit b9585cc

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

.github/workflows/ci-build.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,11 @@ jobs:
262262
profile: minimal
263263
use-api: false
264264
retries: 0
265+
# Example tests are not retryable withou a controller restart
265266
- test: test-examples
266267
profile: minimal
267268
use-api: false
269+
retries: 0
268270
- test: test-plugins
269271
profile: plugins
270272
use-api: false

test/e2e/examples_test.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,19 @@ func (s *ExamplesSuite) TestExampleWorkflows() {
3030
s.T().Fatalf("Error parsing %s: %v", path, err)
3131
}
3232
for _, wf := range wfs {
33-
if _, ok := wf.GetLabels()["workflows.argoproj.io/test"]; ok {
34-
s.T().Logf("Found example workflow at %s with test label\n", path)
33+
_, noTestBrokenLabelExists := wf.GetLabels()["workflows.argoproj.io/no-test-broken"]
34+
_, noTestBrokenEnvironmentLabelExists := wf.GetLabels()["workflows.argoproj.io/no-test-environment"]
35+
if noTestBrokenLabelExists || noTestBrokenEnvironmentLabelExists {
36+
continue
37+
}
38+
s.T().Run(path, func(t *testing.T) {
39+
s.T().Logf("Found example workflow at %s\n", path)
3540
s.Given().
3641
ExampleWorkflow(&wf).
3742
When().
3843
SubmitWorkflow().
3944
WaitForWorkflow(fixtures.ToBeSucceeded)
40-
}
45+
})
4146
}
4247
return nil
4348
})

test/e2e/fixtures/given.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,18 @@ func (g *Given) checkImages(wf interface{}, isExample bool) {
136136
image == "argoproj/argosay:v1" ||
137137
image == "argoproj/argosay:v2" ||
138138
image == "quay.io/argoproj/argocli:latest" ||
139-
(isExample && (image == "busybox" || image == "python:alpine3.6"))
139+
(isExample && (image == "busybox" ||
140+
image == "python:alpine3.6" ||
141+
image == "golang:1.18" ||
142+
image == "nginx:1.13" ||
143+
image == "curlimages/curl:latest" ||
144+
image == "node:9.1-alpine" ||
145+
image == "docker:19.03.13" ||
146+
image == "docker:19.03.13-dind" ||
147+
image == "alpine/git:v2.26.2" ||
148+
image == "alpine:3.6" ||
149+
image == "stedolan/jq:latest" ||
150+
image == "influxdb:1.2"))
140151
}
141152
for _, t := range templates {
142153
container := t.Container

0 commit comments

Comments
 (0)