Skip to content

Commit 466d890

Browse files
committed
match against a pattern to allow for loser order of messages
Signed-off-by: reubenmiller <reuben.d.miller@gmail.com>
1 parent ac1942e commit 466d890

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

tests/RobotFramework/tests/tedge_flows/tedge_flows.robot

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -277,11 +277,10 @@ Order of flow definition updates does not matter
277277
ThinEdgeIO.Transfer To Device
278278
... ${CURDIR}/issue-3978/test-v1.toml
279279
... /etc/tedge/mappers/local/flows/issue-3978/test.toml
280-
${messages} Should Have MQTT Messages
280+
Should Have MQTT Messages
281281
... topic=te/device/main/service/tedge-mapper-local/status/flows
282282
... date_from=${start}
283-
... message_contains=issue-3978/test.toml
284-
Should Contain ${messages[0]} "updated"
283+
... message_pattern=.*issue-3978/test.toml.*"status":"updated".*
285284

286285
# Check the flow is actually working
287286
${start} Get Unix Timestamp
@@ -298,11 +297,10 @@ Order of flow definition updates does not matter
298297
Execute Command sleep 0.1
299298
ThinEdgeIO.Transfer To Device ${CURDIR}/issue-3978/test-v2.toml /etc/tedge/data/
300299
Execute Command mv /etc/tedge/data/test-v2.toml /etc/tedge/mappers/local/flows/issue-3978/test.toml
301-
${messages} Should Have MQTT Messages
300+
Should Have MQTT Messages
302301
... topic=te/device/main/service/tedge-mapper-local/status/flows
303302
... date_from=${start}
304-
... message_contains=issue-3978/test.toml
305-
Should Contain ${messages[0]} "broken"
303+
... message_pattern=.*issue-3978/test.toml.*"status":"broken".*
306304

307305
# The new version of the flow has not been loaded because broken
308306
# and is no more running
@@ -322,11 +320,10 @@ Order of flow definition updates does not matter
322320
... /etc/tedge/mappers/local/flows/issue-3978/test-new.js
323321

324322
# The new version of flow must be reloaded
325-
${messages} Should Have MQTT Messages
323+
Should Have MQTT Messages
326324
... topic=te/device/main/service/tedge-mapper-local/status/flows
327325
... date_from=${start}
328-
... message_contains=issue-3978/test.toml
329-
Should Contain ${messages[0]} "updated"
326+
... message_pattern=.*issue-3978/test.toml.*"status":"updated".*
330327

331328
# And effective
332329
${start} Get Unix Timestamp

0 commit comments

Comments
 (0)