Skip to content

Commit

Permalink
Rename options.devMode to options.automatedTestMode (#1664)
Browse files Browse the repository at this point in the history
  • Loading branch information
denrase authored Oct 9, 2023
1 parent 5f3facd commit 2211a40
Show file tree
Hide file tree
Showing 14 changed files with 55 additions and 55 deletions.
4 changes: 2 additions & 2 deletions dart/lib/src/hub.dart
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ class Hub {
exception: exception,
stackTrace: stackTrace,
);
if (_options.devMode) {
if (_options.automatedTestMode) {
rethrow;
}
}
Expand Down Expand Up @@ -377,7 +377,7 @@ class Hub {
SentryLevel.error,
"Error in the 'configureScope' callback, error: $err",
);
if (_options.devMode) {
if (_options.automatedTestMode) {
rethrow;
}
}
Expand Down
4 changes: 2 additions & 2 deletions dart/lib/src/scope.dart
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class Scope {
exception: exception,
stackTrace: stackTrace,
);
if (_options.devMode) {
if (_options.automatedTestMode) {
rethrow;
}
}
Expand Down Expand Up @@ -345,7 +345,7 @@ class Scope {
exception: exception,
stackTrace: stackTrace,
);
if (_options.devMode) {
if (_options.automatedTestMode) {
rethrow;
}
}
Expand Down
2 changes: 1 addition & 1 deletion dart/lib/src/sentry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Sentry {
exception: exception,
stackTrace: stackTrace,
);
if (sentryOptions.devMode) {
if (sentryOptions.automatedTestMode) {
rethrow;
}
}
Expand Down
4 changes: 2 additions & 2 deletions dart/lib/src/sentry_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ class SentryClient {
exception: exception,
stackTrace: stackTrace,
);
if (_options.devMode) {
if (_options.automatedTestMode) {
rethrow;
}
}
Expand Down Expand Up @@ -438,7 +438,7 @@ class SentryClient {
exception: exception,
stackTrace: stackTrace,
);
if (_options.devMode) {
if (_options.automatedTestMode) {
rethrow;
}
}
Expand Down
4 changes: 2 additions & 2 deletions dart/lib/src/sentry_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,10 @@ class SentryOptions {
/// are set.
bool? enableTracing;

/// Changed SDK behaviour when set to true:
/// Only for internal use. Changed SDK behaviour when set to true:
/// - Rethrow exceptions that occur in user provided closures
@internal
bool devMode = false;
bool automatedTestMode = false;

SentryOptions({this.dsn, PlatformChecker? checker}) {
if (checker != null) {
Expand Down
2 changes: 1 addition & 1 deletion dart/lib/src/sentry_traces_sampler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class SentryTracesSampler {
exception: exception,
stackTrace: stackTrace,
);
if (_options.devMode) {
if (_options.automatedTestMode) {
rethrow;
}
}
Expand Down
4 changes: 2 additions & 2 deletions dart/test/environment_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void main() {
release: 'release-9.8.7',
dist: 'bar',
);
options.devMode = true;
options.automatedTestMode = true;

await Sentry.init(
(options) => options,
Expand All @@ -44,7 +44,7 @@ void main() {
release: 'release-9.8.7',
dist: 'bar',
);
options.devMode = true;
options.automatedTestMode = true;

await Sentry.init(
(options) => options,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void main() {

final transport = MockTransport();

final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
await Sentry.init(
(options) {
options.dsn = fakeDsn;
Expand Down
2 changes: 1 addition & 1 deletion dart/test/event_processor/enricher/io_enricher_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ void main() {
});

test('$IoEnricherEventProcessor gets added on init', () async {
final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
late SentryOptions configuredOptions;
await Sentry.init(
(options) {
Expand Down
4 changes: 2 additions & 2 deletions dart/test/initialization_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ void main() {
});

test('async re-initilization', () async {
final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
await Sentry.init(
(options) {
options.dsn = fakeDsn;
Expand All @@ -35,7 +35,7 @@ void main() {
// This is the failure from
// https://github.com/getsentry/sentry-dart/issues/508
test('re-initilization', () async {
final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
await Sentry.init(
(options) {
options.dsn = fakeDsn;
Expand Down
40 changes: 20 additions & 20 deletions dart/test/sentry_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void main() {
var anException = Exception();

setUp(() async {
final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
await Sentry.init(
options: options,
(options) => {
Expand Down Expand Up @@ -137,7 +137,7 @@ void main() {
});

test('null DSN', () async {
final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
expect(
() async => await Sentry.init(
options: options,
Expand All @@ -150,7 +150,7 @@ void main() {

test('appRunner should be optional', () async {
expect(Sentry.isEnabled, false);
final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
await Sentry.init(
options: options,
(options) => options.dsn = fakeDsn,
Expand All @@ -159,7 +159,7 @@ void main() {
});

test('empty DSN', () async {
final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
await Sentry.init(
options: options,
(options) => options.dsn = '',
Expand All @@ -170,7 +170,7 @@ void main() {
test('empty DSN disables the SDK but runs the integrations', () async {
final integration = MockIntegration();

final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
await Sentry.init(
options: options,
(options) {
Expand All @@ -183,7 +183,7 @@ void main() {
});

test('close disables the SDK', () async {
final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
await Sentry.init(
options: options,
(options) => options.dsn = fakeDsn,
Expand All @@ -207,7 +207,7 @@ void main() {
test('should install integrations', () async {
final integration = MockIntegration();

final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
await Sentry.init(
options: options,
(options) {
Expand All @@ -221,7 +221,7 @@ void main() {

test('should add default integrations', () async {
late SentryOptions optionsReference;
final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
await Sentry.init(
options: options,
(options) {
Expand All @@ -245,7 +245,7 @@ void main() {
}, onPlatform: {'browser': Skip()});

test('should add only web compatible default integrations', () async {
final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
await Sentry.init(
options: options,
(options) {
Expand All @@ -261,7 +261,7 @@ void main() {
test('should close integrations', () async {
final integration = MockIntegration();

final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
await Sentry.init(
options: options,
(options) {
Expand All @@ -277,7 +277,7 @@ void main() {
});

test('$DeduplicationEventProcessor is added on init', () async {
final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
await Sentry.init(
options: options,
(options) {
Expand All @@ -294,7 +294,7 @@ void main() {
final completer = Completer();
var completed = false;

final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
final init = Sentry.init(
options: options,
(options) {
Expand All @@ -321,7 +321,7 @@ void main() {
final completer = Completer();
var completed = false;

final options = SentryOptions(dsn: fakeDsn)..devMode = true;
final options = SentryOptions(dsn: fakeDsn)..automatedTestMode = true;
final init = Sentry.init(
options: options,
(options) {
Expand All @@ -345,11 +345,11 @@ void main() {

test('options.environment debug', () async {
final sentryOptions = SentryOptions(dsn: fakeDsn)
..devMode = true
..automatedTestMode = true
..platformChecker = FakePlatformChecker.debugMode();

final options = SentryOptions();
options.devMode = true;
options.automatedTestMode = true;
await Sentry.init(
(options) {
options.dsn = fakeDsn;
Expand All @@ -363,7 +363,7 @@ void main() {
test('options.environment profile', () async {
final sentryOptions =
SentryOptions(dsn: fakeDsn, checker: FakePlatformChecker.profileMode())
..devMode = true;
..automatedTestMode = true;

await Sentry.init(
(options) {
Expand All @@ -378,7 +378,7 @@ void main() {
test('options.environment production (defaultEnvironment)', () async {
final sentryOptions =
SentryOptions(dsn: fakeDsn, checker: FakePlatformChecker.releaseMode())
..devMode = true;
..automatedTestMode = true;
await Sentry.init(
(options) {
options.dsn = fakeDsn;
Expand All @@ -392,7 +392,7 @@ void main() {
test('options.logger is set by setting the debug flag', () async {
final sentryOptions =
SentryOptions(dsn: fakeDsn, checker: FakePlatformChecker.debugMode())
..devMode = true;
..automatedTestMode = true;

await Sentry.init(
(options) {
Expand All @@ -417,7 +417,7 @@ void main() {

test('throw is handled and logged', () async {
final sentryOptions = SentryOptions(dsn: fakeDsn)
..devMode = false
..automatedTestMode = false
..debug = true
..logger = fixture.mockLogger;

Expand All @@ -439,7 +439,7 @@ void main() {

test('throw is handled and logged', () async {
final sentryOptions = SentryOptions(dsn: fakeDsn)
..devMode = false
..automatedTestMode = false
..debug = true
..logger = fixture.mockLogger;

Expand Down
2 changes: 1 addition & 1 deletion e2e_test/bin/e2e_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void main(List<String> arguments) async {
}
final options = SentryOptions(dsn: _exampleDsn)
// ignore: invalid_use_of_internal_member
..devMode = true;
..automatedTestMode = true;
await Sentry.init(
(options) {
options.dsn = _exampleDsn;
Expand Down
8 changes: 4 additions & 4 deletions flutter/test/initialization_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void main() {
(options) {
options.dsn = fakeDsn;
// ignore: invalid_use_of_internal_member
options.devMode = true;
options.automatedTestMode = true;
},
);

Expand All @@ -28,7 +28,7 @@ void main() {
(options) {
options.dsn = fakeDsn;
// ignore: invalid_use_of_internal_member
options.devMode = true;
options.automatedTestMode = true;
},
);

Expand All @@ -42,7 +42,7 @@ void main() {
(options) {
options.dsn = fakeDsn;
// ignore: invalid_use_of_internal_member
options.devMode = true;
options.automatedTestMode = true;
},
);

Expand All @@ -52,7 +52,7 @@ void main() {
(options) {
options.dsn = fakeDsn;
// ignore: invalid_use_of_internal_member
options.devMode = true;
options.automatedTestMode = true;
},
);

Expand Down
Loading

0 comments on commit 2211a40

Please sign in to comment.