Skip to content

Commit 9330442

Browse files
committed
Suggests a structure for test cases as single yml
1 parent 64f2140 commit 9330442

File tree

1 file changed

+88
-0
lines changed

1 file changed

+88
-0
lines changed

test/basic-produce-consume.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
kind: ConfigMap
3+
metadata:
4+
name: basic-produce-consume
5+
namespace: test-kafka
6+
apiVersion: v1
7+
data:
8+
9+
live.sh: |-
10+
exit 0
11+
12+
run.sh: |-
13+
echo "Test is up"
14+
exit 0
15+
16+
---
17+
apiVersion: batch/v1
18+
kind: Job
19+
metadata:
20+
name: basic-produce-consume
21+
namespace: test-kafka
22+
spec:
23+
template:
24+
spec:
25+
containers:
26+
- name: topic-create
27+
image: solsson/kafka:0.11.0.0@sha256:b27560de08d30ebf96d12e74f80afcaca503ad4ca3103e63b1fd43a2e4c976ce
28+
command:
29+
- ./bin/kafka-topics.sh
30+
- --zookeeper
31+
- zookeeper.kafka.svc.cluster.local:2181
32+
- --create
33+
- --topic
34+
- test-basic-produce-consume
35+
- --partitions
36+
- "1"
37+
- --replication-factor
38+
- "1"
39+
restartPolicy: Never
40+
---
41+
apiVersion: apps/v1beta1
42+
kind: Deployment
43+
metadata:
44+
name: basic-produce-consume
45+
namespace: test-kafka
46+
spec:
47+
replicas: 1
48+
template:
49+
metadata:
50+
labels:
51+
test-target: kafka
52+
test-type: readiness
53+
spec:
54+
containers:
55+
- name: kafka
56+
# common test images
57+
#image: solsson/curl@sha256:8b0927b81d10043e70f3e05e33e36fb9b3b0cbfcbccdb9f04fd53f67a270b874
58+
image: solsson/kafkacat@sha256:1266d140c52cb39bf314b6f22b6d7a01c4c9084781bc779fdfade51214a713a8
59+
#image: solsson/kubectl-kafkacat@sha256:3715a7ede3f168f677ee6faf311ff6887aff31f660cfeecad5d87b4f18516321
60+
env:
61+
- name: BOOTSTRAP
62+
value: kafka-0.broker.kafka.svc.cluster.local:9092,kafka-1.broker.kafka.svc.cluster.local:9092,kafka-2.broker.kafka.svc.cluster.local:9092
63+
- name: ZOOKEEPER
64+
value: zookeeper.kafka.svc.cluster.local:2181
65+
# Test set up
66+
command:
67+
- tail
68+
- -f
69+
- /dev/null
70+
# Test run
71+
readinessProbe:
72+
exec:
73+
command:
74+
- /bin/bash
75+
- /test/run.sh
76+
# Test restart on nonzero exit
77+
livenessProbe:
78+
exec:
79+
command:
80+
- /bin/bash
81+
- /test/live.sh
82+
volumeMounts:
83+
- name: config
84+
mountPath: /test
85+
volumes:
86+
- name: config
87+
configMap:
88+
name: basic-produce-consume

0 commit comments

Comments
 (0)