From ea2077b66a8e30412461807f1ef01b2ac78f0519 Mon Sep 17 00:00:00 2001 From: Daria Bialobrzeska Date: Tue, 20 Aug 2024 20:26:37 +0200 Subject: [PATCH 1/6] Rewrite basic features to new steps --- features/apptype.feature | 24 ++--- features/appversion.feature | 25 +++-- features/autonotify.feature | 15 +-- features/configuration.feature | 103 +++++++++++---------- features/endpoint.feature | 16 ---- features/handled.feature | 65 +++++++------ features/hostname.feature | 27 +++--- features/metadata.feature | 15 +-- features/multieventsession.feature | 21 ++--- features/onbeforenotify.feature | 17 ++-- features/paramfilters.feature | 31 +++---- features/plain_features/panics.feature | 25 ++--- features/recover.feature | 14 +-- features/releasestage.feature | 98 ++++++++++---------- features/sessioncontext.feature | 22 ++--- features/steps/go_steps.rb | 121 ------------------------- features/synchronous.feature | 20 ---- features/user.feature | 17 +--- 18 files changed, 227 insertions(+), 449 deletions(-) delete mode 100644 features/endpoint.feature delete mode 100644 features/synchronous.feature diff --git a/features/apptype.feature b/features/apptype.feature index efe897fc..0a48b079 100644 --- a/features/apptype.feature +++ b/features/apptype.feature @@ -1,22 +1,18 @@ Feature: Configuring app type Background: - Given I set environment variable "API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa" - And I configure the bugsnag endpoint - And I set environment variable "APP_TYPE" to "background-queue" - And I have built the service "app" + Given I set environment variable "BUGSNAG_APP_TYPE" to "background-queue" Scenario: An error report contains the configured app type when running a go app - Given I set environment variable "AUTO_CAPTURE_SESSIONS" to "false" - When I run the go service "app" with the test case "handled" - Then I wait to receive a request - And the request is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" + Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "false" + When I start the service "app" + And I run "HandledScenario" + And I wait to receive an error And the event "app.type" equals "background-queue" Scenario: An session report contains the configured app type when running a go app - Given I set environment variable "AUTO_CAPTURE_SESSIONS" to "true" - When I run the go service "app" with the test case "session" - Then I wait to receive a request after the start up session - And the request is a valid session report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" - And the payload field "app.type" equals "background-queue" - + Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "true" + When I start the service "app" + And I run "SendSessionScenario" + And I wait to receive a session + And the session payload field "app.type" equals "background-queue" diff --git a/features/appversion.feature b/features/appversion.feature index 805bf940..1b66737c 100644 --- a/features/appversion.feature +++ b/features/appversion.feature @@ -1,21 +1,18 @@ Feature: Configuring app version Background: - Given I set environment variable "API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa" - And I configure the bugsnag endpoint - And I set environment variable "APP_VERSION" to "3.1.2" - And I have built the service "app" + And I set environment variable "BUGSNAG_APP_VERSION" to "3.1.2" Scenario: An error report contains the configured app type when running a go app - Given I set environment variable "AUTO_CAPTURE_SESSIONS" to "false" - When I run the go service "app" with the test case "handled" - Then I wait to receive a request - And the request is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" + Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "false" + When I start the service "app" + And I run "HandledScenario" + And I wait to receive an error And the event "app.version" equals "3.1.2" -Scenario: An session report contains the configured app type when running a go app - Given I set environment variable "AUTO_CAPTURE_SESSIONS" to "true" - When I run the go service "app" with the test case "session" - Then I wait to receive a request after the start up session - And the request is a valid session report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" - And the payload field "app.version" equals "3.1.2" +Scenario: A session report contains the configured app type when running a go app + Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "true" + When I start the service "app" + And I run "SendSessionScenario" + And I wait to receive a session + And the session payload field "app.version" equals "3.1.2" \ No newline at end of file diff --git a/features/autonotify.feature b/features/autonotify.feature index 9a79dcfa..62dc508a 100644 --- a/features/autonotify.feature +++ b/features/autonotify.feature @@ -1,13 +1,8 @@ Feature: Using auto notify -Background: - Given I set environment variable "API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa" - And I configure the bugsnag endpoint - And I have built the service "app" - Scenario: An error report is sent when an AutoNotified crash occurs which later gets recovered - When I run the go service "app" with the test case "autonotify" - Then I wait for 3 seconds - And the request 1 is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" - And the exception "errorClass" equals "*errors.errorString" for request 1 - And the exception "message" equals "Go routine killed with auto notify" for request 1 + When I start the service "app" + And I run "AutonotifyPanicScenario" + And I wait to receive an error + And the exception "errorClass" equals "*errors.errorString" + And the exception "message" equals "Go routine killed with auto notify" \ No newline at end of file diff --git a/features/configuration.feature b/features/configuration.feature index a5e374eb..6c3c1139 100644 --- a/features/configuration.feature +++ b/features/configuration.feature @@ -5,92 +5,97 @@ Feature: Configure integration with environment variables Background: Given I set environment variable "BUGSNAG_API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa" - And I set environment variable "BUGSNAG_NOTIFY_ENDPOINT" to the notify endpoint - And I set environment variable "BUGSNAG_SESSIONS_ENDPOINT" to the sessions endpoint - And I have built the service "autoconfigure" Scenario Outline: Adding content to handled events through env variables Given I set environment variable "" to "" And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "0" - When I run the go service "autoconfigure" with the test case "" - Then I wait to receive a request - And the request is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" + When I start the service "app" + And I run "" + And I wait to receive an error And the event "" equals "" Examples: | testcase | variable | value | field | - | panic | BUGSNAG_APP_VERSION | 1.4.34 | app.version | - | panic | BUGSNAG_APP_TYPE | mailer-daemon | app.type | - | panic | BUGSNAG_RELEASE_STAGE | beta1 | app.releaseStage | - | panic | BUGSNAG_HOSTNAME | dream-machine-2 | device.hostname | - | panic | BUGSNAG_METADATA_device_instance | kube2-33-A | metaData.device.instance | - | panic | BUGSNAG_METADATA_framework_version | v3.1.0 | metaData.framework.version | - | panic | BUGSNAG_METADATA_device_runtime_level | 1C | metaData.device.runtime_level | - | panic | BUGSNAG_METADATA_Carrot | orange | metaData.custom.Carrot | + | AutoconfigPanicScenario | BUGSNAG_APP_VERSION | 1.4.34 | app.version | + | AutoconfigPanicScenario | BUGSNAG_APP_TYPE | mailer-daemon | app.type | + | AutoconfigPanicScenario | BUGSNAG_RELEASE_STAGE | beta1 | app.releaseStage | + | AutoconfigPanicScenario | BUGSNAG_HOSTNAME | dream-machine-2 | device.hostname | + | AutoconfigPanicScenario | BUGSNAG_METADATA_device_instance | kube2-33-A | metaData.device.instance | + | AutoconfigPanicScenario | BUGSNAG_METADATA_framework_version | v3.1.0 | metaData.framework.version | + | AutoconfigPanicScenario | BUGSNAG_METADATA_device_runtime_level | 1C | metaData.device.runtime_level | + | AutoconfigPanicScenario | BUGSNAG_METADATA_Carrot | orange | metaData.custom.Carrot | - | handled | BUGSNAG_APP_VERSION | 1.4.34 | app.version | - | handled | BUGSNAG_APP_TYPE | mailer-daemon | app.type | - | handled | BUGSNAG_RELEASE_STAGE | beta1 | app.releaseStage | - | handled | BUGSNAG_HOSTNAME | dream-machine-2 | device.hostname | - | handled | BUGSNAG_METADATA_device_instance | kube2-33-A | metaData.device.instance | - | handled | BUGSNAG_METADATA_framework_version | v3.1.0 | metaData.framework.version | - | handled | BUGSNAG_METADATA_device_runtime_level | 1C | metaData.device.runtime_level | - | handled | BUGSNAG_METADATA_Carrot | orange | metaData.custom.Carrot | + | AutoconfigHandledScenario | BUGSNAG_APP_VERSION | 1.4.34 | app.version | + | AutoconfigHandledScenario | BUGSNAG_APP_TYPE | mailer-daemon | app.type | + | AutoconfigHandledScenario | BUGSNAG_RELEASE_STAGE | beta1 | app.releaseStage | + | AutoconfigHandledScenario | BUGSNAG_HOSTNAME | dream-machine-2 | device.hostname | + | AutoconfigHandledScenario | BUGSNAG_METADATA_device_instance | kube2-33-A | metaData.device.instance | + | AutoconfigHandledScenario | BUGSNAG_METADATA_framework_version | v3.1.0 | metaData.framework.version | + | AutoconfigHandledScenario | BUGSNAG_METADATA_device_runtime_level | 1C | metaData.device.runtime_level | + | AutoconfigHandledScenario | BUGSNAG_METADATA_Carrot | orange | metaData.custom.Carrot | Scenario: Configuring project packages Given I set environment variable "BUGSNAG_PROJECT_PACKAGES" to "main,test" And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "0" - When I run the go service "autoconfigure" with the test case "panic" - Then I wait to receive a request - And the request is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" - And the in-project frames of the stacktrace are: - | file | method | lineNumber | - | cases.go | explicitPanic | 22 | - | main.go | main | 11 | + When I start the service "app" + And I run "AutoconfigPanicScenario" + And I wait to receive an error + And the "file" of stack frame 0 equals "features/fixtures/app/autoconfig_scenario.go" + And the "method" of stack frame 0 equals "AutoconfigPanicScenario.func1" + And the "lineNumber" of stack frame 0 equals 11 + And the "file" of stack frame 1 equals "features/fixtures/app/main.go" + And the "method" of stack frame 1 equals "main" + And the "lineNumber" of stack frame 1 equals 65 Scenario: Configuring source root - Given I set environment variable "BUGSNAG_SOURCE_ROOT" to the app directory + Given I set environment variable "BUGSNAG_SOURCE_ROOT" to "/app/src/features/fixtures/app/" And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "0" - And I run the go service "autoconfigure" with the test case "panic" - Then I wait to receive a request - And the request is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" - And the in-project frames of the stacktrace are: - | file | method | lineNumber | - | cases.go | explicitPanic | 22 | - | main.go | main | 11 | + When I start the service "app" + And I run "AutoconfigPanicScenario" + And I wait to receive an error + And the "file" of stack frame 0 equals "autoconfig_scenario.go" + And the "method" of stack frame 0 equals "AutoconfigPanicScenario.func1" + And the "lineNumber" of stack frame 0 equals 11 + And the "file" of stack frame 1 equals "main.go" + And the "method" of stack frame 1 equals "main" + And the "lineNumber" of stack frame 1 equals 65 Scenario: Delivering events filtering through notify release stages Given I set environment variable "BUGSNAG_NOTIFY_RELEASE_STAGES" to "prod,beta" And I set environment variable "BUGSNAG_RELEASE_STAGE" to "beta" And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "0" - And I run the go service "autoconfigure" with the test case "panic" - Then I wait to receive a request - And the request is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" + When I start the service "app" + And I run "AutoconfigPanicScenario" + And I wait to receive an error Scenario: Suppressing events through notify release stages Given I set environment variable "BUGSNAG_NOTIFY_RELEASE_STAGES" to "prod,beta" And I set environment variable "BUGSNAG_RELEASE_STAGE" to "dev" And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "0" - And I run the go service "autoconfigure" with the test case "panic" - Then 0 requests were received + When I start the service "app" + And I run "AutoconfigPanicScenario" + Then I should receive no errors Scenario: Suppressing events using panic handler Given I set environment variable "BUGSNAG_DISABLE_PANIC_HANDLER" to "1" And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "0" - And I run the go service "autoconfigure" with the test case "panic" + When I start the service "app" + And I run "AutoconfigPanicScenario" And I wait for 2 seconds - Then 0 requests were received + Then I should receive no errors Scenario: Enabling synchronous event delivery Given I set environment variable "BUGSNAG_SYNCHRONOUS" to "1" And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "0" - When I run the go service "autoconfigure" with the test case "handled" - Then 1 request was received + When I start the service "app" + And I run "AutoconfigHandledScenario" + And I wait to receive an error Scenario: Filtering metadata Given I set environment variable "BUGSNAG_PARAMS_FILTERS" to "tomato,pears" And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "0" - When I run the go service "autoconfigure" with the test case "handled-metadata" - Then I wait to receive a request + When I start the service "app" + And I run "AutoconfigMetadataScenario" + And I wait to receive an error And the event "metaData.fruit.Tomato" equals "[FILTERED]" - And the event "metaData.snacks.Carrot" equals "4" + And the event "metaData.snacks.Carrot" equals "4" \ No newline at end of file diff --git a/features/endpoint.feature b/features/endpoint.feature deleted file mode 100644 index 803f6f4b..00000000 --- a/features/endpoint.feature +++ /dev/null @@ -1,16 +0,0 @@ -Feature: Configuring endpoint - -Background: - Given I set environment variable "API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa" - And I configure the bugsnag endpoint - And I have built the service "app" - -Scenario: An error report is sent successfully using the notify endpoint only - When I run the go service "app" with the test case "endpoint-notify" - Then I wait to receive a request - And the request is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" - -Scenario: Configuring Bugsnag will panic if the sessions endpoint is configured without the notify endpoint - When I run the go service "app" with the test case "endpoint-session" - And I wait for 3 second - Then I should receive no requests diff --git a/features/handled.feature b/features/handled.feature index a7797a8a..2a69b66e 100644 --- a/features/handled.feature +++ b/features/handled.feature @@ -1,70 +1,67 @@ Feature: Plain handled errors Background: - Given I set environment variable "API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa" - Given I set environment variable "BUGSNAG_SOURCE_ROOT" to the app directory - And I configure the bugsnag endpoint - And I have built the service "app" - And I set environment variable "AUTO_CAPTURE_SESSIONS" to "false" + Given I set environment variable "BUGSNAG_SOURCE_ROOT" to "/app/src/features/fixtures/app/" + And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "false" Scenario: A handled error sends a report - When I run the go service "app" with the test case "handled" - Then I wait to receive a request - And the request is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" + When I start the service "app" + And I run "HandledScenario" + And I wait to receive an error And the event "unhandled" is false And the event "severity" equals "warning" And the event "severityReason.type" equals "handledError" - And the exception is a PathError for request 0 - And the "file" of stack frame 0 equals "main.go" + And the exception "errorClass" equals "*fs.PathError" + And the "file" of stack frame 0 equals "handled_scenario.go" Scenario: A handled error sends a report with a custom name Given I set environment variable "ERROR_CLASS" to "MyCustomErrorClass" - When I run the go service "app" with the test case "handled" - Then I wait to receive a request - And the request is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" + When I start the service "app" + And I run "HandledScenario" + And I wait to receive an error And the event "unhandled" is false And the event "severity" equals "warning" And the event "severityReason.type" equals "handledError" And the exception "errorClass" equals "MyCustomErrorClass" - And the "file" of stack frame 0 equals "main.go" + And the "file" of stack frame 0 equals "handled_scenario.go" Scenario: Sending an event using a callback to modify report contents - When I run the go service "app" with the test case "handled-with-callback" - Then I wait to receive a request - And the request is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" + When I start the service "app" + And I run "HandledCallbackErrorScenario" + And I wait to receive an error And the event "unhandled" is false And the event "severity" equals "info" And the event "severityReason.type" equals "userCallbackSetSeverity" And the event "context" equals "nonfatal.go:14" - And the "file" of stack frame 0 equals "main.go" - And stack frame 0 contains a local function spanning 245 to 253 + And the "file" of stack frame 0 equals "handled_scenario.go" + And the "lineNumber" of stack frame 0 equals 59 And the "file" of stack frame 1 equals ">insertion<" And the "lineNumber" of stack frame 1 equals 0 Scenario: Marking an error as unhandled in a callback - When I run the go service "app" with the test case "make-unhandled-with-callback" - Then I wait to receive a request - And the request is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" + When I start the service "app" + And I run "HandledToUnhandledScenario" + And I wait to receive an error And the event "unhandled" is true And the event "severity" equals "error" And the event "severityReason.type" equals "userCallbackSetSeverity" And the event "severityReason.unhandledOverridden" is true - And the "file" of stack frame 0 equals "main.go" - And stack frame 0 contains a local function spanning 257 to 262 + And the "file" of stack frame 0 equals "handled_scenario.go" + And the "lineNumber" of stack frame 0 equals 72 Scenario: Unwrapping the causes of a handled error - When I run the go service "app" with the test case "nested-error" - Then I wait to receive a request - And the request is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" + When I start the service "app" + And I run "NestedErrorScenario" + And I wait to receive an error And the event "unhandled" is false And the event "severity" equals "warning" And the event "exceptions.0.message" equals "terminate process" - And the "lineNumber" of stack frame 0 equals 295 - And the "file" of stack frame 0 equals "main.go" - And the "method" of stack frame 0 equals "nestedHandledError" + And the "lineNumber" of stack frame 0 equals 40 + And the "file" of stack frame 0 equals "handled_scenario.go" + And the "method" of stack frame 0 equals "NestedHandledErrorScenario.func1" And the event "exceptions.1.message" equals "login failed" - And the event "exceptions.1.stacktrace.0.file" equals "main.go" - And the event "exceptions.1.stacktrace.0.lineNumber" equals 315 + And the event "exceptions.1.stacktrace.0.file" equals "utils.go" + And the event "exceptions.1.stacktrace.0.lineNumber" equals 39 And the event "exceptions.2.message" equals "invalid token" - And the event "exceptions.2.stacktrace.0.file" equals "main.go" - And the event "exceptions.2.stacktrace.0.lineNumber" equals 323 + And the event "exceptions.2.stacktrace.0.file" equals "utils.go" + And the event "exceptions.2.stacktrace.0.lineNumber" equals 47 \ No newline at end of file diff --git a/features/hostname.feature b/features/hostname.feature index 14c72c90..f05e7fef 100644 --- a/features/hostname.feature +++ b/features/hostname.feature @@ -1,22 +1,17 @@ Feature: Configuring hostname -Background: - Given I set environment variable "API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa" - And I configure the bugsnag endpoint - And I have built the service "app" - Scenario: An error report contains the configured hostname - Given I set environment variable "HOSTNAME" to "server-1a" - And I set environment variable "AUTO_CAPTURE_SESSIONS" to "false" - When I run the go service "app" with the test case "handled" - And I wait to receive a request - And the request is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" + Given I set environment variable "BUGSNAG_HOSTNAME" to "server-1a" + And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "false" + When I start the service "app" + And I run "HandledScenario" + And I wait to receive an error And the event "device.hostname" equals "server-1a" Scenario: An session report contains the configured hostname - Given I set environment variable "HOSTNAME" to "server-1a" - And I set environment variable "AUTO_CAPTURE_SESSIONS" to "true" - When I run the go service "app" with the test case "session" - And I wait to receive a request after the start up session - And the request is a valid session report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" - And the payload field "device.hostname" equals "server-1a" + Given I set environment variable "BUGSNAG_HOSTNAME" to "server-1a" + And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "true" + When I start the service "app" + And I run "SendSessionScenario" + And I wait to receive a session + And the session payload field "device.hostname" equals "server-1a" \ No newline at end of file diff --git a/features/metadata.feature b/features/metadata.feature index 94a8bbf6..a2995445 100644 --- a/features/metadata.feature +++ b/features/metadata.feature @@ -1,15 +1,10 @@ Feature: Sending meta data -Background: - Given I set environment variable "API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa" - And I set environment variable "AUTO_CAPTURE_SESSIONS" to "false" - And I configure the bugsnag endpoint - And I have built the service "app" - Scenario: An error report contains custom meta data - When I run the go service "app" with the test case "metadata" - And I wait to receive a request - And the request is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" + When I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "false" + And I start the service "app" + And I run "MetadataScenario" + And I wait to receive an error And the event "metaData.Scheme.Customer.Name" equals "Joe Bloggs" And the event "metaData.Scheme.Customer.Age" equals "21" - And the event "metaData.Scheme.Level" equals "Blue" + And the event "metaData.Scheme.Level" equals "Blue" \ No newline at end of file diff --git a/features/multieventsession.feature b/features/multieventsession.feature index e9e4dbc1..91478eba 100644 --- a/features/multieventsession.feature +++ b/features/multieventsession.feature @@ -1,23 +1,18 @@ Feature: Reporting multiple handled and unhandled errors in the same session Background: - Given I set environment variable "API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa" - And I configure the bugsnag endpoint - And I have built the service "app" - And I set environment variable "AUTO_CAPTURE_SESSIONS" to "false" + Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "false" Scenario: Handled errors know about previous reported handled errors - When I run the go service "app" with the test case "multiple-handled" - And I wait to receive 2 requests - And the request 0 is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" - And the request 1 is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" + When I start the service "app" + And I run "MultipleHandledScenario" + And I wait to receive 2 errors And the event handled sessions count equals 1 for request 0 And the event handled sessions count equals 2 for request 1 Scenario: Unhandled errors know about previous reported handled errors - When I run the go service "app" with the test case "multiple-unhandled" - And I wait to receive 2 requests - And the request 0 is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" - And the request 1 is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" + When I start the service "app" + And I run "MultipleUnhandledScenario" + And I wait to receive 2 errors And the event unhandled sessions count equals 1 for request 0 - And the event unhandled sessions count equals 2 for request 1 + And the event unhandled sessions count equals 2 for request 1 \ No newline at end of file diff --git a/features/onbeforenotify.feature b/features/onbeforenotify.feature index 7b4b332f..a53fe1f0 100644 --- a/features/onbeforenotify.feature +++ b/features/onbeforenotify.feature @@ -1,14 +1,9 @@ Feature: Configuring on before notify -Background: - Given I set environment variable "API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa" - And I configure the bugsnag endpoint - And I have built the service "app" - Scenario: Send three bugsnags and use on before notify to drop one and modify the message of another - When I run the go service "app" with the test case "onbeforenotify" - Then I wait to receive 2 requests after the start up session - And the request 0 is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" - And the exception "message" equals "Don't ignore this error" for request 0 - And the request 1 is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" - And the exception "message" equals "Error message was changed" for request 1 + When I start the service "app" + And I run "OnBeforeNotifyScenario" + And I wait to receive 2 errors + And the exception "message" equals "don't ignore this error" + And I discard the oldest error + And the exception "message" equals "error message was changed" \ No newline at end of file diff --git a/features/paramfilters.feature b/features/paramfilters.feature index d1b714b8..58f2c7d8 100644 --- a/features/paramfilters.feature +++ b/features/paramfilters.feature @@ -1,29 +1,22 @@ Feature: Configuring param filters -Background: - Given I set environment variable "API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa" - And I set environment variable "AUTO_CAPTURE_SESSIONS" to "false" - And I configure the bugsnag endpoint - And I have built the service "app" - Scenario: An error report containing meta data is not filtered when the param filters are set but do not match - Given I set environment variable "PARAMS_FILTERS" to "Name" - When I run the go service "app" with the test case "filtered" - Then I wait to receive a request - And the request is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" + Given I set environment variable "BUGSNAG_PARAMS_FILTERS" to "Name" + When I start the service "app" + And I run "FilteredMetadataScenario" + And I wait to receive an error And the event "metaData.Account.Price(dollars)" equals "1 Million" Scenario: An error report containing meta data is filtered when the param filters are set and completely match - Given I set environment variable "PARAMS_FILTERS" to "Price(dollars)" - When I run the go service "app" with the test case "filtered" - Then I wait to receive a request - And the request is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" + Given I set environment variable "BUGSNAG_PARAMS_FILTERS" to "Price(dollars)" + When I start the service "app" + And I run "FilteredMetadataScenario" + And I wait to receive an error And the event "metaData.Account.Price(dollars)" equals "[FILTERED]" Scenario: An error report containing meta data is filtered when the param filters are set and partially match - Given I set environment variable "PARAMS_FILTERS" to "Price" - When I run the go service "app" with the test case "filtered" - Then I wait to receive a request - And the request is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" + Given I set environment variable "BUGSNAG_PARAMS_FILTERS" to "Price" + When I start the service "app" + And I run "FilteredMetadataScenario" + And I wait to receive an error And the event "metaData.Account.Price(dollars)" equals "[FILTERED]" - diff --git a/features/plain_features/panics.feature b/features/plain_features/panics.feature index 2f239a3b..6e9e3174 100644 --- a/features/plain_features/panics.feature +++ b/features/plain_features/panics.feature @@ -1,24 +1,19 @@ Feature: Panic handling Background: - Given I set environment variable "API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa" - Given I set environment variable "BUGSNAG_SOURCE_ROOT" to the app directory - And I configure the bugsnag endpoint - And I have built the service "app" - And I set environment variable "AUTO_CAPTURE_SESSIONS" to "false" + Given I set environment variable "BUGSNAG_SOURCE_ROOT" to "/app/src/features/fixtures/app/" + And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "false" Scenario: Capturing a panic - When I run the go service "app" with the test case "unhandled" - Then I wait to receive a request - And the request is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" + When I start the service "app" + And I run "UnhandledScenario" + And I wait to receive an error And the event "unhandled" is true And the event "severity" equals "error" And the event "severityReason.type" equals "unhandledPanic" And the exception "errorClass" equals "panic" - And the exception "message" is one of: - | interface conversion: interface is struct {}, not string | - | interface conversion: interface {} is struct {}, not string | - And the in-project frames of the stacktrace are: - | file | method | - | main.go | unhandledCrash.func1 | - | main.go | unhandledCrash | + And the exception "message" matches "^interface conversion: interface.*?is struct {}, not string" + And the "file" of stack frame 0 equals "unhandled_scenario.go" + And the "method" of stack frame 0 equals "UnhandledCrashScenario.func1.1" + And the "file" of stack frame 1 equals "unhandled_scenario.go" + And the "method" of stack frame 1 equals "UnhandledCrashScenario.func1" \ No newline at end of file diff --git a/features/recover.feature b/features/recover.feature index cbdb1f55..8df1bf2a 100644 --- a/features/recover.feature +++ b/features/recover.feature @@ -1,14 +1,8 @@ Feature: Using recover -Background: - Given I set environment variable "API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa" - And I set environment variable "AUTO_CAPTURE_SESSIONS" to "false" - And I configure the bugsnag endpoint - And I have built the service "app" - Scenario: An error report is sent when a go routine crashes but recovers - When I run the go service "app" with the test case "recover" - Then I wait to receive a request - And the request is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" + When I start the service "app" + And I run "RecoverAfterPanicScenario" + And I wait to receive an error And the exception "errorClass" equals "*errors.errorString" - And the exception "message" equals "Go routine killed but recovered" + And the exception "message" equals "Go routine killed but recovered" \ No newline at end of file diff --git a/features/releasestage.feature b/features/releasestage.feature index 6b16ee48..e5dd56c8 100644 --- a/features/releasestage.feature +++ b/features/releasestage.feature @@ -1,71 +1,65 @@ Feature: Configuring release stages and notify release stages -Background: - Given I set environment variable "API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa" - And I configure the bugsnag endpoint - And I have built the service "app" - Scenario: An error report is sent when release stage matches notify release stages - Given I set environment variable "NOTIFY_RELEASE_STAGES" to "stage1,stage2,stage3" - And I set environment variable "AUTO_CAPTURE_SESSIONS" to "false" - And I set environment variable "RELEASE_STAGE" to "stage2" - When I run the go service "app" with the test case "handled" - Then I wait to receive a request - And the request is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" + Given I set environment variable "BUGSNAG_NOTIFY_RELEASE_STAGES" to "stage1,stage2,stage3" + And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "false" + And I set environment variable "BUGSNAG_RELEASE_STAGE" to "stage2" + When I start the service "app" + And I run "HandledScenario" + And I wait to receive an error And the event "app.releaseStage" equals "stage2" Scenario: An error report is sent when no notify release stages are specified - Given I set environment variable "RELEASE_STAGE" to "stage2" - And I set environment variable "AUTO_CAPTURE_SESSIONS" to "false" - When I run the go service "app" with the test case "handled" - Then I wait to receive a request - And the request is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" + Given I set environment variable "BUGSNAG_RELEASE_STAGE" to "stage2" + And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "false" + When I start the service "app" + And I run "HandledScenario" + And I wait to receive an error And the event "app.releaseStage" equals "stage2" Scenario: An error report is sent regardless of notify release stages if release stage is not set - Given I set environment variable "NOTIFY_RELEASE_STAGES" to "stage1,stage2,stage3" - And I set environment variable "AUTO_CAPTURE_SESSIONS" to "false" - When I run the go service "app" with the test case "handled" - Then I wait to receive a request - And the request is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" + Given I set environment variable "BUGSNAG_NOTIFY_RELEASE_STAGES" to "stage1,stage2,stage3" + And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "false" + When I start the service "app" + And I run "HandledScenario" + And I wait to receive an error Scenario: An error report is not sent if the release stage does not match the notify release stages - Given I set environment variable "NOTIFY_RELEASE_STAGES" to "stage1,stage2,stage3" - And I set environment variable "AUTO_CAPTURE_SESSIONS" to "false" - And I set environment variable "RELEASE_STAGE" to "stage4" - When I run the go service "app" with the test case "handled" - And I wait for 3 second - Then I should receive no requests + Given I set environment variable "BUGSNAG_NOTIFY_RELEASE_STAGES" to "stage1,stage2,stage3" + And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "false" + And I set environment variable "BUGSNAG_RELEASE_STAGE" to "stage4" + When I start the service "app" + And I run "HandledScenario" + And I should receive no errors Scenario: An session report is sent when release stage matches notify release stages - Given I set environment variable "NOTIFY_RELEASE_STAGES" to "stage1,stage2,stage3" - And I set environment variable "AUTO_CAPTURE_SESSIONS" to "true" - And I set environment variable "RELEASE_STAGE" to "stage2" - When I run the go service "app" with the test case "session" - Then I wait to receive a request after the start up session - And the request is a valid session report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" - And the payload field "app.releaseStage" equals "stage2" + Given I set environment variable "BUGSNAG_NOTIFY_RELEASE_STAGES" to "stage1,stage2,stage3" + And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "true" + And I set environment variable "BUGSNAG_RELEASE_STAGE" to "stage2" + When I start the service "app" + And I run "SendSessionScenario" + And I wait to receive a session + And the session payload field "app.releaseStage" equals "stage2" Scenario: An session report is sent when no notify release stages are specified - Given I set environment variable "RELEASE_STAGE" to "stage2" - And I set environment variable "AUTO_CAPTURE_SESSIONS" to "true" - When I run the go service "app" with the test case "session" - Then I wait to receive a request after the start up session - And the request is a valid session report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" - And the payload field "app.releaseStage" equals "stage2" + Given I set environment variable "BUGSNAG_RELEASE_STAGE" to "stage2" + And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "true" + When I start the service "app" + And I run "SendSessionScenario" + And I wait to receive a session + And the session payload field "app.releaseStage" equals "stage2" Scenario: An session report is sent regardless of notify release stages if release stage is not set - Given I set environment variable "NOTIFY_RELEASE_STAGES" to "stage1,stage2,stage3" - And I set environment variable "AUTO_CAPTURE_SESSIONS" to "true" - When I run the go service "app" with the test case "session" - Then I wait to receive a request after the start up session - And the request is a valid session report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" + Given I set environment variable "BUGSNAG_NOTIFY_RELEASE_STAGES" to "stage1,stage2,stage3" + And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "true" + When I start the service "app" + And I run "SendSessionScenario" + And I wait to receive a session Scenario: An session report is not sent if the release stage does not match the notify release stages - Given I set environment variable "NOTIFY_RELEASE_STAGES" to "stage1,stage2,stage3" - And I set environment variable "AUTO_CAPTURE_SESSIONS" to "true" - And I set environment variable "RELEASE_STAGE" to "stage4" - When I run the go service "app" with the test case "session" - And I wait for 3 second - Then I should receive no requests - + Given I set environment variable "BUGSNAG_NOTIFY_RELEASE_STAGES" to "stage1,stage2,stage3" + And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "true" + And I set environment variable "BUGSNAG_RELEASE_STAGE" to "stage4" + When I start the service "app" + And I run "SendSessionScenario" + And I should receive no sessions diff --git a/features/sessioncontext.feature b/features/sessioncontext.feature index 0b986395..8cc09a14 100644 --- a/features/sessioncontext.feature +++ b/features/sessioncontext.feature @@ -1,15 +1,13 @@ Feature: Session data inside an error report using a session context -Background: - Given I set environment variable "API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa" - And I configure the bugsnag endpoint - And I have built the service "app" - Scenario: An error report contains a session count when part of a session - When I run the go service "app" with the test case "session-and-error" - Then I wait to receive 2 requests after the start up session - And the request 0 is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" - And the request 1 is a valid session report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" - And the event handled sessions count equals 1 for request 0 - And the event unhandled sessions count equals 0 for request 0 - And the number of sessions started equals 1 for request 1 + When I start the service "app" + And I run "SessionAndErrorScenario" + Then I wait to receive 1 error + # one session is created on start + And I wait to receive 2 session + And the error is valid for the error reporting API version "4" for the "Bugsnag Go" notifier + And the session is valid for the session reporting API version "1.0" for the "Bugsnag Go" notifier + And I discard the oldest session + And the session is valid for the session reporting API version "1.0" for the "Bugsnag Go" notifier + And the session payload has a valid sessions array \ No newline at end of file diff --git a/features/steps/go_steps.rb b/features/steps/go_steps.rb index 001a5ca9..cdc1678f 100644 --- a/features/steps/go_steps.rb +++ b/features/steps/go_steps.rb @@ -40,124 +40,3 @@ def local_ip ip_list.captures.first end end - -Given("I set environment variable {string} to the app directory") do |key| - step("I set environment variable \"#{key}\" to \"/app/src/test/\"") -end - -Given("I set environment variable {string} to the notify endpoint") do |key| - step("I set environment variable \"#{key}\" to \"http://#{current_ip}:#{MOCK_API_PORT}\"") -end - -Given("I set environment variable {string} to the sessions endpoint") do |key| - # they're the same picture dot gif - # split them out for the future endpoint splitting work - step("I set environment variable \"#{key}\" to \"http://#{current_ip}:#{MOCK_API_PORT}\"") -end - -Then(/^the request(?: (\d+))? is a valid error report with api key "(.*)"$/) do |request_index, api_key| - request_index ||= 0 - steps %Q{ - And the request #{request_index} is valid for the error reporting API - And the "bugsnag-api-key" header equals "#{api_key}" for request #{request_index} - And the payload field "apiKey" equals "#{api_key}" for request #{request_index} - } -end - -Then(/^the exception is a PathError for request (\d+)$/) do |request_index| - body = find_request(request_index)[:body] - error_class = body["events"][0]["exceptions"][0]["errorClass"] - if ['1.11', '1.12', '1.13', '1.14', '1.15'].include? ENV['GO_VERSION'] - assert_equal(error_class, '*os.PathError') - else - assert_equal(error_class, '*fs.PathError') - end -end - -Then(/^the request(?: (\d+))? is a valid session report with api key "(.*)"$/) do |request_index, api_key| - request_index ||= 0 - steps %Q{ - And the request #{request_index} is valid for the session tracking API - And the "bugsnag-api-key" header equals "#{api_key}" for request #{request_index} - } -end - -Then(/^the event unhandled sessions count equals (\d+) for request (\d+)$/) do |count, request_index| - step "the payload field \"events.0.session.events.unhandled\" equals #{count} for request #{request_index}" -end - -Then(/^the event handled sessions count equals (\d+) for request (\d+)$/) do |count, request_index| - step "the payload field \"events.0.session.events.handled\" equals #{count} for request #{request_index}" -end - -Then(/^the number of sessions started equals (\d+) for request (\d+)$/) do |count, request_index| - step "the payload field \"sessionCounts.0.sessionsStarted\" equals #{count} for request #{request_index}" -end - -When("I run the go service {string} with the test case {string}") do |service, testcase| - run_service_with_command(service, "./run.sh go run . -test=\"#{testcase}\"") -end - -Then(/^I wait to receive a request after the start up session$/) do - step "I wait to receive 1 requests after the start up session" -end - -Then(/^I wait to receive (\d+) requests after the start up session?$/) do |request_count| - max_attempts = 50 - attempts = 0 - start_up_message_received = false - start_up_message_removed = false - received = false - until (attempts >= max_attempts) || received - attempts += 1 - start_up_message_received ||= (stored_requests.size == 1) - if start_up_message_received && !start_up_message_removed - step 'the request is a valid session report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa"' - stored_requests.shift - start_up_message_removed = true - next - end - received = (stored_requests.size == request_count) - sleep 0.2 - end - raise "Requests not received in 10s (received #{stored_requests.size})" unless received - # Wait an extra second to ensure there are no further requests - sleep 1 - assert_equal(request_count, stored_requests.size, "#{stored_requests.size} requests received") -end - -Then(/^(\d+) requests? (?:was|were) received$/) do |request_count| - sleep 1 - assert_equal(request_count, stored_requests.size, "#{stored_requests.size} requests received") -end - -Then("the in-project frames of the stacktrace are:") do |table| - body = find_request(0)[:body] - stacktrace = body["events"][0]["exceptions"][0]["stacktrace"] - found = 0 # counts matching frames and ensures ordering is correct - expected = table.hashes.length - stacktrace.each do |frame| - if found < expected and frame["inProject"] and - frame["file"] == table.hashes[found]["file"] and - frame["method"] == table.hashes[found]["method"] - found = found + 1 - end - end - assert_equal(found, expected, "expected #{expected} matching frames but found #{found}. stacktrace:\n#{stacktrace}") -end - -Then("stack frame {int} contains a local function spanning {int} to {int}") do |frame, val, old_val| - # Old versions of Go put the line number on the end of the function - if ['1.7', '1.8'].include? ENV['GO_VERSION'] - step "the \"lineNumber\" of stack frame #{frame} equals #{old_val}" - else - step "the \"lineNumber\" of stack frame #{frame} equals #{val}" - end -end - -Then("the exception {string} is one of:") do |key, table| - body = find_request(0)[:body] - exception = body["events"][0]["exceptions"][0] - options = table.raw.flatten - assert(options.include?(exception[key]), "expected '#{key}' to be one of #{options}") -end diff --git a/features/synchronous.feature b/features/synchronous.feature deleted file mode 100644 index 0a132c48..00000000 --- a/features/synchronous.feature +++ /dev/null @@ -1,20 +0,0 @@ -Feature: Configuring synchronous flag - -Background: - Given I set environment variable "API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa" - And I set environment variable "AUTO_CAPTURE_SESSIONS" to "false" - And I configure the bugsnag endpoint - And I have built the service "app" - -Scenario: An error report is sent asynchrously but exits immediately so is not sent - Given I set environment variable "SYNCHRONOUS" to "false" - When I run the go service "app" with the test case "send-and-exit" - And I wait for 3 second - Then I should receive no requests - -Scenario: An error report is report synchronously so it will send before exiting - Given I set environment variable "SYNCHRONOUS" to "true" - When I run the go service "app" with the test case "send-and-exit" - Then I wait to receive 1 requests - And the request is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" - diff --git a/features/user.feature b/features/user.feature index 49040ac1..4cae7234 100644 --- a/features/user.feature +++ b/features/user.feature @@ -1,18 +1,9 @@ Feature: Sending user data -Background: - Given I set environment variable "API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa" - Given I set environment variable "AUTO_CAPTURE_SESSIONS" to "false" - And I configure the bugsnag endpoint - And I have built the service "app" - Scenario: An error report contains custom user data - Given I set environment variable "USER_ID" to "test-user-id" - And I set environment variable "USER_NAME" to "test-user-name" - And I set environment variable "USER_EMAIL" to "test-user-email" - When I run the go service "app" with the test case "user" - Then I wait to receive a request - And the request is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" + When I start the service "app" + And I run "SetUserScenario" + And I wait to receive an error And the event "user.id" equals "test-user-id" And the event "user.name" equals "test-user-name" - And the event "user.email" equals "test-user-email" + And the event "user.email" equals "test-user-email" \ No newline at end of file From 6ae818368099a40ea7323fd39360be415aa7c6c0 Mon Sep 17 00:00:00 2001 From: Daria Bialobrzeska Date: Tue, 20 Aug 2024 20:32:41 +0200 Subject: [PATCH 2/6] Rewrite nethttp features to new steps --- features/net-http/appversion.feature | 31 +++++++------- features/net-http/autocapturesessions.feature | 24 ----------- features/net-http/autonotify.feature | 27 +++++------- features/net-http/handled.feature | 42 +++++++++---------- features/net-http/onbeforenotify.feature | 20 ++++----- features/net-http/recover.feature | 18 +++----- features/net-http/releasestage.feature | 30 +++++++------ features/net-http/request.feature | 16 +++---- features/net-http/user.feature | 19 +++------ 9 files changed, 82 insertions(+), 145 deletions(-) delete mode 100644 features/net-http/autocapturesessions.feature diff --git a/features/net-http/appversion.feature b/features/net-http/appversion.feature index 06e9f61e..c7759362 100644 --- a/features/net-http/appversion.feature +++ b/features/net-http/appversion.feature @@ -1,28 +1,27 @@ Feature: Configuring app version Background: - Given I set environment variable "API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa" - And I configure the bugsnag endpoint - And I set environment variable "APP_VERSION" to "3.1.2" - And I set environment variable "SERVER_PORT" to "4512" + And I set environment variable "BUGSNAG_APP_VERSION" to "3.1.2" Scenario: A error report contains the configured app type when using a net http app - Given I set environment variable "AUTO_CAPTURE_SESSIONS" to "false" - When I start the service "nethttp" - And I wait for the app to open port "4512" + Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "false" + When I start the service "app" + And I run "HttpServerScenario" + And I wait for the host "localhost" to open port "4512" And I wait for 2 seconds And I open the URL "http://localhost:4512/handled" - Then I wait to receive a request - And the request is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" + And I wait to receive an error + And I should receive no sessions + And the error is valid for the error reporting API version "4" for the "Bugsnag Go" notifier And the event "app.version" equals "3.1.2" Scenario: A session report contains the configured app type when using a net http app - Given I set environment variable "AUTO_CAPTURE_SESSIONS" to "true" - When I start the service "nethttp" - And I wait for the app to open port "4512" + Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "true" + When I start the service "app" + And I run "HttpServerScenario" + And I wait for the host "localhost" to open port "4512" And I wait for 2 seconds And I open the URL "http://localhost:4512/session" - Then I wait to receive a request after the start up session - And the request is a valid session report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" - And the payload field "app.version" equals "3.1.2" - + And I wait to receive a session + And the session is valid for the session reporting API version "1.0" for the "Bugsnag Go" notifier + And the session payload field "sessions.0.app.version" equals "3.1.2" diff --git a/features/net-http/autocapturesessions.feature b/features/net-http/autocapturesessions.feature deleted file mode 100644 index b7f00bb4..00000000 --- a/features/net-http/autocapturesessions.feature +++ /dev/null @@ -1,24 +0,0 @@ -Feature: Configure auto capture sessions - -Background: - Given I set environment variable "API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa" - And I configure the bugsnag endpoint - And I set environment variable "SERVER_PORT" to "4512" - -Scenario: A session is not sent if auto capture sessions is off - Given I set environment variable "AUTO_CAPTURE_SESSIONS" to "false" - When I start the service "nethttp" - And I wait for the app to open port "4512" - And I wait for 2 seconds - And I open the URL "http://localhost:4512/session" - And I wait for 2 seconds - Then I should receive no requests - -Scenario: A session is sent if auto capture sessions is on - Given I set environment variable "AUTO_CAPTURE_SESSIONS" to "true" - When I start the service "nethttp" - And I wait for the app to open port "4512" - And I wait for 2 seconds - And I open the URL "http://localhost:4512/session" - Then I wait to receive a request after the start up session - And the request is a valid session report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" diff --git a/features/net-http/autonotify.feature b/features/net-http/autonotify.feature index baf4198c..997a741c 100644 --- a/features/net-http/autonotify.feature +++ b/features/net-http/autonotify.feature @@ -1,30 +1,25 @@ Feature: Using auto notify -Background: - Given I set environment variable "API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa" - And I configure the bugsnag endpoint - And I set environment variable "SERVER_PORT" to "4512" - Scenario: An error report is sent when an AutoNotified crash occurs which later gets recovered - Given I set environment variable "AUTO_CAPTURE_SESSIONS" to "false" - When I start the service "nethttp" - And I wait for the app to open port "4512" + Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "false" + When I start the service "app" + And I run "HttpServerScenario" + And I wait for the host "localhost" to open port "4512" And I wait for 2 seconds And I open the URL "http://localhost:4512/autonotify-then-recover" - Then I wait to receive a request - And the request is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" + Then I wait to receive an error And the event "unhandled" is true And the exception "errorClass" equals "*runtime.TypeAssertionError" And the exception "message" matches "interface conversion: interface ({} )?is struct {}, not string" Scenario: An error report is sent when a go routine crashes which is reported through auto notify - Given I set environment variable "AUTO_CAPTURE_SESSIONS" to "false" - When I start the service "nethttp" - And I wait for the app to open port "4512" + Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "false" + When I start the service "app" + And I run "HttpServerScenario" + And I wait for the host "localhost" to open port "4512" And I wait for 2 seconds And I open the URL "http://localhost:4512/autonotify" - Then I wait to receive a request - And the request is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" + Then I wait to receive an error And the event "unhandled" is true And the exception "errorClass" equals "*errors.errorString" - And the exception "message" equals "Go routine killed with auto notify" + And the exception "message" equals "Go routine killed with auto notify" \ No newline at end of file diff --git a/features/net-http/handled.feature b/features/net-http/handled.feature index 4c9eb4cc..f84dd335 100644 --- a/features/net-http/handled.feature +++ b/features/net-http/handled.feature @@ -1,35 +1,31 @@ Feature: Handled errors Background: - Given I set environment variable "API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa" - Given I set environment variable "BUGSNAG_SOURCE_ROOT" to the app directory - And I configure the bugsnag endpoint - And I set environment variable "SERVER_PORT" to "4512" - And I set environment variable "AUTO_CAPTURE_SESSIONS" to "false" + Given I set environment variable "BUGSNAG_SOURCE_ROOT" to "/app/src/features/fixtures/app/" Scenario: A handled error sends a report - When I start the service "nethttp" - And I wait for the app to open port "4512" + When I start the service "app" + And I run "HttpServerScenario" + And I wait for the host "localhost" to open port "4512" And I wait for 2 seconds And I open the URL "http://localhost:4512/handled" - Then I wait to receive a request - And the request 0 is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" - And the event "unhandled" is false for request 0 - And the event "severity" equals "warning" for request 0 - And the event "severityReason.type" equals "handledError" for request 0 - And the exception is a PathError for request 0 - And the "file" of stack frame 0 equals "main.go" for request 0 + Then I wait to receive an error + And the event "unhandled" is false + And the event "severity" equals "warning" + And the event "severityReason.type" equals "handledError" + And the exception "errorClass" equals "*os.PathError" + And the "file" of stack frame 0 equals "nethttp_scenario.go" Scenario: A handled error sends a report with a custom name Given I set environment variable "ERROR_CLASS" to "MyCustomErrorClass" - When I start the service "nethttp" - And I wait for the app to open port "4512" + When I start the service "app" + And I run "HttpServerScenario" + And I wait for the host "localhost" to open port "4512" And I wait for 2 seconds And I open the URL "http://localhost:4512/handled" - Then I wait to receive a request - And the request 0 is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" - And the event "unhandled" is false for request 0 - And the event "severity" equals "warning" for request 0 - And the event "severityReason.type" equals "handledError" for request 0 - And the exception "errorClass" equals "MyCustomErrorClass" for request 0 - And the "file" of stack frame 0 equals "main.go" for request 0 + Then I wait to receive an error + And the event "unhandled" is false + And the event "severity" equals "warning" + And the event "severityReason.type" equals "handledError" + And the exception "errorClass" equals "MyCustomErrorClass" + And the "file" of stack frame 0 equals "nethttp_scenario.go" \ No newline at end of file diff --git a/features/net-http/onbeforenotify.feature b/features/net-http/onbeforenotify.feature index d0b519c4..46c02412 100644 --- a/features/net-http/onbeforenotify.feature +++ b/features/net-http/onbeforenotify.feature @@ -1,18 +1,12 @@ Feature: Configuring on before notify -Background: - Given I set environment variable "API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa" - And I configure the bugsnag endpoint - And I set environment variable "SERVER_PORT" to "4512" - And I set environment variable "AUTO_CAPTURE_SESSIONS" to "false" - Scenario: Send three bugsnags and use on before notify to drop one and modify the message of another - When I start the service "nethttp" - And I wait for the app to open port "4512" + When I start the service "app" + And I run "HttpServerScenario" + And I wait for the host "localhost" to open port "4512" And I wait for 2 seconds And I open the URL "http://localhost:4512/onbeforenotify" - Then I wait to receive 2 requests - And the request 0 is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" - And the exception "message" equals "Don't ignore this error" for request 0 - And the request 1 is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" - And the exception "message" equals "Error message was changed" for request 1 + Then I wait to receive 2 errors + And the exception "message" equals "Don't ignore this error" + And I discard the oldest error + And the exception "message" equals "Error message was changed" \ No newline at end of file diff --git a/features/net-http/recover.feature b/features/net-http/recover.feature index 5f64d78b..d5f5f10c 100644 --- a/features/net-http/recover.feature +++ b/features/net-http/recover.feature @@ -1,17 +1,11 @@ Feature: Using recover -Background: - Given I set environment variable "API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa" - And I configure the bugsnag endpoint - And I set environment variable "SERVER_PORT" to "4512" - And I set environment variable "AUTO_CAPTURE_SESSIONS" to "false" - Scenario: An error report is sent when request crashes but is recovered - When I start the service "nethttp" - And I wait for the app to open port "4512" + When I start the service "app" + And I run "HttpServerScenario" + And I wait for the host "localhost" to open port "4512" And I wait for 2 seconds And I open the URL "http://localhost:4512/recover" - Then I wait to receive a request - And the request 0 is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" - And the exception "errorClass" equals "*errors.errorString" for request 0 - And the exception "message" equals "Request killed but recovered" for request 0 + Then I wait to receive an error + And the exception "errorClass" equals "*errors.errorString" + And the exception "message" equals "Request killed but recovered" \ No newline at end of file diff --git a/features/net-http/releasestage.feature b/features/net-http/releasestage.feature index e1b50169..17771eca 100644 --- a/features/net-http/releasestage.feature +++ b/features/net-http/releasestage.feature @@ -1,27 +1,25 @@ Feature: Configuring release stage Background: - Given I set environment variable "API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa" - And I configure the bugsnag endpoint - And I set environment variable "SERVER_PORT" to "4512" - And I set environment variable "RELEASE_STAGE" to "my-stage" + Given I set environment variable "BUGSNAG_RELEASE_STAGE" to "my-stage" Scenario: An error report is sent with configured release stage - Given I set environment variable "AUTO_CAPTURE_SESSIONS" to "false" - When I start the service "nethttp" - And I wait for the app to open port "4512" + Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "false" + When I start the service "app" + And I run "HttpServerScenario" + And I wait for the host "localhost" to open port "4512" And I wait for 2 seconds And I open the URL "http://localhost:4512/handled" - Then I wait to receive a request - And the request 0 is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" - And the event "app.releaseStage" equals "my-stage" for request 0 + Then I wait to receive an error + And the event "app.releaseStage" equals "my-stage" Scenario: A session report contains the configured app type - Given I set environment variable "AUTO_CAPTURE_SESSIONS" to "true" - When I start the service "nethttp" - And I wait for the app to open port "4512" + Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "true" + When I start the service "app" + And I run "HttpServerScenario" + And I wait for the host "localhost" to open port "4512" And I wait for 2 seconds And I open the URL "http://localhost:4512/session" - Then I wait to receive a request after the start up session - And the request is a valid session report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" - And the payload field "app.releaseStage" equals "my-stage" + Then I wait to receive a session + And I wait to receive an error + And the session payload field "sessions.0.app.releaseStage" equals "my-stage" \ No newline at end of file diff --git a/features/net-http/request.feature b/features/net-http/request.feature index ecf7f347..559db0c1 100644 --- a/features/net-http/request.feature +++ b/features/net-http/request.feature @@ -1,20 +1,14 @@ Feature: Capturing request information automatically -Background: - Given I set environment variable "API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa" - And I configure the bugsnag endpoint - And I set environment variable "SERVER_PORT" to "4512" - Scenario: An error report will automatically contain request information - Given I set environment variable "AUTO_CAPTURE_SESSIONS" to "false" - When I start the service "nethttp" - And I wait for the app to open port "4512" + When I start the service "app" + And I run "HttpServerScenario" + And I wait for the host "localhost" to open port "4512" And I wait for 2 seconds And I open the URL "http://localhost:4512/handled" - Then I wait to receive a request - And the request is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" + Then I wait to receive an error And the event "request.clientIp" is not null And the event "request.headers.User-Agent" equals "Ruby" And the event "request.httpMethod" equals "GET" And the event "request.url" ends with "/handled" - And the event "request.url" starts with "http://" + And the event "request.url" starts with "http://" \ No newline at end of file diff --git a/features/net-http/user.feature b/features/net-http/user.feature index dd03d9cd..c1c67c8b 100644 --- a/features/net-http/user.feature +++ b/features/net-http/user.feature @@ -1,21 +1,12 @@ Feature: Sending user data -Background: - Given I set environment variable "API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa" - And I configure the bugsnag endpoint - And I set environment variable "SERVER_PORT" to "4512" - And I set environment variable "AUTO_CAPTURE_SESSIONS" to "false" - Scenario: An error report contains custom user data - Given I set environment variable "USER_ID" to "test-user-id" - And I set environment variable "USER_NAME" to "test-user-name" - And I set environment variable "USER_EMAIL" to "test-user-email" - When I start the service "nethttp" - And I wait for the app to open port "4512" + When I start the service "app" + And I run "HttpServerScenario" + And I wait for the host "localhost" to open port "4512" And I wait for 2 seconds And I open the URL "http://localhost:4512/user" - Then I wait to receive a request - And the request is a valid error report with api key "a35a2a72bd230ac0aa0f52715bbdc6aa" + Then I wait to receive an error And the event "user.id" equals "test-user-id" And the event "user.name" equals "test-user-name" - And the event "user.email" equals "test-user-email" + And the event "user.email" equals "test-user-email" \ No newline at end of file From 97aa5f1c6ab8ea3777b4c47fc9ddd6e451164b9c Mon Sep 17 00:00:00 2001 From: Daria Bialobrzeska Date: Wed, 21 Aug 2024 13:20:21 +0200 Subject: [PATCH 3/6] Fix auto session value in tests - number instead of string --- features/apptype.feature | 4 ++-- features/appversion.feature | 4 ++-- features/autonotify.feature | 7 +++++-- features/configuration.feature | 1 - features/handled.feature | 4 ++-- features/hostname.feature | 4 ++-- features/metadata.feature | 2 +- features/multieventsession.feature | 2 +- features/net-http/appversion.feature | 8 +++----- features/net-http/autonotify.feature | 6 ++---- features/net-http/handled.feature | 2 -- features/net-http/onbeforenotify.feature | 1 - features/net-http/recover.feature | 1 - features/net-http/releasestage.feature | 9 +++------ features/net-http/request.feature | 1 - features/net-http/user.feature | 1 - features/plain_features/panics.feature | 2 +- features/releasestage.feature | 16 ++++++++-------- 18 files changed, 32 insertions(+), 43 deletions(-) diff --git a/features/apptype.feature b/features/apptype.feature index 0a48b079..0a408717 100644 --- a/features/apptype.feature +++ b/features/apptype.feature @@ -4,14 +4,14 @@ Background: Given I set environment variable "BUGSNAG_APP_TYPE" to "background-queue" Scenario: An error report contains the configured app type when running a go app - Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "false" + Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "0" When I start the service "app" And I run "HandledScenario" And I wait to receive an error And the event "app.type" equals "background-queue" Scenario: An session report contains the configured app type when running a go app - Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "true" + Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "1" When I start the service "app" And I run "SendSessionScenario" And I wait to receive a session diff --git a/features/appversion.feature b/features/appversion.feature index 1b66737c..ffda5546 100644 --- a/features/appversion.feature +++ b/features/appversion.feature @@ -4,14 +4,14 @@ Background: And I set environment variable "BUGSNAG_APP_VERSION" to "3.1.2" Scenario: An error report contains the configured app type when running a go app - Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "false" + Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "0" When I start the service "app" And I run "HandledScenario" And I wait to receive an error And the event "app.version" equals "3.1.2" Scenario: A session report contains the configured app type when running a go app - Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "true" + Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "1" When I start the service "app" And I run "SendSessionScenario" And I wait to receive a session diff --git a/features/autonotify.feature b/features/autonotify.feature index 62dc508a..5dad68f1 100644 --- a/features/autonotify.feature +++ b/features/autonotify.feature @@ -3,6 +3,9 @@ Feature: Using auto notify Scenario: An error report is sent when an AutoNotified crash occurs which later gets recovered When I start the service "app" And I run "AutonotifyPanicScenario" - And I wait to receive an error + And I wait to receive 2 errors And the exception "errorClass" equals "*errors.errorString" - And the exception "message" equals "Go routine killed with auto notify" \ No newline at end of file + And the exception "message" equals "Go routine killed with auto notify" + And I discard the oldest error + And the exception "errorClass" equals "panic" + And the exception "message" equals "Go routine killed with auto notify [recovered]" \ No newline at end of file diff --git a/features/configuration.feature b/features/configuration.feature index 6c3c1139..f5f58591 100644 --- a/features/configuration.feature +++ b/features/configuration.feature @@ -81,7 +81,6 @@ Feature: Configure integration with environment variables And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "0" When I start the service "app" And I run "AutoconfigPanicScenario" - And I wait for 2 seconds Then I should receive no errors Scenario: Enabling synchronous event delivery diff --git a/features/handled.feature b/features/handled.feature index 2a69b66e..2d524982 100644 --- a/features/handled.feature +++ b/features/handled.feature @@ -2,7 +2,7 @@ Feature: Plain handled errors Background: Given I set environment variable "BUGSNAG_SOURCE_ROOT" to "/app/src/features/fixtures/app/" - And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "false" + And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "0" Scenario: A handled error sends a report When I start the service "app" @@ -11,7 +11,7 @@ Scenario: A handled error sends a report And the event "unhandled" is false And the event "severity" equals "warning" And the event "severityReason.type" equals "handledError" - And the exception "errorClass" equals "*fs.PathError" + And the exception "errorClass" equals "*os.PathError" And the "file" of stack frame 0 equals "handled_scenario.go" Scenario: A handled error sends a report with a custom name diff --git a/features/hostname.feature b/features/hostname.feature index f05e7fef..29726e6c 100644 --- a/features/hostname.feature +++ b/features/hostname.feature @@ -2,7 +2,7 @@ Feature: Configuring hostname Scenario: An error report contains the configured hostname Given I set environment variable "BUGSNAG_HOSTNAME" to "server-1a" - And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "false" + And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "0" When I start the service "app" And I run "HandledScenario" And I wait to receive an error @@ -10,7 +10,7 @@ Scenario: An error report contains the configured hostname Scenario: An session report contains the configured hostname Given I set environment variable "BUGSNAG_HOSTNAME" to "server-1a" - And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "true" + And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "1" When I start the service "app" And I run "SendSessionScenario" And I wait to receive a session diff --git a/features/metadata.feature b/features/metadata.feature index a2995445..acdc1411 100644 --- a/features/metadata.feature +++ b/features/metadata.feature @@ -1,7 +1,7 @@ Feature: Sending meta data Scenario: An error report contains custom meta data - When I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "false" + When I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "0" And I start the service "app" And I run "MetadataScenario" And I wait to receive an error diff --git a/features/multieventsession.feature b/features/multieventsession.feature index 91478eba..aab87327 100644 --- a/features/multieventsession.feature +++ b/features/multieventsession.feature @@ -1,7 +1,7 @@ Feature: Reporting multiple handled and unhandled errors in the same session Background: - Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "false" + Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "0" Scenario: Handled errors know about previous reported handled errors When I start the service "app" diff --git a/features/net-http/appversion.feature b/features/net-http/appversion.feature index c7759362..c2d10ade 100644 --- a/features/net-http/appversion.feature +++ b/features/net-http/appversion.feature @@ -4,11 +4,10 @@ Background: And I set environment variable "BUGSNAG_APP_VERSION" to "3.1.2" Scenario: A error report contains the configured app type when using a net http app - Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "false" + Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "0" When I start the service "app" And I run "HttpServerScenario" And I wait for the host "localhost" to open port "4512" - And I wait for 2 seconds And I open the URL "http://localhost:4512/handled" And I wait to receive an error And I should receive no sessions @@ -16,12 +15,11 @@ Scenario: A error report contains the configured app type when using a net http And the event "app.version" equals "3.1.2" Scenario: A session report contains the configured app type when using a net http app - Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "true" + Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "1" When I start the service "app" And I run "HttpServerScenario" And I wait for the host "localhost" to open port "4512" - And I wait for 2 seconds And I open the URL "http://localhost:4512/session" And I wait to receive a session And the session is valid for the session reporting API version "1.0" for the "Bugsnag Go" notifier - And the session payload field "sessions.0.app.version" equals "3.1.2" + And the session payload field "app.version" equals "3.1.2" diff --git a/features/net-http/autonotify.feature b/features/net-http/autonotify.feature index 997a741c..cbea77d3 100644 --- a/features/net-http/autonotify.feature +++ b/features/net-http/autonotify.feature @@ -1,11 +1,10 @@ Feature: Using auto notify Scenario: An error report is sent when an AutoNotified crash occurs which later gets recovered - Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "false" + Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "0" When I start the service "app" And I run "HttpServerScenario" And I wait for the host "localhost" to open port "4512" - And I wait for 2 seconds And I open the URL "http://localhost:4512/autonotify-then-recover" Then I wait to receive an error And the event "unhandled" is true @@ -13,11 +12,10 @@ Scenario: An error report is sent when an AutoNotified crash occurs which later And the exception "message" matches "interface conversion: interface ({} )?is struct {}, not string" Scenario: An error report is sent when a go routine crashes which is reported through auto notify - Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "false" + Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "0" When I start the service "app" And I run "HttpServerScenario" And I wait for the host "localhost" to open port "4512" - And I wait for 2 seconds And I open the URL "http://localhost:4512/autonotify" Then I wait to receive an error And the event "unhandled" is true diff --git a/features/net-http/handled.feature b/features/net-http/handled.feature index f84dd335..70722556 100644 --- a/features/net-http/handled.feature +++ b/features/net-http/handled.feature @@ -7,7 +7,6 @@ Scenario: A handled error sends a report When I start the service "app" And I run "HttpServerScenario" And I wait for the host "localhost" to open port "4512" - And I wait for 2 seconds And I open the URL "http://localhost:4512/handled" Then I wait to receive an error And the event "unhandled" is false @@ -21,7 +20,6 @@ Scenario: A handled error sends a report with a custom name When I start the service "app" And I run "HttpServerScenario" And I wait for the host "localhost" to open port "4512" - And I wait for 2 seconds And I open the URL "http://localhost:4512/handled" Then I wait to receive an error And the event "unhandled" is false diff --git a/features/net-http/onbeforenotify.feature b/features/net-http/onbeforenotify.feature index 46c02412..15d58b22 100644 --- a/features/net-http/onbeforenotify.feature +++ b/features/net-http/onbeforenotify.feature @@ -4,7 +4,6 @@ Scenario: Send three bugsnags and use on before notify to drop one and modify th When I start the service "app" And I run "HttpServerScenario" And I wait for the host "localhost" to open port "4512" - And I wait for 2 seconds And I open the URL "http://localhost:4512/onbeforenotify" Then I wait to receive 2 errors And the exception "message" equals "Don't ignore this error" diff --git a/features/net-http/recover.feature b/features/net-http/recover.feature index d5f5f10c..8517bfda 100644 --- a/features/net-http/recover.feature +++ b/features/net-http/recover.feature @@ -4,7 +4,6 @@ Scenario: An error report is sent when request crashes but is recovered When I start the service "app" And I run "HttpServerScenario" And I wait for the host "localhost" to open port "4512" - And I wait for 2 seconds And I open the URL "http://localhost:4512/recover" Then I wait to receive an error And the exception "errorClass" equals "*errors.errorString" diff --git a/features/net-http/releasestage.feature b/features/net-http/releasestage.feature index 17771eca..f303c765 100644 --- a/features/net-http/releasestage.feature +++ b/features/net-http/releasestage.feature @@ -4,22 +4,19 @@ Background: Given I set environment variable "BUGSNAG_RELEASE_STAGE" to "my-stage" Scenario: An error report is sent with configured release stage - Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "false" + Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "0" When I start the service "app" And I run "HttpServerScenario" And I wait for the host "localhost" to open port "4512" - And I wait for 2 seconds And I open the URL "http://localhost:4512/handled" Then I wait to receive an error And the event "app.releaseStage" equals "my-stage" Scenario: A session report contains the configured app type - Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "true" + Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "1" When I start the service "app" And I run "HttpServerScenario" And I wait for the host "localhost" to open port "4512" - And I wait for 2 seconds And I open the URL "http://localhost:4512/session" Then I wait to receive a session - And I wait to receive an error - And the session payload field "sessions.0.app.releaseStage" equals "my-stage" \ No newline at end of file + And the session payload field "app.releaseStage" equals "my-stage" \ No newline at end of file diff --git a/features/net-http/request.feature b/features/net-http/request.feature index 559db0c1..b6d4067d 100644 --- a/features/net-http/request.feature +++ b/features/net-http/request.feature @@ -4,7 +4,6 @@ Scenario: An error report will automatically contain request information When I start the service "app" And I run "HttpServerScenario" And I wait for the host "localhost" to open port "4512" - And I wait for 2 seconds And I open the URL "http://localhost:4512/handled" Then I wait to receive an error And the event "request.clientIp" is not null diff --git a/features/net-http/user.feature b/features/net-http/user.feature index c1c67c8b..78468002 100644 --- a/features/net-http/user.feature +++ b/features/net-http/user.feature @@ -4,7 +4,6 @@ Scenario: An error report contains custom user data When I start the service "app" And I run "HttpServerScenario" And I wait for the host "localhost" to open port "4512" - And I wait for 2 seconds And I open the URL "http://localhost:4512/user" Then I wait to receive an error And the event "user.id" equals "test-user-id" diff --git a/features/plain_features/panics.feature b/features/plain_features/panics.feature index 6e9e3174..2a9c52eb 100644 --- a/features/plain_features/panics.feature +++ b/features/plain_features/panics.feature @@ -2,7 +2,7 @@ Feature: Panic handling Background: Given I set environment variable "BUGSNAG_SOURCE_ROOT" to "/app/src/features/fixtures/app/" - And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "false" + And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "0" Scenario: Capturing a panic When I start the service "app" diff --git a/features/releasestage.feature b/features/releasestage.feature index e5dd56c8..dfcbb4c6 100644 --- a/features/releasestage.feature +++ b/features/releasestage.feature @@ -2,7 +2,7 @@ Feature: Configuring release stages and notify release stages Scenario: An error report is sent when release stage matches notify release stages Given I set environment variable "BUGSNAG_NOTIFY_RELEASE_STAGES" to "stage1,stage2,stage3" - And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "false" + And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "0" And I set environment variable "BUGSNAG_RELEASE_STAGE" to "stage2" When I start the service "app" And I run "HandledScenario" @@ -11,7 +11,7 @@ Scenario: An error report is sent when release stage matches notify release stag Scenario: An error report is sent when no notify release stages are specified Given I set environment variable "BUGSNAG_RELEASE_STAGE" to "stage2" - And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "false" + And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "0" When I start the service "app" And I run "HandledScenario" And I wait to receive an error @@ -19,14 +19,14 @@ Scenario: An error report is sent when no notify release stages are specified Scenario: An error report is sent regardless of notify release stages if release stage is not set Given I set environment variable "BUGSNAG_NOTIFY_RELEASE_STAGES" to "stage1,stage2,stage3" - And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "false" + And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "0" When I start the service "app" And I run "HandledScenario" And I wait to receive an error Scenario: An error report is not sent if the release stage does not match the notify release stages Given I set environment variable "BUGSNAG_NOTIFY_RELEASE_STAGES" to "stage1,stage2,stage3" - And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "false" + And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "0" And I set environment variable "BUGSNAG_RELEASE_STAGE" to "stage4" When I start the service "app" And I run "HandledScenario" @@ -34,7 +34,7 @@ Scenario: An error report is not sent if the release stage does not match the no Scenario: An session report is sent when release stage matches notify release stages Given I set environment variable "BUGSNAG_NOTIFY_RELEASE_STAGES" to "stage1,stage2,stage3" - And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "true" + And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "1" And I set environment variable "BUGSNAG_RELEASE_STAGE" to "stage2" When I start the service "app" And I run "SendSessionScenario" @@ -43,7 +43,7 @@ Scenario: An session report is sent when release stage matches notify release st Scenario: An session report is sent when no notify release stages are specified Given I set environment variable "BUGSNAG_RELEASE_STAGE" to "stage2" - And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "true" + And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "1" When I start the service "app" And I run "SendSessionScenario" And I wait to receive a session @@ -51,14 +51,14 @@ Scenario: An session report is sent when no notify release stages are specified Scenario: An session report is sent regardless of notify release stages if release stage is not set Given I set environment variable "BUGSNAG_NOTIFY_RELEASE_STAGES" to "stage1,stage2,stage3" - And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "true" + And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "1" When I start the service "app" And I run "SendSessionScenario" And I wait to receive a session Scenario: An session report is not sent if the release stage does not match the notify release stages Given I set environment variable "BUGSNAG_NOTIFY_RELEASE_STAGES" to "stage1,stage2,stage3" - And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "true" + And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "1" And I set environment variable "BUGSNAG_RELEASE_STAGE" to "stage4" When I start the service "app" And I run "SendSessionScenario" From 41c675e98c93b6e31a21cf729ad7287677c2b1b0 Mon Sep 17 00:00:00 2001 From: Daria Bialobrzeska Date: Wed, 21 Aug 2024 14:40:18 +0200 Subject: [PATCH 4/6] Consider startup session in session count in tests --- features/apptype.feature | 2 +- features/appversion.feature | 2 +- features/handled.feature | 2 +- features/hostname.feature | 4 ++-- features/multieventsession.feature | 10 ++++++---- features/net-http/handled.feature | 2 +- features/releasestage.feature | 14 +++++++------- features/steps/go_steps.rb | 9 +++++++++ 8 files changed, 28 insertions(+), 17 deletions(-) diff --git a/features/apptype.feature b/features/apptype.feature index 0a408717..a454b67a 100644 --- a/features/apptype.feature +++ b/features/apptype.feature @@ -14,5 +14,5 @@ Scenario: An session report contains the configured app type when running a go a Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "1" When I start the service "app" And I run "SendSessionScenario" - And I wait to receive a session + And I wait to receive 2 sessions And the session payload field "app.type" equals "background-queue" diff --git a/features/appversion.feature b/features/appversion.feature index ffda5546..e5dfaf51 100644 --- a/features/appversion.feature +++ b/features/appversion.feature @@ -14,5 +14,5 @@ Scenario: A session report contains the configured app type when running a go ap Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "1" When I start the service "app" And I run "SendSessionScenario" - And I wait to receive a session + And I wait to receive 2 sessions And the session payload field "app.version" equals "3.1.2" \ No newline at end of file diff --git a/features/handled.feature b/features/handled.feature index 2d524982..7415b7b4 100644 --- a/features/handled.feature +++ b/features/handled.feature @@ -11,7 +11,7 @@ Scenario: A handled error sends a report And the event "unhandled" is false And the event "severity" equals "warning" And the event "severityReason.type" equals "handledError" - And the exception "errorClass" equals "*os.PathError" + And the exception "errorClass" matches "\*os.PathError|\*fs.PathError" And the "file" of stack frame 0 equals "handled_scenario.go" Scenario: A handled error sends a report with a custom name diff --git a/features/hostname.feature b/features/hostname.feature index 29726e6c..ccd3fcb8 100644 --- a/features/hostname.feature +++ b/features/hostname.feature @@ -8,10 +8,10 @@ Scenario: An error report contains the configured hostname And I wait to receive an error And the event "device.hostname" equals "server-1a" -Scenario: An session report contains the configured hostname +Scenario: A session report contains the configured hostname Given I set environment variable "BUGSNAG_HOSTNAME" to "server-1a" And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "1" When I start the service "app" And I run "SendSessionScenario" - And I wait to receive a session + And I wait to receive 2 sessions And the session payload field "device.hostname" equals "server-1a" \ No newline at end of file diff --git a/features/multieventsession.feature b/features/multieventsession.feature index aab87327..46461dfb 100644 --- a/features/multieventsession.feature +++ b/features/multieventsession.feature @@ -7,12 +7,14 @@ Scenario: Handled errors know about previous reported handled errors When I start the service "app" And I run "MultipleHandledScenario" And I wait to receive 2 errors - And the event handled sessions count equals 1 for request 0 - And the event handled sessions count equals 2 for request 1 + And the event handled sessions count equals 1 + And I discard the oldest error + And the event handled sessions count equals 2 Scenario: Unhandled errors know about previous reported handled errors When I start the service "app" And I run "MultipleUnhandledScenario" And I wait to receive 2 errors - And the event unhandled sessions count equals 1 for request 0 - And the event unhandled sessions count equals 2 for request 1 \ No newline at end of file + And the event unhandled sessions count equals 1 + And I discard the oldest error + And the event unhandled sessions count equals 2 \ No newline at end of file diff --git a/features/net-http/handled.feature b/features/net-http/handled.feature index 70722556..c450db0d 100644 --- a/features/net-http/handled.feature +++ b/features/net-http/handled.feature @@ -12,7 +12,7 @@ Scenario: A handled error sends a report And the event "unhandled" is false And the event "severity" equals "warning" And the event "severityReason.type" equals "handledError" - And the exception "errorClass" equals "*os.PathError" + And the exception "errorClass" matches "\*os.PathError|\*fs.PathError" And the "file" of stack frame 0 equals "nethttp_scenario.go" Scenario: A handled error sends a report with a custom name diff --git a/features/releasestage.feature b/features/releasestage.feature index dfcbb4c6..3aa11d87 100644 --- a/features/releasestage.feature +++ b/features/releasestage.feature @@ -32,31 +32,31 @@ Scenario: An error report is not sent if the release stage does not match the no And I run "HandledScenario" And I should receive no errors -Scenario: An session report is sent when release stage matches notify release stages +Scenario: A session report is sent when release stage matches notify release stages Given I set environment variable "BUGSNAG_NOTIFY_RELEASE_STAGES" to "stage1,stage2,stage3" And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "1" And I set environment variable "BUGSNAG_RELEASE_STAGE" to "stage2" When I start the service "app" And I run "SendSessionScenario" - And I wait to receive a session + And I wait to receive 2 sessions And the session payload field "app.releaseStage" equals "stage2" -Scenario: An session report is sent when no notify release stages are specified +Scenario: A session report is sent when no notify release stages are specified Given I set environment variable "BUGSNAG_RELEASE_STAGE" to "stage2" And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "1" When I start the service "app" And I run "SendSessionScenario" - And I wait to receive a session + And I wait to receive 2 sessions And the session payload field "app.releaseStage" equals "stage2" -Scenario: An session report is sent regardless of notify release stages if release stage is not set +Scenario: A session report is sent regardless of notify release stages if release stage is not set Given I set environment variable "BUGSNAG_NOTIFY_RELEASE_STAGES" to "stage1,stage2,stage3" And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "1" When I start the service "app" And I run "SendSessionScenario" - And I wait to receive a session + And I wait to receive 2 sessions -Scenario: An session report is not sent if the release stage does not match the notify release stages +Scenario: A session report is not sent if the release stage does not match the notify release stages Given I set environment variable "BUGSNAG_NOTIFY_RELEASE_STAGES" to "stage1,stage2,stage3" And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "1" And I set environment variable "BUGSNAG_RELEASE_STAGE" to "stage4" diff --git a/features/steps/go_steps.rb b/features/steps/go_steps.rb index cdc1678f..b8d5e398 100644 --- a/features/steps/go_steps.rb +++ b/features/steps/go_steps.rb @@ -11,6 +11,15 @@ ) end +Then('the event unhandled sessions count equals {int}') do |count| + step "the error payload field \"events.0.session.events.unhandled\" equals #{count}" +end + +Then('the event handled sessions count equals {int}') do |count| + step "the error payload field \"events.0.session.events.handled\" equals #{count}" +end + + def execute_command(action, scenario_name = '') address = $address ? $address : "#{local_ip}:9339" From 54313af48b0af34326a12874d865e757f120d409 Mon Sep 17 00:00:00 2001 From: Daria Bialobrzeska Date: Wed, 21 Aug 2024 14:43:13 +0200 Subject: [PATCH 5/6] Unify scenario names with scenario func names --- features/apptype.feature | 2 +- features/appversion.feature | 2 +- features/fixtures/app/main.go | 38 +++++++++++++------------- features/handled.feature | 6 ++-- features/hostname.feature | 2 +- features/multieventsession.feature | 4 +-- features/plain_features/panics.feature | 2 +- features/releasestage.feature | 8 +++--- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/features/apptype.feature b/features/apptype.feature index a454b67a..26ec346f 100644 --- a/features/apptype.feature +++ b/features/apptype.feature @@ -6,7 +6,7 @@ Background: Scenario: An error report contains the configured app type when running a go app Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "0" When I start the service "app" - And I run "HandledScenario" + And I run "HandledErrorScenario" And I wait to receive an error And the event "app.type" equals "background-queue" diff --git a/features/appversion.feature b/features/appversion.feature index e5dfaf51..c08916ef 100644 --- a/features/appversion.feature +++ b/features/appversion.feature @@ -6,7 +6,7 @@ Background: Scenario: An error report contains the configured app type when running a go app Given I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "0" When I start the service "app" - And I run "HandledScenario" + And I run "HandledErrorScenario" And I wait to receive an error And the event "app.version" equals "3.1.2" diff --git a/features/fixtures/app/main.go b/features/fixtures/app/main.go index 7332a1a0..a86e4ce4 100644 --- a/features/fixtures/app/main.go +++ b/features/fixtures/app/main.go @@ -9,25 +9,25 @@ import ( ) var scenariosMap = map[string]func(Command) func(){ - "UnhandledScenario": UnhandledCrashScenario, - "HandledScenario": HandledErrorScenario, - "MultipleUnhandledScenario": MultipleUnhandledErrorsScenario, - "MultipleHandledScenario": MultipleHandledErrorsScenario, - "NestedErrorScenario": NestedHandledErrorScenario, - "MetadataScenario": MetadataScenario, - "FilteredMetadataScenario": FilteredMetadataScenario, - "HandledCallbackErrorScenario": HandledCallbackErrorScenario, - "SendSessionScenario": SendSessionScenario, - "HandledToUnhandledScenario": HandledToUnhandledScenario, - "SetUserScenario": SetUserScenario, - "RecoverAfterPanicScenario": RecoverAfterPanicScenario, - "AutonotifyPanicScenario": AutonotifyPanicScenario, - "SessionAndErrorScenario": SessionAndErrorScenario, - "OnBeforeNotifyScenario": OnBeforeNotifyScenario, - "AutoconfigPanicScenario": AutoconfigPanicScenario, - "AutoconfigHandledScenario": AutoconfigHandledScenario, - "AutoconfigMetadataScenario": AutoconfigMetadataScenario, - "HttpServerScenario": HttpServerScenario, + "UnhandledCrashScenario": UnhandledCrashScenario, + "HandledErrorScenario": HandledErrorScenario, + "MultipleUnhandledErrorsScenario": MultipleUnhandledErrorsScenario, + "MultipleHandledErrorsScenario": MultipleHandledErrorsScenario, + "NestedHandledErrorScenario": NestedHandledErrorScenario, + "MetadataScenario": MetadataScenario, + "FilteredMetadataScenario": FilteredMetadataScenario, + "HandledCallbackErrorScenario": HandledCallbackErrorScenario, + "SendSessionScenario": SendSessionScenario, + "HandledToUnhandledScenario": HandledToUnhandledScenario, + "SetUserScenario": SetUserScenario, + "RecoverAfterPanicScenario": RecoverAfterPanicScenario, + "AutonotifyPanicScenario": AutonotifyPanicScenario, + "SessionAndErrorScenario": SessionAndErrorScenario, + "OnBeforeNotifyScenario": OnBeforeNotifyScenario, + "AutoconfigPanicScenario": AutoconfigPanicScenario, + "AutoconfigHandledScenario": AutoconfigHandledScenario, + "AutoconfigMetadataScenario": AutoconfigMetadataScenario, + "HttpServerScenario": HttpServerScenario, } func main() { diff --git a/features/handled.feature b/features/handled.feature index 7415b7b4..c5b98cdf 100644 --- a/features/handled.feature +++ b/features/handled.feature @@ -6,7 +6,7 @@ Background: Scenario: A handled error sends a report When I start the service "app" - And I run "HandledScenario" + And I run "HandledErrorScenario" And I wait to receive an error And the event "unhandled" is false And the event "severity" equals "warning" @@ -17,7 +17,7 @@ Scenario: A handled error sends a report Scenario: A handled error sends a report with a custom name Given I set environment variable "ERROR_CLASS" to "MyCustomErrorClass" When I start the service "app" - And I run "HandledScenario" + And I run "HandledErrorScenario" And I wait to receive an error And the event "unhandled" is false And the event "severity" equals "warning" @@ -51,7 +51,7 @@ Scenario: Marking an error as unhandled in a callback Scenario: Unwrapping the causes of a handled error When I start the service "app" - And I run "NestedErrorScenario" + And I run "NestedHandledErrorScenario" And I wait to receive an error And the event "unhandled" is false And the event "severity" equals "warning" diff --git a/features/hostname.feature b/features/hostname.feature index ccd3fcb8..ddd44368 100644 --- a/features/hostname.feature +++ b/features/hostname.feature @@ -4,7 +4,7 @@ Scenario: An error report contains the configured hostname Given I set environment variable "BUGSNAG_HOSTNAME" to "server-1a" And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "0" When I start the service "app" - And I run "HandledScenario" + And I run "HandledErrorScenario" And I wait to receive an error And the event "device.hostname" equals "server-1a" diff --git a/features/multieventsession.feature b/features/multieventsession.feature index 46461dfb..bb9039dc 100644 --- a/features/multieventsession.feature +++ b/features/multieventsession.feature @@ -5,7 +5,7 @@ Background: Scenario: Handled errors know about previous reported handled errors When I start the service "app" - And I run "MultipleHandledScenario" + And I run "MultipleHandledErrorsScenario" And I wait to receive 2 errors And the event handled sessions count equals 1 And I discard the oldest error @@ -13,7 +13,7 @@ Scenario: Handled errors know about previous reported handled errors Scenario: Unhandled errors know about previous reported handled errors When I start the service "app" - And I run "MultipleUnhandledScenario" + And I run "MultipleUnhandledErrorsScenario" And I wait to receive 2 errors And the event unhandled sessions count equals 1 And I discard the oldest error diff --git a/features/plain_features/panics.feature b/features/plain_features/panics.feature index 2a9c52eb..691a007e 100644 --- a/features/plain_features/panics.feature +++ b/features/plain_features/panics.feature @@ -6,7 +6,7 @@ Feature: Panic handling Scenario: Capturing a panic When I start the service "app" - And I run "UnhandledScenario" + And I run "UnhandledCrashScenario" And I wait to receive an error And the event "unhandled" is true And the event "severity" equals "error" diff --git a/features/releasestage.feature b/features/releasestage.feature index 3aa11d87..2652b0c5 100644 --- a/features/releasestage.feature +++ b/features/releasestage.feature @@ -5,7 +5,7 @@ Scenario: An error report is sent when release stage matches notify release stag And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "0" And I set environment variable "BUGSNAG_RELEASE_STAGE" to "stage2" When I start the service "app" - And I run "HandledScenario" + And I run "HandledErrorScenario" And I wait to receive an error And the event "app.releaseStage" equals "stage2" @@ -13,7 +13,7 @@ Scenario: An error report is sent when no notify release stages are specified Given I set environment variable "BUGSNAG_RELEASE_STAGE" to "stage2" And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "0" When I start the service "app" - And I run "HandledScenario" + And I run "HandledErrorScenario" And I wait to receive an error And the event "app.releaseStage" equals "stage2" @@ -21,7 +21,7 @@ Scenario: An error report is sent regardless of notify release stages if release Given I set environment variable "BUGSNAG_NOTIFY_RELEASE_STAGES" to "stage1,stage2,stage3" And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "0" When I start the service "app" - And I run "HandledScenario" + And I run "HandledErrorScenario" And I wait to receive an error Scenario: An error report is not sent if the release stage does not match the notify release stages @@ -29,7 +29,7 @@ Scenario: An error report is not sent if the release stage does not match the no And I set environment variable "BUGSNAG_AUTO_CAPTURE_SESSIONS" to "0" And I set environment variable "BUGSNAG_RELEASE_STAGE" to "stage4" When I start the service "app" - And I run "HandledScenario" + And I run "HandledErrorScenario" And I should receive no errors Scenario: A session report is sent when release stage matches notify release stages From f4ca7ebf30017e0582bb0ecc08606a3bd5e3a108 Mon Sep 17 00:00:00 2001 From: Daria Bialobrzeska Date: Wed, 21 Aug 2024 14:43:44 +0200 Subject: [PATCH 6/6] Enable ubuntu tests in CI --- .github/workflows/test-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-package.yml b/.github/workflows/test-package.yml index d51eec2a..392fda7c 100644 --- a/.github/workflows/test-package.yml +++ b/.github/workflows/test-package.yml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - os: [windows] + os: [ubuntu, windows] go-version: ['1.11', '1.12', '1.13', '1.14', '1.15', '1.16', '1.17', '1.18', '1.19', '1.20', '1.21', '1.22'] steps: