Skip to content

Commit 40f88ca

Browse files
committed
Bugfix: improve kafka e2e tests stability
1 parent 24ee0ad commit 40f88ca

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

.github/workflows/e2e-test.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,14 @@ jobs:
150150
for i in {1..5}
151151
do
152152
OUTPUT_JSON=`otterize network-mapper export --telemetry-enabled=false -n otterize-tutorial-kafka-mapping --format=json`
153-
if [ `echo "$OUTPUT_JSON" | jq ". | length"` != 2 ] || [ `echo "$OUTPUT_JSON" | jq '[.[] | select(.spec.targets[] | has("kafka"))] | length'` != 2 ] ; then
153+
154+
if \
155+
# Check that the output had 2 records (for client & client2)
156+
[ `echo "$OUTPUT_JSON" | jq ". | length"` != 2 ] || \
157+
# Check that both has kafka defined
158+
[ `echo "$OUTPUT_JSON" | jq '[.[] | select(.spec.targets[] | has("kafka"))] | length'` != 2 ] \
159+
# Check that both has have 2 operations for kafka
160+
[ `echo "$OUTPUT_JSON" | jq '[.[] | .spec.targets[] | select(has("kafka")) | select(.kafka.topics[0].operations | length != 2)] | length'` != 0 ] ; then
154161
echo "wait for discovered intents";
155162
echo _SNIFFER LOGS_
156163
kubectl logs --since=15s -n otterize-system -l app=otterize-network-sniffer

0 commit comments

Comments
 (0)