Skip to content

Commit

Permalink
iterate on features expected for notifications to end-users - #75
Browse files Browse the repository at this point in the history
  • Loading branch information
bernard357 committed Jul 29, 2023
1 parent de75d9d commit c04b995
Show file tree
Hide file tree
Showing 7 changed files with 168 additions and 123 deletions.
36 changes: 25 additions & 11 deletions features/activity_management.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,31 @@ Feature: management of account activities and transactions

As a system administrator,
I want to record on-boarding transactions
so as to show/charge back costs of account management
so as to monitor and to manage service usage per cost center

As a system administrator,
I want to record maintenance transactions
so as to show/charge back costs of account management
so as to monitor and to manage service usage per cost center

As a system administrator,
I want to record console logins
so as to show/charge back costs of account management
so as to monitor and to manage service usage per cost center

As a system administrator,
I want to record acknowledged notifications of account holders
so as to monitor and to manage service usage per cost center

As a system administrator,
I observe activities as daily metrics
so as to monitor and to manage account usage per cost center
so as to monitor and to manage service usage per cost center

As a system administrator,
I check the on-going report on activities
so as to monitor the daily report on SPA usage
so as to monitor and to manage service usage per cost center

As a system administrator,
I check the monthly reports on activities
so as to monitor the reports daily report on SPA usage
so as to monitor and to manage service usage per cost center

Scenario: where a successful on-boarding transaction is recorded
Given an existing SPA system
Expand All @@ -48,20 +52,30 @@ Scenario: where a regular console login event is metered
And a data point is put to metric 'TransactionsByCostCenter'
And a data point is put to metric 'TransactionsByLabel'

Scenario: where an acknowledged notification is metered
Given an existing SPA system
When a 'AcknowledgedNotificationEvent' event for account '123456789012' is put from 'SustainablePersonalAccounts'
Then lambda function 'OnActivityEvent' is executed with the event
And details of the activity are put in a new record in the table 'ActivitiesTable'
And a data point is put to metric 'TransactionsByCostCenter'
And a data point is put to metric 'TransactionsByLabel'

Scenario: where activities appear in the monitoring dashboard
Given an existing SPA system
Then the monitoring dashboard displays metric 'TransactionsByCostCenter'
And the monitoring dashboard displays metric 'TransactionsByLabel'

Scenario: where activites are reported everyday for current month
Scenario: where activites are reported for current month
Given an existing SPA system
When the Lambda function 'OnDailyActivitiesReport' is invoked
Then code scans the table 'ActivitiesTable' for current month
When time is coming for a scheduled execution of 'OnOngoingActivitiesReport'
Then the Lambda function 'OnOngoingActivitiesReport' is invoked
And code scans the table 'ActivitiesTable' for current month
And code reports a list of activities as one CSV file per month on S3 reporting bucket

Scenario: where activities are reported for previous month
Given an existing SPA system
When the Lambda function 'OnMonthlyActivitiesReport' is invoked
Then code scans the table 'ActivitiesTable' for previous month
When time is coming for a scheduled execution of 'OnPastActivitiesReport'
Then the Lambda function 'OnPastActivitiesReport' is invoked
And code scans the table 'ActivitiesTable' for previous month
And code reports a list of activities as one CSV file per month on S3 reporting bucket

10 changes: 6 additions & 4 deletions features/cost_management.feature
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,19 @@ Scenario: where additional currencies are configured for reports

Scenario: where cloud costs are computed and released every day
Given an existing SPA system
When the Lambda function 'OnDailyCostsMetric' is invoked
Then code inspects all accounts managed in the system
When time is coming for a scheduled execution of 'OnDailyCostsMetric'
Then the Lambda function 'OnDailyCostsMetric' is invoked
And code inspects all accounts managed in the system
And code computes cost report for each account on previous day
And code sums up cost reports per cost center
And code pushes daily costs as a CloudWatch Metric
And daily costs are reflected in the SPA monitoring dashboard

Scenario: where cloud costs are computed and released every month
Given an existing SPA system
When the Lambda function 'OnMonthlyCostsReport' is invoked
Then code inspects all accounts managed in the system
When time is coming for a scheduled execution of 'OnMonthlyCostsReport'
Then the Lambda function 'OnMonthlyCostsReport' is invoked
And code inspects all accounts managed in the system
And code computes cost report for each account on previous month
And code sums up cost reports per cost center
And code pushes detailed monthly reports as one CSV file per cost center on S3 reporting bucket
Expand Down
21 changes: 13 additions & 8 deletions features/exception_management.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,42 @@ so as to support incident management and problem analysis

Scenario: where a budget alert triggers an exception
Given an existing SPA system
When the event 'BudgetAlertException' is emitted
When an event 'BudgetAlertException' is emitted
Then the Lambda function 'OnException' is invoked

Scenario: where a failed codebuild project triggers an exception
Given an existing SPA system
When the event 'FailedCodebuildException' is emitted
When an event 'FailedCodebuildException' is emitted
Then the Lambda function 'OnException' is invoked

Scenario: where a failed on-boarding transaction triggers an exception
Given an existing SPA system
When the event 'FailedOnBoardingException' is emitted
When an event 'FailedOnBoardingException' is emitted
Then the Lambda function 'OnException' is invoked

Scenario: where a failed maintenance transaction triggers an exception
Given an existing SPA system
When the event 'FailedMaintenanceException' is emitted
When an event 'FailedMaintenanceException' is emitted
Then the Lambda function 'OnException' is invoked

Scenario: where a console login with root credentials triggers an exception
Given an existing SPA system
When the event 'ConsoleLoginWithRootException' is emitted
When an event 'ConsoleLoginWithRootException' is emitted
Then the Lambda function 'OnException' is invoked

Scenario: where a console login with IAM user credentials triggers an exception
Given an existing SPA system
When the event 'ConsoleLoginWithIamUserException' is emitted
When an event 'ConsoleLoginWithIamUserException' is emitted
Then the Lambda function 'OnException' is invoked

Scenario: where an unacknowledged notification triggers an exception
Given an existing SPA system
When an event 'UnacknowledgedNotificationException' is emitted
Then the Lambda function 'OnException' is invoked

Scenario: where a generic exception is handled
Given an existing SPA system
When the event 'GenericException' is emitted
When an event 'GenericException' is emitted
Then the Lambda function 'OnException' is invoked

Scenario: where an incident record is created on exception
Expand All @@ -48,7 +53,7 @@ Scenario: where an incident record is created on exception

Scenario: where an incident record is enriched with account information
Given an exception that conveys an account id is put on the automation bus
And an incident record is created on exception
When an incident record is created on exception
Then the incident record is tagged with account information
And a cost report for current month for this account is attached to the incident record

Expand Down
33 changes: 27 additions & 6 deletions features/transaction_metering.feature
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ Scenario: where an on-boarding transaction ends
Scenario: where an on-boarding transaction fails on timeout
Given an account '123456789012' that is managed by SPA
And a transaction of type 'on-boarding' for account '123456789012' with stamp of 'CreatedEvent' is recorded in table 'TransactionsTable'
When no event 'ReleasedEvent' is emitted for account '123456789012' during 'transactions_timeout_in_seconds'
When no event 'ReleasedEvent' is emitted for account '123456789012' during 'on_boarding_timeout_in_seconds'
Then lambda function 'OnTransactionTimeOut' is executed with the expired record from table 'TransactionsTable'
And an event 'FailedOnboardingEvent' is emitted for account '123456789012' with data from the expired record
And an event 'FailedOnboardingException' is emitted for account '123456789012' with data from the expired record

Scenario: where a maintenance transaction begins
Given an account '123456789012' that is managed by SPA
When the event 'ExpiredEvent' is emitted for account '123456789012'
Then lambda function 'OnTransactionMetering' is executed with the event
And a transaction of type 'maintenance' for account '123456789012' with stamp of 'CreatedEvent' is recorded in table 'TransactionsTable'
And a transaction of type 'maintenance' for account '123456789012' with stamp of 'ExpiredEvent' is recorded in table 'TransactionsTable'

Scenario: where a maintenance transaction ends
Given an account '123456789012' that is managed by SPA
Expand All @@ -46,8 +46,29 @@ Scenario: where a maintenance transaction ends

Scenario: where a maintenance transaction fails on timeout
Given an account '123456789012' that is managed by SPA
And a transaction of type 'maintenance' for account '123456789012' with stamp of 'CreatedEvent' is recorded in table 'TransactionsTable'
When no event 'ReleasedEvent' is emitted for account '123456789012' during 'transactions_timeout_in_seconds'
And a transaction of type 'maintenance' for account '123456789012' with stamp of 'ExpiredEvent' is recorded in table 'TransactionsTable'
When no event 'ReleasedEvent' is emitted for account '123456789012' during 'maintenance_timeout_in_seconds'
Then lambda function 'OnTransactionTimeOut' is executed with the expired record from table 'TransactionsTable'
And an event 'FailedMaintenanceException' is emitted for account '123456789012' with data from the expired record

Scenario: where a notification transaction begins
Given an account '123456789012' that is managed by SPA
When the event 'NotificationEvent' is emitted for account '123456789012'
Then lambda function 'OnTransactionMetering' is executed with the event
And a transaction with identifier '123456789012 notification' with stamp of 'NotificationEvent' is recorded in table 'TransactionsTable'

Scenario: where a notification transaction ends
Given an account '123456789012' that is managed by SPA
And a transaction with identifier '123456789012 notification' with stamp of 'NotificationEvent' is recorded in table 'TransactionsTable'
When the event 'AcknowledgementEvent' is emitted for account '123456789012'
Then lambda function 'OnTransactionMetering' is executed with the event
And transaction '123456789012 notification' is retrieved
And an event 'AcknowledgedNotificationEvent' is emitted with duration between 'NotificationEvent' and 'AcknowledgementEvent'

Scenario: where a notification transaction fails on timeout
Given an account '123456789012' that is managed by SPA
And a transaction with identifier '123456789012 notification' with stamp of 'NotificationEvent' is recorded in table 'TransactionsTable'
When no event 'AcknowledgementEvent' is emitted for account '123456789012' during 'notification_timeout_in_seconds'
Then lambda function 'OnTransactionTimeOut' is executed with the expired record from table 'TransactionsTable'
And an event 'FailedMaintenanceEvent' is emitted for account '123456789012' with data from the expired record
And an event 'UnacknowlegdedNotificationException' is emitted for account '123456789012' with data from the expired record

83 changes: 0 additions & 83 deletions features/user_confirmations.feature

This file was deleted.

Loading

0 comments on commit c04b995

Please sign in to comment.