Skip to content

Commit

Permalink
test: Refactor e2e flow to reduce flaky tests (#72)
Browse files Browse the repository at this point in the history
Ensure Tekton stack is ready before start e2e tests

Signed-off-by: Sergiy Kulanov <[email protected]>
Change-Id: I3b872ae06fc056b1c39a81d6fbc0bcc8543625d8
  • Loading branch information
SergK committed Nov 17, 2023
1 parent 4f49d49 commit 8f94f13
Show file tree
Hide file tree
Showing 19 changed files with 217 additions and 226 deletions.
5 changes: 1 addition & 4 deletions kuttl-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: TestSuite
testDirs:
- ./tests/e2e/
skipClusterDelete: false
timeout: 120
timeout: 180
parallel: 3
commands:
# Install Cert manager which is used by Interceptor
Expand All @@ -28,6 +28,3 @@ commands:
namespaced: false
- command: helm dependency update ./charts/pipelines-library
namespaced: true
# We have all the requered checks, but let's wait a bit to make sure all the webhooks are registered
- command: sleep 20
namespaced: false
25 changes: 0 additions & 25 deletions tests/e2e/gerrit/00-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,28 +42,3 @@ metadata:
namespace: tekton-pipelines
status:
readyReplicas: 1

---
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
name: check-readiness
status:
conditions:
- reason: Succeeded
status: 'True'
type: Succeeded
pipelineSpec:
tasks:
- name: check
taskSpec:
metadata:
labels:
app: example
steps:
- computeResources: {}
image: alpine:3.18.4
name: echo
script: |
#!/usr/bin/env sh
echo "I'm ok!"
18 changes: 0 additions & 18 deletions tests/e2e/gerrit/00-install.yaml

This file was deleted.

41 changes: 21 additions & 20 deletions tests/e2e/gerrit/01-assert.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
apiVersion: apps/v1
kind: Deployment
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
name: edp-tekton-dashboard
name: check-readiness
status:
readyReplicas: 1

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: edp-tekton-interceptor
status:
readyReplicas: 1

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: el-gerrit-listener
status:
readyReplicas: 1
conditions:
- reason: Succeeded
status: 'True'
type: Succeeded
pipelineSpec:
tasks:
- name: check
taskSpec:
metadata:
labels:
app: example
steps:
- computeResources: {}
image: alpine:3.18.4
name: echo
script: |
#!/usr/bin/env sh
echo "I'm ok!"
29 changes: 18 additions & 11 deletions tests/e2e/gerrit/01-install.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- command: |
helm install tekton-e2e ../../../charts/pipelines-library --set interceptor.image.repository=${E2E_IMAGE_REPOSITORY} --set interceptor.image.tag=${E2E_IMAGE_TAG}
--set global.dnsWildCard=example.com
--set global.gitProvider=gerrit
--set global.dockerRegistry.type=harbor
--set global.dockerRegistry.url=harbor.example.com
--replace --wait
namespaced: true
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
name: check-readiness
spec:
pipelineSpec:
tasks:
- name: check
taskSpec:
metadata:
labels:
app: "example"
steps:
- name: echo
image: alpine:3.18.4
script: |
#!/usr/bin/env sh
echo "I'm ok!"
22 changes: 22 additions & 0 deletions tests/e2e/gerrit/02-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: edp-tekton-dashboard
status:
readyReplicas: 1

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: edp-tekton-interceptor
status:
readyReplicas: 1

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: el-gerrit-listener
status:
readyReplicas: 1
11 changes: 11 additions & 0 deletions tests/e2e/gerrit/02-install.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- command: |
helm install tekton-e2e ../../../charts/pipelines-library --set interceptor.image.repository=${E2E_IMAGE_REPOSITORY} --set interceptor.image.tag=${E2E_IMAGE_TAG}
--set global.dnsWildCard=example.com
--set global.gitProvider=gerrit
--set global.dockerRegistry.type=harbor
--set global.dockerRegistry.url=harbor.example.com
--replace --wait
namespaced: true
25 changes: 0 additions & 25 deletions tests/e2e/github/00-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,28 +42,3 @@ metadata:
namespace: tekton-pipelines
status:
readyReplicas: 1

---
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
name: check-readiness
status:
conditions:
- reason: Succeeded
status: 'True'
type: Succeeded
pipelineSpec:
tasks:
- name: check
taskSpec:
metadata:
labels:
app: example
steps:
- computeResources: {}
image: alpine:3.18.4
name: echo
script: |
#!/usr/bin/env sh
echo "I'm ok!"
18 changes: 0 additions & 18 deletions tests/e2e/github/00-install.yaml

This file was deleted.

41 changes: 21 additions & 20 deletions tests/e2e/github/01-assert.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
apiVersion: apps/v1
kind: Deployment
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
name: edp-tekton-dashboard
name: check-readiness
status:
readyReplicas: 1

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: edp-tekton-interceptor
status:
readyReplicas: 1

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: el-github-listener
status:
readyReplicas: 1
conditions:
- reason: Succeeded
status: 'True'
type: Succeeded
pipelineSpec:
tasks:
- name: check
taskSpec:
metadata:
labels:
app: example
steps:
- computeResources: {}
image: alpine:3.18.4
name: echo
script: |
#!/usr/bin/env sh
echo "I'm ok!"
29 changes: 18 additions & 11 deletions tests/e2e/github/01-install.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- command: |
helm install tekton-e2e ../../../charts/pipelines-library --set interceptor.image.repository=${E2E_IMAGE_REPOSITORY} --set interceptor.image.tag=${E2E_IMAGE_TAG}
--set global.dnsWildCard=example.com
--set global.gitProvider=github
--set global.dockerRegistry.type=harbor
--set global.dockerRegistry.url=harbor.example.com
--replace --wait
namespaced: true
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
name: check-readiness
spec:
pipelineSpec:
tasks:
- name: check
taskSpec:
metadata:
labels:
app: "example"
steps:
- name: echo
image: alpine:3.18.4
script: |
#!/usr/bin/env sh
echo "I'm ok!"
22 changes: 22 additions & 0 deletions tests/e2e/github/02-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: edp-tekton-dashboard
status:
readyReplicas: 1

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: edp-tekton-interceptor
status:
readyReplicas: 1

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: el-github-listener
status:
readyReplicas: 1
11 changes: 11 additions & 0 deletions tests/e2e/github/02-install.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- command: |
helm install tekton-e2e ../../../charts/pipelines-library --set interceptor.image.repository=${E2E_IMAGE_REPOSITORY} --set interceptor.image.tag=${E2E_IMAGE_TAG}
--set global.dnsWildCard=example.com
--set global.gitProvider=github
--set global.dockerRegistry.type=harbor
--set global.dockerRegistry.url=harbor.example.com
--replace --wait
namespaced: true
25 changes: 0 additions & 25 deletions tests/e2e/gitlab/00-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,28 +42,3 @@ metadata:
namespace: tekton-pipelines
status:
readyReplicas: 1

---
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
name: check-readiness
status:
conditions:
- reason: Succeeded
status: 'True'
type: Succeeded
pipelineSpec:
tasks:
- name: check
taskSpec:
metadata:
labels:
app: example
steps:
- computeResources: {}
image: alpine:3.18.4
name: echo
script: |
#!/usr/bin/env sh
echo "I'm ok!"
18 changes: 0 additions & 18 deletions tests/e2e/gitlab/00-install.yaml

This file was deleted.

Loading

0 comments on commit 8f94f13

Please sign in to comment.