Skip to content

Commit c4f9604

Browse files
authored
Merge pull request #3936 from reubenmiller/test-use-unique-fragment-names
test: use unique measurement names to improve test reliability
2 parents cde604d + 4cda438 commit c4f9604

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tests/RobotFramework/tests/azure/extensible_mapper.robot

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ Test Tags theme:mqtt theme:az
1414
Legacy behavior
1515
# The legacy az mapper adds a timestamp if missing but ignores message source and measurement type
1616
${start} Get Unix Timestamp
17-
Execute Command tedge mqtt pub te/device/child-az///m/env '{"temperature":10, "time":1768404563.338 }'
17+
Execute Command tedge mqtt pub te/device/child-az///m/env '{"temperature1":10, "time":1768404563.338 }'
1818
${message} Should Have MQTT Messages
1919
... topic=az/messages/events/
20-
... message_contains=temperature
20+
... message_contains=temperature1
2121
... date_from=${start}
2222
Should Contain ${message}[0] "time":1768404563.338
2323
Should Not Contain ${message}[0] "type":
@@ -30,10 +30,10 @@ Updating the builtin flow definition
3030

3131
# Now the az mapper reformats the timestamps using rfc3339
3232
${start} Get Unix Timestamp
33-
Execute Command tedge mqtt pub te/device/child-az///m/env '{"temperature":10, "time":1768404563.338 }'
33+
Execute Command tedge mqtt pub te/device/child-az///m/env '{"temperature2":10, "time":1768404563.338 }'
3434
${message} Should Have MQTT Messages
3535
... topic=az/messages/events/
36-
... message_contains=temperature
36+
... message_contains=temperature2
3737
... date_from=${start}
3838
Should Contain ${message}[0] "time":"2026-01-14T15:29:23.338Z"
3939
Should Not Contain ${message}[0] "type":
@@ -47,10 +47,10 @@ Adding a step to the builtin flow definition
4747

4848
# Thanks to the custom script the az mapper adds the measurement type
4949
${start} Get Unix Timestamp
50-
Execute Command tedge mqtt pub te/device/child-az///m/env '{"temperature":10, "time":1768404563.338 }'
50+
Execute Command tedge mqtt pub te/device/child-az///m/env '{"temperature3":10, "time":1768404563.338 }'
5151
${message} Should Have MQTT Messages
5252
... topic=az/messages/events/
53-
... message_contains=temperature
53+
... message_contains=temperature3
5454
... date_from=${start}
5555
Should Contain ${message}[0] "time":"2026-01-14T15:29:23.338Z"
5656
Should Contain ${message}[0] "type":"env"
@@ -76,10 +76,10 @@ Adding a flow to the builtin mapper
7676

7777
# So the az mapper adds the source name to measurements
7878
${start} Get Unix Timestamp
79-
Execute Command tedge mqtt pub te/device/child-az///m/env '{"temperature":10, "time":1768404563.338 }'
79+
Execute Command tedge mqtt pub te/device/child-az///m/env '{"temperature4":10, "time":1768404563.338 }'
8080
${message} Should Have MQTT Messages
8181
... topic=az/messages/events/
82-
... message_contains=temperature
82+
... message_contains=temperature4
8383
... date_from=${start}
8484
Should Contain ${message}[0] "time":"2026-01-14T15:29:23.338Z"
8585
Should Contain ${message}[0] "type":"env"

0 commit comments

Comments
 (0)