Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename options.devMode to options.automatedTestMode #1664

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
exception: exception,
stackTrace: stackTrace,
);
if (_options.devMode) {
if (_options.automatedTestMode) {
rethrow;
}
}
Expand Down Expand Up @@ -377,7 +377,7 @@
SentryLevel.error,
"Error in the 'configureScope' callback, error: $err",
);
if (_options.devMode) {
if (_options.automatedTestMode) {

Check warning on line 380 in dart/lib/src/hub.dart

View check run for this annotation

Codecov / codecov/patch

dart/lib/src/hub.dart#L380

Added line #L380 was not covered by tests
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 @@
exception: exception,
stackTrace: stackTrace,
);
if (_options.devMode) {
if (_options.automatedTestMode) {
rethrow;
}
}
Expand Down Expand Up @@ -345,7 +345,7 @@
exception: exception,
stackTrace: stackTrace,
);
if (_options.devMode) {
if (_options.automatedTestMode) {

Check warning on line 348 in dart/lib/src/scope.dart

View check run for this annotation

Codecov / codecov/patch

dart/lib/src/scope.dart#L348

Added line #L348 was not covered by tests
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 @@
exception: exception,
stackTrace: stackTrace,
);
if (_options.devMode) {
if (_options.automatedTestMode) {
rethrow;
}
}
Expand Down Expand Up @@ -438,7 +438,7 @@
exception: exception,
stackTrace: stackTrace,
);
if (_options.devMode) {
if (_options.automatedTestMode) {

Check warning on line 441 in dart/lib/src/sentry_client.dart

View check run for this annotation

Codecov / codecov/patch

dart/lib/src/sentry_client.dart#L441

Added line #L441 was not covered by tests
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