From 24b07456b6c57e4723a34ac2fd6d7413cae89e5e Mon Sep 17 00:00:00 2001 From: Alex Moinet Date: Sun, 20 Oct 2024 10:30:57 +0100 Subject: [PATCH] Update to allow hackathon to be demonstrated --- Gemfile-maze-runner | 2 +- features/hackathon.feature | 70 ++++++++++++++++++++++++++++++++++++++ features/support/env.rb | 1 + 3 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 features/hackathon.feature diff --git a/Gemfile-maze-runner b/Gemfile-maze-runner index 8dddc7ee..d6fbd71b 100644 --- a/Gemfile-maze-runner +++ b/Gemfile-maze-runner @@ -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' diff --git a/features/hackathon.feature b/features/hackathon.feature new file mode 100644 index 00000000..6b745932 --- /dev/null +++ b/features/hackathon.feature @@ -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 "" + 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 "" + 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 "" + 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 | diff --git a/features/support/env.rb b/features/support/env.rb index 29d00efc..dce673ae 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -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