features/rollup.feature in flapjack-1.6.0 vs features/rollup.feature in flapjack-2.0.0b1

- old
+ new

@@ -1,30 +1,30 @@ -@rollup @notification_rules @processor @notifier @events +@rollup @notification_rules @resque @processor @notifier @events Feature: Rollup on a per contact, per media basis Background: - Given the following users exist: - | id | first_name | last_name | email | sms | timezone | - | 1 | Malak | Al-Musawi | malak@example.com | +61400000001 | Asia/Baghdad | + Given the following contacts exist: + | id | name | timezone | + | 7f96a216-76aa-45fc-a88e-7431cd6d7aac | Malak Al-Musawi | Asia/Baghdad | - And the following entities exist: - | id | name | contacts | - | 1 | foo | 1 | - | 2 | baz | 1 | + And the following media exist: + | id | contact_id | transport | address | interval | rollup_threshold | + | 28032dbf-388d-4f52-91b2-dc5e5be2becc | 7f96a216-76aa-45fc-a88e-7431cd6d7aac | email | malak@example.com | 15 | 1 | + | 73e2803f-948e-467a-a707-37b9f53ee21a | 7f96a216-76aa-45fc-a88e-7431cd6d7aac | sms | +61400000001 | 15 | 2 | - And user 1 has the following notification intervals: - | email | sms | - | 15 | 15 | + And the following checks exist: + | id | name | tags | + | 56c13ce2-f246-4bc6-adfa-2206789c3ced | foo:ping | foo,ping | + | d1a39575-0480-4f65-a7f7-64c90db93731 | baz:ping | baz,ping | - And user 1 has the following notification rollup thresholds: - | email | sms | - | 1 | 2 | + And the following rules exist: + | id | contact_id | blackhole | strategy | tags | condition | time_restriction | media_ids | + | b0c8deb9-b8c8-4fdd-acc4-72493852ca15 | 7f96a216-76aa-45fc-a88e-7431cd6d7aac | false | all_tags | foo,ping | critical | | 28032dbf-388d-4f52-91b2-dc5e5be2becc,73e2803f-948e-467a-a707-37b9f53ee21a | + | b18e9f48-59e7-4c25-b94c-d4ebd4a6559a | 7f96a216-76aa-45fc-a88e-7431cd6d7aac | false | all_tags | foo,ping | warning | | 28032dbf-388d-4f52-91b2-dc5e5be2becc | + | 2df6bbc4-d6a4-4f23-b6e5-5c4a07c6e686 | 7f96a216-76aa-45fc-a88e-7431cd6d7aac | false | all_tags | baz,ping | critical | | 28032dbf-388d-4f52-91b2-dc5e5be2becc,73e2803f-948e-467a-a707-37b9f53ee21a | + | f163bf33-b53e-4138-ab27-1dd89f2d6fdd | 7f96a216-76aa-45fc-a88e-7431cd6d7aac | false | all_tags | baz,ping | warning | | 28032dbf-388d-4f52-91b2-dc5e5be2becc | - And user 1 has the following notification rules: - | entities | unknown_media | warning_media | critical_media | - | | | email | sms,email | - @time Scenario: Rollup threshold of 1 means first alert is a rollup Given the check is check 'ping' on entity 'foo' And the check is in an ok state When a critical event is received @@ -138,11 +138,12 @@ @time Scenario: Unscheduled maintenance ending promotes rollup Given check 'ping' for entity 'foo' is in unscheduled maintenance And check 'ping' for entity 'baz' is in an ok state - When a critical event is received for check 'ping' on entity 'foo' + When 1 minute passes + And a critical event is received for check 'ping' on entity 'foo' And 1 minute passes And a critical event is received for check 'ping' on entity 'foo' Then 0 sms alerts should be queued for +61400000001 When 5 minutes passes And a critical event is received for check 'ping' on entity 'baz' @@ -154,30 +155,10 @@ And a critical event is received for check 'ping' on entity 'foo' Then 1 sms alert of type problem and rollup problem should be queued for +61400000001 And 2 sms alerts should be queued for +61400000001 @time - Scenario: Scheduled maintenance ending promotes rollup - Given check 'ping' for entity 'foo' is in an ok state - Given check 'ping' for entity 'foo' is in scheduled maintenance for 4 hours - And check 'ping' for entity 'baz' is in an ok state - When a critical event is received for check 'ping' on entity 'foo' - And 1 minute passes - And a critical event is received for check 'ping' on entity 'foo' - Then 0 sms alerts should be queued for +61400000001 - When 5 minutes passes - And a critical event is received for check 'ping' on entity 'baz' - And 1 minute passes - And a critical event is received for check 'ping' on entity 'baz' - Then 1 sms alert of type problem and rollup none should be queued for +61400000001 - And 1 sms alerts should be queued for +61400000001 - When 4 hours passes - And a critical event is received for check 'ping' on entity 'foo' - Then 2 sms alerts should be queued for +61400000001 - And 1 sms alert of type problem and rollup problem should be queued for +61400000001 - - @time Scenario: Disabling a failing check suppresses rollup Given check 'ping' for entity 'foo' is in an ok state And check 'ping' for entity 'baz' is in an ok state When a critical event is received for check 'ping' on entity 'foo' And 1 minute passes @@ -207,39 +188,57 @@ When check 'ping' for entity 'foo' is disabled And 5 minutes passes And a critical event is received for check 'ping' on entity 'baz' And 1 minute passes And a critical event is received for check 'ping' on entity 'baz' - Then 2 sms alerts should be queued for +61400000001 + Then 1 sms alerts should be queued for +61400000001 Then 1 sms alert of type problem and rollup none should be queued for +61400000001 - Then 1 sms alert of type problem and rollup recovery should be queued for +61400000001 When 1 hour passes And check 'ping' on entity 'foo' is enabled And 5 minutes passes And a critical event is received for check 'ping' on entity 'foo' - Then 3 sms alerts should be queued for +61400000001 + Then 2 sms alerts should be queued for +61400000001 Then 1 sms alert of type problem and rollup none should be queued for +61400000001 - Then 1 sms alert of type problem and rollup recovery should be queued for +61400000001 And 1 sms alert of type problem and rollup problem should be queued for +61400000001 @time - Scenario: Contact ceases to be a contact on an entity that they were being alerted for + Scenario: Scheduled maintenance ending promotes rollup Given check 'ping' for entity 'foo' is in an ok state + Given check 'ping' for entity 'foo' is in scheduled maintenance for 4 hours And check 'ping' for entity 'baz' is in an ok state When a critical event is received for check 'ping' on entity 'foo' And 1 minute passes And a critical event is received for check 'ping' on entity 'foo' + Then 0 sms alerts should be queued for +61400000001 + When 5 minutes passes + And a critical event is received for check 'ping' on entity 'baz' + And 1 minute passes + And a critical event is received for check 'ping' on entity 'baz' + Then 1 sms alert of type problem and rollup none should be queued for +61400000001 + And 1 sms alerts should be queued for +61400000001 + When 4 hours passes + And a critical event is received for check 'ping' on entity 'foo' + Then 2 sms alerts should be queued for +61400000001 + And 1 sms alert of type problem and rollup problem should be queued for +61400000001 + + @time + Scenario: Contact removes a rule matching on a check + Given check 'ping' for entity 'foo' is in an ok state + And check 'ping' for entity 'baz' is in an ok state + When a critical event is received for check 'ping' on entity 'foo' + And 1 minute passes + And a critical event is received for check 'ping' on entity 'foo' Then 1 sms alerts of type problem and rollup none should be queued for +61400000001 When 5 minutes passes And a critical event is received for check 'ping' on entity 'baz' And 1 minute passes And a critical event is received for check 'ping' on entity 'baz' Then 1 sms alert of type problem and rollup problem should be queued for +61400000001 And 1 sms alerts of type problem and rollup none should be queued for +61400000001 And 2 sms alerts should be queued for +61400000001 When 20 minute passes - And user 1 ceases to be a contact of entity 'foo' + And the rule with id 'b0c8deb9-b8c8-4fdd-acc4-72493852ca15' is removed And a critical event is received for check 'ping' on entity 'baz' Then 1 sms alert of rollup recovery should be queued for +61400000001 @time Scenario: Test notification to not contribute to rollup @@ -247,12 +246,11 @@ And check 'ping' for entity 'baz' is in an ok state When a critical event is received for check 'ping' on entity 'foo' And 1 minute passes And a critical event is received for check 'ping' on entity 'foo' Then 1 sms alert of type problem and rollup none should be queued for +61400000001 - And 1 sms alert should be queued for +61400000001 When 1 minute passes - And a test event is received for check 'sausage' on entity 'foo' + And a test event is received for check 'ping' on entity 'foo' Then 1 sms alert of type problem and rollup none should be queued for +61400000001 And 1 sms alert of type test and rollup none should be queued for +61400000001 And 2 sms alerts should be queued for +61400000001 When 20 minutes passes And a critical event is received for check 'ping' on entity 'foo'