Skip to content

Commit ceee0b6

Browse files
committed
another attempt
1 parent 40f88ca commit ceee0b6

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

.github/workflows/e2e-test.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +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-
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
153+
# Check for muber of items, should expect 2 - client & client2
154+
NUM_ITEMS=$(echo "$OUTPUT_JSON" | jq '. | length')
155+
# Number of kafka items
156+
NUM_OF_KAFKA_TARGETS=$(echo "$OUTPUT_JSON" | jq '[.[] | select(.spec.targets[] | has("kafka"))] | length')
157+
# Number of correct operations - records with 2 kafka operations
158+
ITEMS_WITH_CORRECT_OPERATIONS=$(echo "$OUTPUT_JSON" | jq '[.[] | .spec.targets[] | select(has("kafka")) | select(.kafka.topics[0].operations | length == 2)] | length')
159+
160+
if [ "$NUM_ITEMS" != 2 ] || [ "$NUM_OF_KAFKA_TARGETS" != 2 ] || [ "$ITEMS_WITH_CORRECT_OPERATIONS" != 2 ]; then
161161
echo "wait for discovered intents";
162162
echo _SNIFFER LOGS_
163163
kubectl logs --since=15s -n otterize-system -l app=otterize-network-sniffer

0 commit comments

Comments
 (0)