Skip to content

Commit

Permalink
test: integration tests for verify timout with docker and k8s verify …
Browse files Browse the repository at this point in the history
…test cases
  • Loading branch information
renzodavid9 committed May 20, 2023
1 parent c65794c commit 08fa63c
Show file tree
Hide file tree
Showing 5 changed files with 385 additions and 3 deletions.
55 changes: 54 additions & 1 deletion integration/testdata/verify-fail-k8s/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,57 @@ profiles:
name: alpine-2
image: alpine:3.15.4
command: ["/bin/sh"]
args: ["-c", "echo alpine-2; echo bye alpine-2; exit 1"]
args: ["-c", "echo alpine-2; echo bye alpine-2; exit 1"]

- name: fail-timeout
verify:
- name: alpine-3
timeout: 5
executionMode:
kubernetesCluster: {}
container:
name: alpine-3
image: alpine:3.15.4
command: ["/bin/sh"]
args: ["-c", "echo alpine-3; sleep 10; echo bye alpine-3"]

- name: fail-two-test-timeout
verify:
- name: alpine-4
timeout: 6
executionMode:
kubernetesCluster: {}
container:
name: alpine-4
image: alpine:3.15.4
command: ["/bin/sh"]
args: ["-c", "echo alpine-4; sleep 10; echo bye alpine-4"]
- name: alpine-5
timeout: 5
executionMode:
kubernetesCluster: {}
container:
name: alpine-5
image: alpine:3.15.4
command: ["/bin/sh"]
args: ["-c", "echo alpine-5; sleep 8; echo bye alpine-5"]

- name: fail-only-one-test-timeout
verify:
- name: alpine-6
timeout: 6
executionMode:
kubernetesCluster: {}
container:
name: alpine-6
image: alpine:3.15.4
command: ["/bin/sh"]
args: ["-c", "echo alpine-6; sleep 10; echo bye alpine-6"]
- name: alpine-7
executionMode:
kubernetesCluster: {}
container:
name: alpine-7
image: alpine:3.15.4
command: ["/bin/sh"]
args: ["-c", "echo alpine-7; sleep 15; echo bye alpine-7"]
44 changes: 44 additions & 0 deletions integration/testdata/verify-fail/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,47 @@ profiles:
image: alpine:3.15.4
command: ["/bin/sh"]
args: ["-c", "echo alpine-2; echo bye alpine-2; exit 1"]

- name: fail-timeout
verify:
- name: alpine-1
timeout: 5
container:
name: alpine-1
image: alpine:3.15.4
command: ["/bin/sh"]
args: ["-c", "echo alpine-1; sleep 10; echo bye alpine-1"]

- name: fail-two-test-timeout
verify:
- name: alpine-1
timeout: 6
container:
name: alpine-1
image: alpine:3.15.4
command: ["/bin/sh"]
args: ["-c", "echo alpine-1; sleep 10; echo bye alpine-1"]
- name: alpine-2
timeout: 5
container:
name: alpine-2
image: alpine:3.15.4
command: ["/bin/sh"]
args: ["-c", "echo alpine-2; sleep 8; echo bye alpine-2"]

- name: fail-only-one-test-timeout
verify:
- name: alpine-1
timeout: 6
container:
name: alpine-1
image: alpine:3.15.4
command: ["/bin/sh"]
args: ["-c", "echo alpine-1; sleep 10; echo bye alpine-1"]
- name: alpine-2
container:
name: alpine-2
image: alpine:3.15.4
command: ["/bin/sh"]
args: ["-c", "echo alpine-2; sleep 15; echo bye alpine-2"]

43 changes: 42 additions & 1 deletion integration/testdata/verify-succeed-k8s/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,45 @@ profiles:
name: alpine-1
image: alpine:3.15.4
command: ["/bin/sh"]
args: ["-c", "echo alpine-1; sleep 1; echo bye alpine-1"]
args: ["-c", "echo alpine-1; sleep 1; echo bye alpine-1"]

- name: succeed-with-timeout
verify:
- name: alpine-8
timeout: 30
executionMode:
kubernetesCluster: {}
container:
name: alpine-8
image: alpine:3.15.4
command: ["/bin/sh"]
args: ["-c", "echo alpine-8; sleep 10; echo bye alpine-8"]
- name: alpine-9
timeout: 35
executionMode:
kubernetesCluster: {}
container:
name: alpine-9
image: alpine:3.15.4
command: ["/bin/sh"]
args: ["-c", "echo alpine-9; sleep 15; echo bye alpine-9"]

- name: succeed-all-one-with-timeout
verify:
- name: alpine-10
executionMode:
kubernetesCluster: {}
container:
name: alpine-10
image: alpine:3.15.4
command: ["/bin/sh"]
args: ["-c", "echo alpine-10; sleep 10; echo bye alpine-10"]
- name: alpine-11
timeout: 25
executionMode:
kubernetesCluster: {}
container:
name: alpine-11
image: alpine:3.15.4
command: ["/bin/sh"]
args: ["-c", "echo alpine-11; sleep 15; echo bye alpine-11"]
36 changes: 35 additions & 1 deletion integration/testdata/verify-succeed/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,38 @@ profiles:
name: alpine-1
image: alpine:3.15.4
command: ["/bin/sh"]
args: ["-c", "echo alpine-1; sleep 2; echo bye alpine-1"]
args: ["-c", "echo alpine-1; sleep 2; echo bye alpine-1"]


- name: succeed-with-timeout
verify:
- name: alpine-1
timeout: 20
container:
name: alpine-1
image: alpine:3.15.4
command: ["/bin/sh"]
args: ["-c", "echo alpine-1; sleep 10; echo bye alpine-1"]
- name: alpine-2
timeout: 25
container:
name: alpine-2
image: alpine:3.15.4
command: ["/bin/sh"]
args: ["-c", "echo alpine-2; sleep 15; echo bye alpine-2"]

- name: succeed-all-one-with-timeout
verify:
- name: alpine-1
container:
name: alpine-1
image: alpine:3.15.4
command: ["/bin/sh"]
args: ["-c", "echo alpine-1; sleep 10; echo bye alpine-1"]
- name: alpine-2
timeout: 25
container:
name: alpine-2
image: alpine:3.15.4
command: ["/bin/sh"]
args: ["-c", "echo alpine-2; sleep 15; echo bye alpine-2"]
Loading

0 comments on commit 08fa63c

Please sign in to comment.