Skip to content

Commit 302a2fe

Browse files
committed
Remove Kind from actual & expected
The CLI does not always outputs the Kind for the intents (depends on the order it process the intents, the network intents & Kafka's). So in order to make the test stable for now, we will compare without the Kind
1 parent 80979ee commit 302a2fe

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

.github/workflows/e2e-test.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,13 @@ jobs:
167167
kubectl logs -n otterize-system -l app=otterize-network-mapper --tail=-1
168168
169169
echo "export intents and compare to expected file"
170-
otterize network-mapper export --telemetry-enabled=false -n otterize-tutorial-kafka-mapping --format=json | jq 'sort_by(.metadata.namespace + .metadata.name) | map(.spec.targets |= (sort_by(keys_unsorted[0]) | map(if .kafka? then .kafka.topics |= map(.operations |= sort) else . end)))' > /tmp/intents.json
171-
diff .github/workflows/tests-expected-results/kafka-tutorial-intents.json /tmp/intents.json
170+
INTENTS_JSON=`otterize network-mapper export --telemetry-enabled=false -n otterize-tutorial-kafka-mapping --format=json`
171+
INTENTS_JSON_NO_KIND=`echo "$INTENTS_JSON" | jq 'map(del(.spec.workload.kind))'`
172+
INTENTS_JSON_NO_KIND_AND_SORTED=`echo "$INTENTS_JSON_NO_KIND" | jq 'sort_by(.metadata.namespace + .metadata.name) | map(.spec.targets |= (sort_by(keys_unsorted[0]) | map(if .kafka? then .kafka.topics |= map(.operations |= sort) else . end)))'`
173+
echo "$INTENTS_JSON_NO_KIND_AND_SORTED" > /tmp/intents.json
172174
echo "expected" && cat .github/workflows/tests-expected-results/kafka-tutorial-intents.json
173175
echo "actual" && cat /tmp/intents.json
176+
diff .github/workflows/tests-expected-results/kafka-tutorial-intents.json /tmp/intents.json
174177
175178
e2e-test:
176179
needs:

.github/workflows/tests-expected-results/kafka-tutorial-intents.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
},
1010
"spec": {
1111
"workload": {
12-
"name": "client",
13-
"kind": "Deployment"
12+
"name": "client"
1413
},
1514
"targets": [
1615
{
@@ -50,8 +49,7 @@
5049
},
5150
"spec": {
5251
"workload": {
53-
"name": "client-2",
54-
"kind": "Deployment"
52+
"name": "client-2"
5553
},
5654
"targets": [
5755
{

0 commit comments

Comments
 (0)