Skip to content

Commit 97a0eac

Browse files
author
Tony Sherman
committed
test(assetlibraryhistory): increase timeout for assetlibraryhistory tests to allow for kinesis batch window
1 parent caa6bae commit 97a0eac

File tree

2 files changed

+156
-129
lines changed

2 files changed

+156
-129
lines changed

source/packages/integration-tests/features/assetlibraryhistory/deviceHistory.feature

Lines changed: 68 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,18 @@ Feature: Device History
2323
# We store the time the test started so that we can filter out history records that may have been saved for this device prior to the test:
2424
And I store the time the test started
2525
When I create device "TEST-deviceHistory-device001" with attributes
26-
| templateId | TEST-deviceHistory-device-type |
27-
| description | Description 1 |
28-
| attributes | {"firmwareVersion":"1"} |
29-
| groups | {"linked_to":["/TEST-deviceHistory-group"]} |
30-
And pause for 2000ms
26+
| templateId | TEST-deviceHistory-device-type |
27+
| description | Description 1 |
28+
| attributes | {"firmwareVersion":"1"} |
29+
| groups | {"linked_to":["/TEST-deviceHistory-group"]} |
30+
# Allow Kinesis batch window to complete
31+
And pause for 32seconds
3132
Then 1 history records exist since the test started for device "TEST-deviceHistory-device001"
3233
And history record 1 contains attributes
33-
| objectId | test-devicehistory-device001 |
34-
| event | create |
35-
| state | {"attributes":{"firmwareVersion":"1"},"category":"device","description":"Description 1","deviceId":"test-devicehistory-device001","devices":{},"groups":{"out":{"linked_to":["/test-devicehistory-group"]}},"state":"unprovisioned","templateId":"test-devicehistory-device-type"} |
36-
| type | devices |
34+
| objectId | test-devicehistory-device001 |
35+
| event | create |
36+
| state | {"attributes":{"firmwareVersion":"1"},"category":"device","description":"Description 1","deviceId":"test-devicehistory-device001","devices":{},"groups":{"out":{"linked_to":["/test-devicehistory-group"]}},"state":"unprovisioned","templateId":"test-devicehistory-device-type"} |
37+
| type | devices |
3738

3839

3940
Scenario: Modifying a device logs a modify event
@@ -42,66 +43,89 @@ Feature: Device History
4243
And I store the time the test started
4344
When I update device "TEST-deviceHistory-device001" with attributes
4445
| attributes | {"firmwareVersion":"2"} |
45-
And pause for 2000ms
46+
And pause for 32seconds
4647
Then 1 history records exist since the test started for device "TEST-deviceHistory-device001"
4748
And history record 1 contains attributes
48-
| objectId | test-devicehistory-device001 |
49-
| event | modify |
50-
| state | {"attributes":{"firmwareVersion":"2"},"category":"device","description":"Description 1","deviceId":"test-devicehistory-device001","devices":{},"groups":{"out":{"linked_to":["/test-devicehistory-group"]}},"state":"unprovisioned","templateId":"test-devicehistory-device-type"} |
51-
| type | devices |
49+
| objectId | test-devicehistory-device001 |
50+
| event | modify |
51+
| state | {"attributes":{"firmwareVersion":"2"},"category":"device","description":"Description 1","deviceId":"test-devicehistory-device001","devices":{},"groups":{"out":{"linked_to":["/test-devicehistory-group"]}},"state":"unprovisioned","templateId":"test-devicehistory-device-type"} |
52+
| type | devices |
53+
54+
55+
Scenario: Multiple events are in a single batch are captured
56+
Given device "TEST-deviceHistory-device002" does not exist
57+
And device "TEST-deviceHistory-device003" does not exist
58+
And I store the time the test started
59+
When I create device "TEST-deviceHistory-device002" with attributes
60+
| templateId | TEST-deviceHistory-device-type |
61+
| description | Description 1 |
62+
| attributes | {"firmwareVersion":"1"} |
63+
| groups | {"linked_to":["/TEST-deviceHistory-group"]} |
64+
And I create device "TEST-deviceHistory-device003" with attributes
65+
| templateId | TEST-deviceHistory-device-type |
66+
| description | Description 1 |
67+
| attributes | {"firmwareVersion":"1"} |
68+
| groups | {"linked_to":["/TEST-deviceHistory-group"]} |
69+
And I update device "TEST-deviceHistory-device002" with attributes
70+
| attributes | {"firmwareVersion":"2"} |
71+
And I update device "TEST-deviceHistory-device003" with attributes
72+
| attributes | {"firmwareVersion":"2"} |
73+
And pause for 32seconds
74+
Then 2 history records exist since the test started for device "TEST-deviceHistory-device002"
75+
And 2 history records exist since the test started for device "TEST-deviceHistory-device003"
5276

5377

5478
Scenario: Deleting a device logs a delete event
5579
Given device "TEST-deviceHistory-device001" exists
5680
# We store the time the test started so that we can filter out history records that may have been saved for this device prior to the test:
5781
And I store the time the test started
5882
When I delete device "TEST-deviceHistory-device001"
59-
And pause for 500ms
83+
And pause for 31seconds
6084
Then 1 history records exist since the test started for device "TEST-deviceHistory-device001"
6185
And history record 1 contains attributes
62-
| objectId | test-devicehistory-device001 |
63-
| event | delete |
64-
| state | {"attributes":{"firmwareVersion":"2"},"category":"device","description":"Description 1","deviceId":"test-devicehistory-device001","groups":{"out":{"linked_to":["/test-devicehistory-group"]}},"state":"unprovisioned","templateId":"test-devicehistory-device-type"} |
65-
| type | devices |
86+
| objectId | test-devicehistory-device001 |
87+
| event | delete |
88+
| state | {"attributes":{"firmwareVersion":"2"},"category":"device","description":"Description 1","deviceId":"test-devicehistory-device001","groups":{"out":{"linked_to":["/test-devicehistory-group"]}},"state":"unprovisioned","templateId":"test-devicehistory-device-type"} |
89+
| type | devices |
6690

6791

6892
Scenario: Retrieve all events relating to this test
6993
When I retrieve 3 history records for device "TEST-deviceHistory-device001"
7094
Then history record 1 contains attributes
71-
| objectId | test-devicehistory-device001 |
72-
| event | delete |
73-
| state | {"attributes":{"firmwareVersion":"2"},"category":"device","description":"Description 1","deviceId":"test-devicehistory-device001","groups":{"out":{"linked_to":["/test-devicehistory-group"]}},"state":"unprovisioned","templateId":"test-devicehistory-device-type"} |
74-
| type | devices |
95+
| objectId | test-devicehistory-device001 |
96+
| event | delete |
97+
| state | {"attributes":{"firmwareVersion":"2"},"category":"device","description":"Description 1","deviceId":"test-devicehistory-device001","groups":{"out":{"linked_to":["/test-devicehistory-group"]}},"state":"unprovisioned","templateId":"test-devicehistory-device-type"} |
98+
| type | devices |
7599
And history record 2 contains attributes
76-
| objectId | test-devicehistory-device001 |
77-
| event | modify |
78-
| state | {"attributes":{"firmwareVersion":"2"},"category":"device","description":"Description 1","deviceId":"test-devicehistory-device001","devices":{},"groups":{"out":{"linked_to":["/test-devicehistory-group"]}},"state":"unprovisioned","templateId":"test-devicehistory-device-type"} |
79-
| type | devices |
100+
| objectId | test-devicehistory-device001 |
101+
| event | modify |
102+
| state | {"attributes":{"firmwareVersion":"2"},"category":"device","description":"Description 1","deviceId":"test-devicehistory-device001","devices":{},"groups":{"out":{"linked_to":["/test-devicehistory-group"]}},"state":"unprovisioned","templateId":"test-devicehistory-device-type"} |
103+
| type | devices |
80104
And history record 3 contains attributes
81-
| objectId | test-devicehistory-device001 |
82-
| event | create |
83-
| state | {"attributes":{"firmwareVersion":"1"},"category":"device","description":"Description 1","deviceId":"test-devicehistory-device001","devices":{},"groups":{"out":{"linked_to":["/test-devicehistory-group"]}},"state":"unprovisioned","templateId":"test-devicehistory-device-type"} |
84-
| type | devices |
105+
| objectId | test-devicehistory-device001 |
106+
| event | create |
107+
| state | {"attributes":{"firmwareVersion":"1"},"category":"device","description":"Description 1","deviceId":"test-devicehistory-device001","devices":{},"groups":{"out":{"linked_to":["/test-devicehistory-group"]}},"state":"unprovisioned","templateId":"test-devicehistory-device-type"} |
108+
| type | devices |
85109

86110

87111
Scenario: Paginate all events relating to this test
88112
When I retrieve 3 history records for device "TEST-deviceHistory-device001"
89113
Then history record 1 contains attributes
90-
| objectId | test-devicehistory-device001 |
91-
| event | delete |
92-
| state | {"attributes":{"firmwareVersion":"2"},"category":"device","description":"Description 1","deviceId":"test-devicehistory-device001","groups":{"out":{"linked_to":["/test-devicehistory-group"]}},"state":"unprovisioned","templateId":"test-devicehistory-device-type"} |
93-
| type | devices |
114+
| objectId | test-devicehistory-device001 |
115+
| event | delete |
116+
| state | {"attributes":{"firmwareVersion":"2"},"category":"device","description":"Description 1","deviceId":"test-devicehistory-device001","groups":{"out":{"linked_to":["/test-devicehistory-group"]}},"state":"unprovisioned","templateId":"test-devicehistory-device-type"} |
117+
| type | devices |
94118
Then history record 2 contains attributes
95-
| objectId | test-devicehistory-device001 |
96-
| event | modify |
97-
| state | {"attributes":{"firmwareVersion":"2"},"category":"device","description":"Description 1","deviceId":"test-devicehistory-device001","devices":{},"groups":{"out":{"linked_to":["/test-devicehistory-group"]}},"state":"unprovisioned","templateId":"test-devicehistory-device-type"} |
98-
| type | devices |
119+
| objectId | test-devicehistory-device001 |
120+
| event | modify |
121+
| state | {"attributes":{"firmwareVersion":"2"},"category":"device","description":"Description 1","deviceId":"test-devicehistory-device001","devices":{},"groups":{"out":{"linked_to":["/test-devicehistory-group"]}},"state":"unprovisioned","templateId":"test-devicehistory-device-type"} |
122+
| type | devices |
99123
And history record 3 contains attributes
100-
| objectId | test-devicehistory-device001 |
101-
| event | create |
102-
| state | {"attributes":{"firmwareVersion":"1"},"category":"device","description":"Description 1","deviceId":"test-devicehistory-device001","devices":{},"groups":{"out":{"linked_to":["/test-devicehistory-group"]}},"state":"unprovisioned","templateId":"test-devicehistory-device-type"} |
103-
| type | devices |
104-
124+
| objectId | test-devicehistory-device001 |
125+
| event | create |
126+
| state | {"attributes":{"firmwareVersion":"1"},"category":"device","description":"Description 1","deviceId":"test-devicehistory-device001","devices":{},"groups":{"out":{"linked_to":["/test-devicehistory-group"]}},"state":"unprovisioned","templateId":"test-devicehistory-device-type"} |
127+
| type | devices |
128+
105129

106130
@teardown_deviceHistory_feature
107131
Scenario: Teardown

0 commit comments

Comments
 (0)