Skip to content

Instantly share code, notes, and snippets.

@jessereynolds
Created October 11, 2013 05:31
Show Gist options
  • Save jessereynolds/6930006 to your computer and use it in GitHub Desktop.
Save jessereynolds/6930006 to your computer and use it in GitHub Desktop.
failing rollup tests - is the gherkin expressing how we want the system to behave?
jesse@heart-of-gold flapjack $ be cucumber features/rollup.feature:121
@rollup @notification_rules @resque @processor @notifier @events
Feature: Rollup on a per contact, per media basis
Background: # features/rollup.feature:4
Given the following users exist: # features/steps/events_steps.rb:327
| id | first_name | last_name | email | sms | timezone |
| 1 | Malak | Al-Musawi | [email protected] | +61400000001 | Asia/Baghdad |
And the following entities exist: # features/steps/events_steps.rb:314
| id | name | contacts |
| 1 | foo | 1 |
| 2 | baz | 1 |
And user 1 has the following notification intervals: # features/steps/events_steps.rb:341
| email | sms |
| 15 | 15 |
And user 1 has the following notification rollup thresholds: # features/steps/events_steps.rb:349
| email | sms |
| 1 | 2 |
And user 1 has the following notification rules: # features/steps/events_steps.rb:357
| entities | unknown_media | warning_media | critical_media |
| | | email | sms,email |
@time
Scenario: Scheduled maintenance hastens rollup recovery # features/rollup.feature:121
Given check 'ping' for entity 'foo' is in an ok state # features/steps/events_steps.rb:185
And check 'ping' for entity 'baz' is in an ok state # features/steps/events_steps.rb:185
When a critical event is received for check 'ping' on entity 'foo' # features/steps/events_steps.rb:235
And 1 minute passes # features/steps/time_travel_steps.rb:7
And a critical event is received for check 'ping' on entity 'foo' # features/steps/events_steps.rb:235
Then 1 sms alerts of type problem and rollup none should be queued for +61400000001 # features/steps/events_steps.rb:407
When 5 minutes passes # features/steps/time_travel_steps.rb:7
And a critical event is received for check 'ping' on entity 'baz' # features/steps/events_steps.rb:235
And 1 minute passes # features/steps/time_travel_steps.rb:7
And a critical event is received for check 'ping' on entity 'baz' # features/steps/events_steps.rb:235
Then 1 sms alert of type problem and rollup problem should be queued for +61400000001 # features/steps/events_steps.rb:407
And 2 sms alerts should be queued for +61400000001 # features/steps/events_steps.rb:407
When check 'ping' for entity 'foo' is in scheduled maintenance for 1 day # features/steps/events_steps.rb:203
And 30 minutes passes # features/steps/time_travel_steps.rb:7
And a critical event is received for check 'ping' on entity 'baz' # features/steps/events_steps.rb:235
Then 1 sms alert of rollup recovery should be queued for +61400000001 # features/steps/events_steps.rb:407
expected: 1
got: 0 (using ==) (RSpec::Expectations::ExpectationNotMetError)
./features/steps/events_steps.rb:426:in `/^(\w+) (\w+) alert(?:s)?(?: of)?(?: type (\w+))?(?: and)?(?: rollup (\w+))? should be queued for (.*)$/'
features/rollup.feature:137:in `Then 1 sms alert of rollup recovery should be queued for +61400000001'
Failing Scenarios:
cucumber features/rollup.feature:121 # Scenario: Scheduled maintenance hastens rollup recovery
1 scenario (1 failed)
21 steps (1 failed, 20 passed)
0m0.351s
jesse@heart-of-gold flapjack $ be cucumber features/rollup.feature:159
@rollup @notification_rules @resque @processor @notifier @events
Feature: Rollup on a per contact, per media basis
Background: # features/rollup.feature:4
Given the following users exist: # features/steps/events_steps.rb:327
| id | first_name | last_name | email | sms | timezone |
| 1 | Malak | Al-Musawi | [email protected] | +61400000001 | Asia/Baghdad |
And the following entities exist: # features/steps/events_steps.rb:314
| id | name | contacts |
| 1 | foo | 1 |
| 2 | baz | 1 |
And user 1 has the following notification intervals: # features/steps/events_steps.rb:341
| email | sms |
| 15 | 15 |
And user 1 has the following notification rollup thresholds: # features/steps/events_steps.rb:349
| email | sms |
| 1 | 2 |
And user 1 has the following notification rules: # features/steps/events_steps.rb:357
| entities | unknown_media | warning_media | critical_media |
| | | email | sms,email |
@time
Scenario: Scheduled maintenance ending promotes rollup # features/rollup.feature:159
Given check 'ping' for entity 'foo' is in scheduled maintenance for 4 hours # features/steps/events_steps.rb:203
And check 'ping' for entity 'baz' is in an ok state # features/steps/events_steps.rb:185
When a critical event is received for check 'ping' on entity 'foo' # features/steps/events_steps.rb:235
And 1 minute passes # features/steps/time_travel_steps.rb:7
And a critical event is received for check 'ping' on entity 'foo' # features/steps/events_steps.rb:235
Then 0 sms alerts should be queued for +61400000001 # features/steps/events_steps.rb:407
When 5 minutes passes # features/steps/time_travel_steps.rb:7
And a critical event is received for check 'ping' on entity 'baz' # features/steps/events_steps.rb:235
And 1 minute passes # features/steps/time_travel_steps.rb:7
And a critical event is received for check 'ping' on entity 'baz' # features/steps/events_steps.rb:235
Then 1 sms alert of type problem and rollup none should be queued for +61400000001 # features/steps/events_steps.rb:407
And 1 sms alerts should be queued for +61400000001 # features/steps/events_steps.rb:407
When 4 hours passes # features/steps/time_travel_steps.rb:7
And a critical event is received for check 'ping' on entity 'foo' # features/steps/events_steps.rb:235
Then 1 sms alert of type problem and rollup problem should be queued for +61400000001 # features/steps/events_steps.rb:407
expected: 1
got: 0 (using ==) (RSpec::Expectations::ExpectationNotMetError)
./features/steps/events_steps.rb:426:in `/^(\w+) (\w+) alert(?:s)?(?: of)?(?: type (\w+))?(?: and)?(?: rollup (\w+))? should be queued for (.*)$/'
features/rollup.feature:174:in `Then 1 sms alert of type problem and rollup problem should be queued for +61400000001'
And 2 sms alerts should be queued for +61400000001 # features/steps/events_steps.rb:407
Failing Scenarios:
cucumber features/rollup.feature:159 # Scenario: Scheduled maintenance ending promotes rollup
1 scenario (1 failed)
21 steps (1 failed, 1 skipped, 19 passed)
0m0.321s
@jessereynolds
Copy link
Author

I'm actually happy with "Scheduled maintenance ending promotes rollup" now. It's just the first one I'm concerned about now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment