-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite features steps to newer version, add command pattern
- Loading branch information
1 parent
245bce0
commit 11cbd89
Showing
34 changed files
with
777 additions
and
723 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner', branch: 'v1' | ||
gem "bugsnag-maze-runner", "~> 9.9" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,155 @@ | ||
GIT | ||
remote: https://github.com/bugsnag/maze-runner | ||
revision: 7377529a77eb7585afc66cd2080fcdc4eea3306a | ||
branch: v1 | ||
specs: | ||
bugsnag-maze-runner (1.1.0) | ||
cucumber (~> 3.1.0) | ||
cucumber-expressions (= 5.0.15) | ||
minitest (~> 5.0) | ||
os (~> 1.0.0) | ||
rack (~> 2.0.0) | ||
rake (~> 12.3.3) | ||
test-unit (~> 3.2.0) | ||
|
||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
backports (3.21.0) | ||
builder (3.2.4) | ||
cucumber (3.1.0) | ||
builder (>= 2.1.2) | ||
cucumber-core (~> 3.1.0) | ||
cucumber-expressions (~> 5.0.4) | ||
cucumber-wire (~> 0.0.1) | ||
diff-lcs (~> 1.3) | ||
gherkin (~> 5.0) | ||
multi_json (>= 1.7.5, < 2.0) | ||
multi_test (>= 0.1.2) | ||
cucumber-core (3.1.0) | ||
backports (>= 3.8.0) | ||
cucumber-tag_expressions (~> 1.1.0) | ||
gherkin (>= 5.0.0) | ||
cucumber-expressions (5.0.15) | ||
cucumber-tag_expressions (1.1.1) | ||
cucumber-wire (0.0.1) | ||
diff-lcs (1.4.4) | ||
gherkin (5.1.0) | ||
minitest (5.14.4) | ||
multi_json (1.15.0) | ||
appium_lib (12.0.1) | ||
appium_lib_core (~> 5.0) | ||
nokogiri (~> 1.8, >= 1.8.1) | ||
tomlrb (>= 1.1, < 3.0) | ||
appium_lib_core (5.4.0) | ||
faye-websocket (~> 0.11.0) | ||
selenium-webdriver (~> 4.2, < 4.6) | ||
bugsnag (6.27.1) | ||
concurrent-ruby (~> 1.0) | ||
bugsnag-maze-runner (9.12.0) | ||
appium_lib (~> 12.0.0) | ||
appium_lib_core (~> 5.4.0) | ||
bugsnag (~> 6.24) | ||
cucumber (~> 7.1) | ||
cucumber-expressions (~> 6.0.0) | ||
curb (~> 1.0.5) | ||
dogstatsd-ruby (~> 5.5.0) | ||
json_schemer (~> 0.2.24) | ||
optimist (~> 3.0.1) | ||
os (~> 1.0.0) | ||
rack (~> 2.2) | ||
rake (~> 12.3.3) | ||
rubyzip (~> 2.3.2) | ||
selenium-webdriver (~> 4.0) | ||
test-unit (~> 3.5.2) | ||
webrick (~> 1.7.0) | ||
builder (3.3.0) | ||
childprocess (4.1.0) | ||
concurrent-ruby (1.3.3) | ||
cucumber (7.1.0) | ||
builder (~> 3.2, >= 3.2.4) | ||
cucumber-core (~> 10.1, >= 10.1.0) | ||
cucumber-create-meta (~> 6.0, >= 6.0.1) | ||
cucumber-cucumber-expressions (~> 14.0, >= 14.0.0) | ||
cucumber-gherkin (~> 22.0, >= 22.0.0) | ||
cucumber-html-formatter (~> 17.0, >= 17.0.0) | ||
cucumber-messages (~> 17.1, >= 17.1.1) | ||
cucumber-wire (~> 6.2, >= 6.2.0) | ||
diff-lcs (~> 1.4, >= 1.4.4) | ||
mime-types (~> 3.3, >= 3.3.1) | ||
multi_test (~> 0.1, >= 0.1.2) | ||
sys-uname (~> 1.2, >= 1.2.2) | ||
cucumber-core (10.1.1) | ||
cucumber-gherkin (~> 22.0, >= 22.0.0) | ||
cucumber-messages (~> 17.1, >= 17.1.1) | ||
cucumber-tag-expressions (~> 4.1, >= 4.1.0) | ||
cucumber-create-meta (6.0.4) | ||
cucumber-messages (~> 17.1, >= 17.1.1) | ||
sys-uname (~> 1.2, >= 1.2.2) | ||
cucumber-cucumber-expressions (14.0.0) | ||
cucumber-expressions (6.0.1) | ||
cucumber-gherkin (22.0.0) | ||
cucumber-messages (~> 17.1, >= 17.1.1) | ||
cucumber-html-formatter (17.0.0) | ||
cucumber-messages (~> 17.1, >= 17.1.0) | ||
cucumber-messages (17.1.1) | ||
cucumber-tag-expressions (4.1.0) | ||
cucumber-wire (6.2.1) | ||
cucumber-core (~> 10.1, >= 10.1.0) | ||
cucumber-cucumber-expressions (~> 14.0, >= 14.0.0) | ||
curb (1.0.5) | ||
diff-lcs (1.5.1) | ||
dogstatsd-ruby (5.5.0) | ||
ecma-re-validator (0.4.0) | ||
regexp_parser (~> 2.2) | ||
eventmachine (1.2.7) | ||
faye-websocket (0.11.3) | ||
eventmachine (>= 0.12.0) | ||
websocket-driver (>= 0.5.1) | ||
ffi (1.17.0-aarch64-linux-gnu) | ||
ffi (1.17.0-aarch64-linux-musl) | ||
ffi (1.17.0-arm-linux-gnu) | ||
ffi (1.17.0-arm-linux-musl) | ||
ffi (1.17.0-arm64-darwin) | ||
ffi (1.17.0-x86-linux-gnu) | ||
ffi (1.17.0-x86-linux-musl) | ||
ffi (1.17.0-x86_64-darwin) | ||
ffi (1.17.0-x86_64-linux-gnu) | ||
ffi (1.17.0-x86_64-linux-musl) | ||
hana (1.3.7) | ||
json_schemer (0.2.25) | ||
ecma-re-validator (~> 0.3) | ||
hana (~> 1.3) | ||
regexp_parser (~> 2.0) | ||
simpleidn (~> 0.2) | ||
uri_template (~> 0.7) | ||
mime-types (3.5.2) | ||
mime-types-data (~> 3.2015) | ||
mime-types-data (3.2024.0806) | ||
multi_test (0.1.2) | ||
nokogiri (1.16.7-aarch64-linux) | ||
racc (~> 1.4) | ||
nokogiri (1.16.7-arm-linux) | ||
racc (~> 1.4) | ||
nokogiri (1.16.7-arm64-darwin) | ||
racc (~> 1.4) | ||
nokogiri (1.16.7-x86-linux) | ||
racc (~> 1.4) | ||
nokogiri (1.16.7-x86_64-darwin) | ||
racc (~> 1.4) | ||
nokogiri (1.16.7-x86_64-linux) | ||
racc (~> 1.4) | ||
optimist (3.0.1) | ||
os (1.0.1) | ||
power_assert (2.0.0) | ||
rack (2.0.9.3) | ||
power_assert (2.0.3) | ||
racc (1.8.1) | ||
rack (2.2.9) | ||
rake (12.3.3) | ||
test-unit (3.2.9) | ||
regexp_parser (2.9.2) | ||
rexml (3.3.4) | ||
strscan | ||
rubyzip (2.3.2) | ||
selenium-webdriver (4.5.0) | ||
childprocess (>= 0.5, < 5.0) | ||
rexml (~> 3.2, >= 3.2.5) | ||
rubyzip (>= 1.2.2, < 3.0) | ||
websocket (~> 1.0) | ||
simpleidn (0.2.3) | ||
strscan (3.1.0) | ||
sys-uname (1.3.0) | ||
ffi (~> 1.1) | ||
test-unit (3.5.9) | ||
power_assert | ||
tomlrb (2.0.3) | ||
uri_template (0.7.0) | ||
webrick (1.7.0) | ||
websocket (1.2.11) | ||
websocket-driver (0.7.6) | ||
websocket-extensions (>= 0.1.0) | ||
websocket-extensions (0.1.5) | ||
|
||
PLATFORMS | ||
ruby | ||
aarch64-linux | ||
aarch64-linux-gnu | ||
aarch64-linux-musl | ||
arm-linux | ||
arm-linux-gnu | ||
arm-linux-musl | ||
arm64-darwin | ||
x86-linux | ||
x86-linux-gnu | ||
x86-linux-musl | ||
x86_64-darwin | ||
x86_64-linux | ||
x86_64-linux-gnu | ||
x86_64-linux-musl | ||
|
||
DEPENDENCIES | ||
bugsnag-maze-runner! | ||
bugsnag-maze-runner (~> 9.9) | ||
|
||
BUNDLED WITH | ||
2.1.4 | ||
2.5.17 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 "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" | ||
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" | ||
|
||
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
|
||
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" | ||
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 | ||
Scenario: A 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" | ||
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 "Error" | ||
And the exception "message" equals "Go routine killed with auto notify" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package main | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
"net/http" | ||
"time" | ||
) | ||
|
||
const DEFAULT_MAZE_ADDRESS = "http://localhost:9339" | ||
|
||
type Command struct { | ||
Action string `json:"action,omitempty"` | ||
ScenarioName string `json:"scenario_name,omitempty"` | ||
APIKey string `json:"api_key,omitempty"` | ||
NotifyEndpoint string `json:"notify_endpoint,omitempty"` | ||
SessionsEndpoint string `json:"sessions_endpoint,omitempty"` | ||
UUID string `json:"uuid,omitempty"` | ||
RunUUID string `json:"run_uuid,omitempty"` | ||
} | ||
|
||
func GetCommand(mazeAddress string) Command { | ||
var command Command | ||
mazeURL := fmt.Sprintf("%+v/command", mazeAddress) | ||
client := http.Client{Timeout: 2 * time.Second} | ||
res, err := client.Get(mazeURL) | ||
if err != nil { | ||
fmt.Printf("[Bugsnag] Error while receiving command: %+v\n", err) | ||
return command | ||
} | ||
|
||
if res != nil { | ||
err = json.NewDecoder(res.Body).Decode(&command) | ||
res.Body.Close() | ||
if err != nil { | ||
fmt.Printf("[Bugsnag] Error while decoding command: %+v\n", err) | ||
return command | ||
} | ||
} | ||
|
||
return command | ||
} |
Oops, something went wrong.