Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
188 additions
and
37 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
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
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
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,25 @@ | ||
#!/usr/bin/env bash | ||
|
||
# SIGTERM or SIGINT trapped (likely SIGTERM from docker), pass it onto app | ||
# process | ||
function _term_or_init { | ||
kill -TERM "$APP_PID" 2>/dev/null | ||
wait $APP_PID | ||
} | ||
|
||
# The bugsnag notifier monitor process needs at least 300ms, in order to ensure | ||
# that it can send its notify | ||
function _exit { | ||
sleep 1 | ||
} | ||
|
||
trap _term_or_init SIGTERM SIGINT | ||
trap _exit EXIT | ||
|
||
PROC="${@:1}" | ||
$PROC & | ||
|
||
# Wait on the app process to ensure that this script is able to trap the SIGTERM | ||
# signal | ||
APP_PID=$! | ||
wait $APP_PID |
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
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,23 @@ | ||
Feature: Panic handling | ||
|
||
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" | ||
|
||
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" | ||
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 | |
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
Oops, something went wrong.