-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Support disabling crash reporting via autonotify config
- Loading branch information
Showing
8 changed files
with
113 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Feature: Modifying configuration settings after start() is called | ||
In some cases, such as within opt-in/opt-out flows, the configuration | ||
of the library should be allowed to be changed to reflect user preferences. | ||
|
||
Background: | ||
Given I set environment variable "BUGSNAG_API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa" | ||
|
||
Scenario: Turning on crash detection after start() | ||
When I crash the app using "TurnOnCrashDetectionAfterStartScenario" | ||
And I relaunch the app | ||
And I wait for a request | ||
Then the request is valid for the error reporting API | ||
And the "Bugsnag-API-Key" header equals "a35a2a72bd230ac0aa0f52715bbdc6aa" | ||
And the payload field "notifier.name" equals "iOS Bugsnag Notifier" | ||
And the payload field "events" is an array with 1 element | ||
And the exception "errorClass" equals "EXC_BAD_INSTRUCTION" | ||
And the "method" of stack frame 0 equals "-[TurnOnCrashDetectionAfterStartScenario run]" | ||
|
||
Scenario: Turning off crash detection after start() | ||
When I crash the app using "TurnOffCrashDetectionAfterStartScenario" | ||
And I relaunch the app | ||
And I wait for 10 seconds | ||
Then I should receive 0 requests |
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
9 changes: 9 additions & 0 deletions
9
...ures/fixtures/ios-swift-cocoapods/iOSTestApp/scenarios/ConfigChangesAfterStartScenarios.h
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,9 @@ | ||
#import <Foundation/Foundation.h> | ||
#import "Scenario.h" | ||
|
||
|
||
@interface TurnOnCrashDetectionAfterStartScenario : Scenario | ||
@end | ||
|
||
@interface TurnOffCrashDetectionAfterStartScenario : Scenario | ||
@end |
30 changes: 30 additions & 0 deletions
30
...ures/fixtures/ios-swift-cocoapods/iOSTestApp/scenarios/ConfigChangesAfterStartScenarios.m
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,30 @@ | ||
#import "ConfigChangesAfterStartScenarios.h" | ||
|
||
@implementation TurnOnCrashDetectionAfterStartScenario | ||
|
||
- (void)startBugsnag { | ||
self.config.shouldAutoCaptureSessions = NO; | ||
self.config.autoNotify = NO; | ||
[super startBugsnag]; | ||
} | ||
|
||
- (void)run { | ||
self.config.autoNotify = YES; | ||
__builtin_trap(); | ||
} | ||
@end | ||
|
||
|
||
@implementation TurnOffCrashDetectionAfterStartScenario | ||
|
||
- (void)startBugsnag { | ||
self.config.shouldAutoCaptureSessions = NO; | ||
[super startBugsnag]; | ||
} | ||
|
||
- (void)run { | ||
self.config.autoNotify = NO; | ||
__builtin_trap(); | ||
} | ||
|
||
@end |