Skip to content

Commit

Permalink
Update to allow hackathon to be demonstrated
Browse files Browse the repository at this point in the history
  • Loading branch information
Cawllec committed Oct 20, 2024
1 parent 54acb0d commit 24b0745
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Gemfile-maze-runner
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source "https://rubygems.org"

gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner', tag: 'v7.10.1'
gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner', branch: 'integration/hackathon-2024'
70 changes: 70 additions & 0 deletions features/hackathon.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
Feature: Plain add tab to metadata

Scenario Outline: Metadata can be added to a report using add_tab
Given I set environment variable "CALLBACK_INITIATOR" to "<initiator>"
When I run the service "plain-ruby" with the command "bundle exec ruby report_modification/add_tab.rb"
And I wait to receive an error
Then the error is valid for the error reporting API version "4.0" for the "Ruby Bugsnag Notifier" notifier
And the event "metaData.additional_metadata.foo" equals "foo"
And the event "metaData.additional_metadata.bar.0" equals "b"
And the event "metaData.additional_metadata.bar.1" equals "a"
And the event "metaData.additional_metadata.bar.2" equals "r"
And the last event is available via the data access api
And the pipeline event payload field "metaData.additional_metadata.foo" equals "foo"
And the pipeline event payload field "metaData.additional_metadata.bar.0" equals "b"
And the pipeline event payload field "metaData.additional_metadata.bar.1" equals "a"
And the pipeline event payload field "metaData.additional_metadata.bar.2" equals "r"

Examples:
| initiator |
| handled_before_notify |
| handled_block |
| unhandled_before_notify |
| handled_on_error |
| unhandled_on_error |

Scenario Outline: Metadata can be added to an existing tab using add_tab
Given I set environment variable "CALLBACK_INITIATOR" to "<initiator>"
When I run the service "plain-ruby" with the command "bundle exec ruby report_modification/add_tab_existing.rb"
And I wait to receive an error
Then the error is valid for the error reporting API version "4.0" for the "Ruby Bugsnag Notifier" notifier
And the event "metaData.additional_metadata.foo" equals "foo"
And the event "metaData.additional_metadata.bar.0" equals "b"
And the event "metaData.additional_metadata.bar.1" equals "a"
And the event "metaData.additional_metadata.bar.2" equals "r"
And the event "metaData.additional_metadata.foobar.first" equals "foo"
And the event "metaData.additional_metadata.foobar.then" equals "bar"
And the last event is available via the data access api
And the pipeline event payload field "metaData.additional_metadata.foo" equals "foo"
And the pipeline event payload field "metaData.additional_metadata.bar.0" equals "b"
And the pipeline event payload field "metaData.additional_metadata.bar.1" equals "a"
And the pipeline event payload field "metaData.additional_metadata.bar.2" equals "r"
And the pipeline event payload field "metaData.additional_metadata.foobar.first" equals "foo"
And the pipeline event payload field "metaData.additional_metadata.foobar.then" equals "bar"

Examples:
| initiator |
| handled_before_notify |
| handled_block |
| unhandled_before_notify |
| handled_on_error |
| unhandled_on_error |

Scenario Outline: Metadata can be overwritten using add_tab
Given I set environment variable "CALLBACK_INITIATOR" to "<initiator>"
When I run the service "plain-ruby" with the command "bundle exec ruby report_modification/add_tab_override.rb"
And I wait to receive an error
Then the error is valid for the error reporting API version "4.0" for the "Ruby Bugsnag Notifier" notifier
And the event "metaData.additional_metadata.foo" equals "foo"
And the event "metaData.additional_metadata.bar" equals "bar"
And the last event is available via the data access api
And the pipeline event payload field "metaData.additional_metadata.foo" equals "foo"
And the pipeline event payload field "metaData.additional_metadata.bar" equals "bar"

Examples:
| initiator |
| handled_before_notify |
| handled_block |
| unhandled_before_notify |
| handled_on_error |
| unhandled_on_error |
1 change: 1 addition & 0 deletions features/support/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def current_ip
end

Maze.hooks.before do
$api_key = ENV["MAZE_REPEATER_API_KEY"] if ENV["MAZE_REPEATER_API_KEY"]
Maze::Runner.environment["BUGSNAG_API_KEY"] = $api_key

host = running_in_docker? ? "maze-runner" : current_ip
Expand Down

0 comments on commit 24b0745

Please sign in to comment.