From 704d94b59b0a8d2597714da195b786a1788feb6f Mon Sep 17 00:00:00 2001 From: Benjamin Kampmann Date: Fri, 21 Jun 2024 21:28:59 +0530 Subject: [PATCH 1/2] New CLI param --run-only allowing you to limit the tests this runs --- .../bin/convenient_test_manager_dart.dart | 24 +++-- .../lib/stores/global_config_store.dart | 28 +++--- .../stores/global_config_store.freezed.dart | 89 ++++++++++++------- .../lib/stores/global_config_store.g.dart | 29 ++++-- 4 files changed, 106 insertions(+), 64 deletions(-) diff --git a/packages/convenient_test_manager_dart/bin/convenient_test_manager_dart.dart b/packages/convenient_test_manager_dart/bin/convenient_test_manager_dart.dart index 732af52c..acf8ebc4 100644 --- a/packages/convenient_test_manager_dart/bin/convenient_test_manager_dart.dart +++ b/packages/convenient_test_manager_dart/bin/convenient_test_manager_dart.dart @@ -6,6 +6,7 @@ import 'package:convenient_test_manager_dart/misc/setup.dart'; import 'package:convenient_test_manager_dart/services/misc_dart_service.dart'; import 'package:convenient_test_manager_dart/services/status_periodic_logger.dart'; import 'package:convenient_test_manager_dart/services/vm_service_wrapper_service.dart'; +import 'package:convenient_test_manager_dart/stores/global_config_store.dart'; import 'package:convenient_test_manager_dart/stores/suite_info_store.dart'; import 'package:convenient_test_manager_dart/stores/worker_super_run_store.dart'; import 'package:get_it/get_it.dart'; @@ -35,9 +36,10 @@ Future main(List args) async { await _awaitSuiteInfoNonEmpty(); Log.i(_kTag, 'step hotRestartAndRunTests'); - GetIt.I - .get() - .hotRestartAndRunTests(filterNameRegex: RegexUtils.kMatchEverything); + final regExp = GlobalConfigStore.config.runOnly != null + ? RegexUtils.matchPrefix(GlobalConfigStore.config.runOnly!) + : RegexUtils.kMatchEverything; + GetIt.I.get().hotRestartAndRunTests(filterNameRegex: regExp); StatusPeriodicLogger.run(); @@ -93,8 +95,7 @@ Future _awaitSuiteInfoNonEmpty() async { while (true) { final suiteInfo = suiteInfoStore.suiteInfo; final numGroupEntries = suiteInfo?.entryMap.length ?? 0; - Log.i( - _kTag, 'awaitSuiteInfoNonEmpty check numGroupEntries=$numGroupEntries'); + Log.i(_kTag, 'awaitSuiteInfoNonEmpty check numGroupEntries=$numGroupEntries'); if (numGroupEntries > 0) return; @@ -105,21 +106,17 @@ Future _awaitSuiteInfoNonEmpty() async { Future _awaitSuperRunStatusTestAllDone() async { final workerSuperRunStore = GetIt.I.get(); - if (workerSuperRunStore.currSuperRunController.superRunStatus == - WorkerSuperRunStatus.testAllDone) { + if (workerSuperRunStore.currSuperRunController.superRunStatus == WorkerSuperRunStatus.testAllDone) { throw AssertionError; } - await asyncWhen((_) => - workerSuperRunStore.currSuperRunController.superRunStatus == - WorkerSuperRunStatus.testAllDone); + await asyncWhen((_) => workerSuperRunStore.currSuperRunController.superRunStatus == WorkerSuperRunStatus.testAllDone); } int _calcExitCode() { final suiteInfoStore = GetIt.I.get(); - final stateCountMap = - suiteInfoStore.calcStateCountMap(suiteInfoStore.suiteInfo!.rootGroup); + final stateCountMap = suiteInfoStore.calcStateCountMap(suiteInfoStore.suiteInfo!.rootGroup); if (stateCountMap[SimplifiedStateEnum.pending] > 0) throw AssertionError; @@ -127,8 +124,7 @@ int _calcExitCode() { Log.w(_kTag, 'See flaky tests.'); } - final hasFailure = - stateCountMap[SimplifiedStateEnum.completeFailureOrError] > 0; + final hasFailure = stateCountMap[SimplifiedStateEnum.completeFailureOrError] > 0; if (hasFailure) { Log.w(_kTag, 'See failed tests.'); } diff --git a/packages/convenient_test_manager_dart/lib/stores/global_config_store.dart b/packages/convenient_test_manager_dart/lib/stores/global_config_store.dart index aff6cac3..c447f82e 100644 --- a/packages/convenient_test_manager_dart/lib/stores/global_config_store.dart +++ b/packages/convenient_test_manager_dart/lib/stores/global_config_store.dart @@ -26,10 +26,14 @@ abstract class _GlobalConfig with Store { @observable String? goldenDiffGitRepo; + @observable + String? runOnly; + _GlobalConfig({ required this.isolationMode, required this.enableReportSaver, required this.goldenDiffGitRepo, + required this.runOnly, }); } @@ -41,10 +45,10 @@ class GlobalConfigNullable with _$GlobalConfigNullable { bool? isolationMode, bool? enableReportSaver, String? goldenDiffGitRepo, + String? runOnly, }) = _GlobalConfigNullable; - factory GlobalConfigNullable.fromJson(Map json) => - _$GlobalConfigNullableFromJson(json); + factory GlobalConfigNullable.fromJson(Map json) => _$GlobalConfigNullableFromJson(json); static Future parse({ required List? args, @@ -82,8 +86,7 @@ class GlobalConfigNullable with _$GlobalConfigNullable { if (!await File(configFilePath).exists()) return GlobalConfigNullable(); final configText = await File(configFilePath).readAsString(); - return GlobalConfigNullable.fromJson( - jsonDecode(configText) as Map); + return GlobalConfigNullable.fromJson(jsonDecode(configText) as Map); } catch (e, s) { Log.w(_kTag, 'parseConfigFile error e=$e s=$s'); return GlobalConfigNullable(); @@ -93,12 +96,10 @@ class GlobalConfigNullable with _$GlobalConfigNullable { // ignore: prefer_constructors_over_static_methods static GlobalConfigNullable parseEnvironment() { return GlobalConfigNullable( - isolationMode: _stringToNullableBool( - const String.fromEnvironment('CONVENIENT_TEST_ISOLATION_MODE')), - enableReportSaver: _stringToNullableBool( - const String.fromEnvironment('CONVENIENT_TEST_ENABLE_REPORT_SAVER')), - goldenDiffGitRepo: _emptyToNull( - const String.fromEnvironment('CONVENIENT_TEST_GOLDEN_DIFF_GIT_REPO')), + isolationMode: _stringToNullableBool(const String.fromEnvironment('CONVENIENT_TEST_ISOLATION_MODE')), + enableReportSaver: _stringToNullableBool(const String.fromEnvironment('CONVENIENT_TEST_ENABLE_REPORT_SAVER')), + goldenDiffGitRepo: _emptyToNull(const String.fromEnvironment('CONVENIENT_TEST_GOLDEN_DIFF_GIT_REPO')), + runOnly: _emptyToNull(const String.fromEnvironment('CONVENIENT_TEST_RUN_ONLY')), ); } @@ -107,6 +108,7 @@ class GlobalConfigNullable with _$GlobalConfigNullable { final results = (ArgParser() ..addFlag('isolation-mode', defaultsTo: null) ..addFlag('enable-report-saver', defaultsTo: null) + ..addOption('run-only', defaultsTo: null) ..addOption('golden-diff-git-repo', defaultsTo: null)) .parse(args); @@ -114,6 +116,7 @@ class GlobalConfigNullable with _$GlobalConfigNullable { isolationMode: results['isolation-mode'] as bool?, enableReportSaver: results['enable-report-saver'] as bool?, goldenDiffGitRepo: results['golden-diff-git-repo'] as String?, + runOnly: results['run-only'] as String?, ); } @@ -128,17 +131,18 @@ class GlobalConfigNullable with _$GlobalConfigNullable { } extension ExtGlobalConfigNullable on GlobalConfigNullable { - GlobalConfigNullable merge(GlobalConfigNullable other) => - GlobalConfigNullable( + GlobalConfigNullable merge(GlobalConfigNullable other) => GlobalConfigNullable( isolationMode: other.isolationMode ?? isolationMode, enableReportSaver: other.enableReportSaver ?? enableReportSaver, goldenDiffGitRepo: other.goldenDiffGitRepo ?? goldenDiffGitRepo, + runOnly: other.runOnly ?? runOnly, ); GlobalConfig toConfig() => GlobalConfig( isolationMode: isolationMode ?? false, enableReportSaver: enableReportSaver ?? false, goldenDiffGitRepo: goldenDiffGitRepo, + runOnly: runOnly, ); } diff --git a/packages/convenient_test_manager_dart/lib/stores/global_config_store.freezed.dart b/packages/convenient_test_manager_dart/lib/stores/global_config_store.freezed.dart index c8ed79d4..4c0b7eff 100644 --- a/packages/convenient_test_manager_dart/lib/stores/global_config_store.freezed.dart +++ b/packages/convenient_test_manager_dart/lib/stores/global_config_store.freezed.dart @@ -1,7 +1,7 @@ // coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND // ignore_for_file: type=lint -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, non_nullable_equals_parameter +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark part of 'global_config_store.dart'; @@ -12,7 +12,7 @@ part of 'global_config_store.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); GlobalConfigNullable _$GlobalConfigNullableFromJson(Map json) { return _GlobalConfigNullable.fromJson(json); @@ -23,6 +23,7 @@ mixin _$GlobalConfigNullable { bool? get isolationMode => throw _privateConstructorUsedError; bool? get enableReportSaver => throw _privateConstructorUsedError; String? get goldenDiffGitRepo => throw _privateConstructorUsedError; + String? get runOnly => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) @@ -39,7 +40,8 @@ abstract class $GlobalConfigNullableCopyWith<$Res> { $Res call( {bool? isolationMode, bool? enableReportSaver, - String? goldenDiffGitRepo}); + String? goldenDiffGitRepo, + String? runOnly}); } /// @nodoc @@ -59,6 +61,7 @@ class _$GlobalConfigNullableCopyWithImpl<$Res, Object? isolationMode = freezed, Object? enableReportSaver = freezed, Object? goldenDiffGitRepo = freezed, + Object? runOnly = freezed, }) { return _then(_value.copyWith( isolationMode: freezed == isolationMode @@ -73,30 +76,35 @@ class _$GlobalConfigNullableCopyWithImpl<$Res, ? _value.goldenDiffGitRepo : goldenDiffGitRepo // ignore: cast_nullable_to_non_nullable as String?, + runOnly: freezed == runOnly + ? _value.runOnly + : runOnly // ignore: cast_nullable_to_non_nullable + as String?, ) as $Val); } } /// @nodoc -abstract class _$$_GlobalConfigNullableCopyWith<$Res> +abstract class _$$GlobalConfigNullableImplCopyWith<$Res> implements $GlobalConfigNullableCopyWith<$Res> { - factory _$$_GlobalConfigNullableCopyWith(_$_GlobalConfigNullable value, - $Res Function(_$_GlobalConfigNullable) then) = - __$$_GlobalConfigNullableCopyWithImpl<$Res>; + factory _$$GlobalConfigNullableImplCopyWith(_$GlobalConfigNullableImpl value, + $Res Function(_$GlobalConfigNullableImpl) then) = + __$$GlobalConfigNullableImplCopyWithImpl<$Res>; @override @useResult $Res call( {bool? isolationMode, bool? enableReportSaver, - String? goldenDiffGitRepo}); + String? goldenDiffGitRepo, + String? runOnly}); } /// @nodoc -class __$$_GlobalConfigNullableCopyWithImpl<$Res> - extends _$GlobalConfigNullableCopyWithImpl<$Res, _$_GlobalConfigNullable> - implements _$$_GlobalConfigNullableCopyWith<$Res> { - __$$_GlobalConfigNullableCopyWithImpl(_$_GlobalConfigNullable _value, - $Res Function(_$_GlobalConfigNullable) _then) +class __$$GlobalConfigNullableImplCopyWithImpl<$Res> + extends _$GlobalConfigNullableCopyWithImpl<$Res, _$GlobalConfigNullableImpl> + implements _$$GlobalConfigNullableImplCopyWith<$Res> { + __$$GlobalConfigNullableImplCopyWithImpl(_$GlobalConfigNullableImpl _value, + $Res Function(_$GlobalConfigNullableImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -105,8 +113,9 @@ class __$$_GlobalConfigNullableCopyWithImpl<$Res> Object? isolationMode = freezed, Object? enableReportSaver = freezed, Object? goldenDiffGitRepo = freezed, + Object? runOnly = freezed, }) { - return _then(_$_GlobalConfigNullable( + return _then(_$GlobalConfigNullableImpl( isolationMode: freezed == isolationMode ? _value.isolationMode : isolationMode // ignore: cast_nullable_to_non_nullable @@ -119,18 +128,25 @@ class __$$_GlobalConfigNullableCopyWithImpl<$Res> ? _value.goldenDiffGitRepo : goldenDiffGitRepo // ignore: cast_nullable_to_non_nullable as String?, + runOnly: freezed == runOnly + ? _value.runOnly + : runOnly // ignore: cast_nullable_to_non_nullable + as String?, )); } } /// @nodoc @JsonSerializable() -class _$_GlobalConfigNullable implements _GlobalConfigNullable { - _$_GlobalConfigNullable( - {this.isolationMode, this.enableReportSaver, this.goldenDiffGitRepo}); +class _$GlobalConfigNullableImpl implements _GlobalConfigNullable { + _$GlobalConfigNullableImpl( + {this.isolationMode, + this.enableReportSaver, + this.goldenDiffGitRepo, + this.runOnly}); - factory _$_GlobalConfigNullable.fromJson(Map json) => - _$$_GlobalConfigNullableFromJson(json); + factory _$GlobalConfigNullableImpl.fromJson(Map json) => + _$$GlobalConfigNullableImplFromJson(json); @override final bool? isolationMode; @@ -138,40 +154,44 @@ class _$_GlobalConfigNullable implements _GlobalConfigNullable { final bool? enableReportSaver; @override final String? goldenDiffGitRepo; + @override + final String? runOnly; @override String toString() { - return 'GlobalConfigNullable(isolationMode: $isolationMode, enableReportSaver: $enableReportSaver, goldenDiffGitRepo: $goldenDiffGitRepo)'; + return 'GlobalConfigNullable(isolationMode: $isolationMode, enableReportSaver: $enableReportSaver, goldenDiffGitRepo: $goldenDiffGitRepo, runOnly: $runOnly)'; } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$_GlobalConfigNullable && + other is _$GlobalConfigNullableImpl && (identical(other.isolationMode, isolationMode) || other.isolationMode == isolationMode) && (identical(other.enableReportSaver, enableReportSaver) || other.enableReportSaver == enableReportSaver) && (identical(other.goldenDiffGitRepo, goldenDiffGitRepo) || - other.goldenDiffGitRepo == goldenDiffGitRepo)); + other.goldenDiffGitRepo == goldenDiffGitRepo) && + (identical(other.runOnly, runOnly) || other.runOnly == runOnly)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash( - runtimeType, isolationMode, enableReportSaver, goldenDiffGitRepo); + int get hashCode => Object.hash(runtimeType, isolationMode, enableReportSaver, + goldenDiffGitRepo, runOnly); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$_GlobalConfigNullableCopyWith<_$_GlobalConfigNullable> get copyWith => - __$$_GlobalConfigNullableCopyWithImpl<_$_GlobalConfigNullable>( - this, _$identity); + _$$GlobalConfigNullableImplCopyWith<_$GlobalConfigNullableImpl> + get copyWith => + __$$GlobalConfigNullableImplCopyWithImpl<_$GlobalConfigNullableImpl>( + this, _$identity); @override Map toJson() { - return _$$_GlobalConfigNullableToJson( + return _$$GlobalConfigNullableImplToJson( this, ); } @@ -181,10 +201,11 @@ abstract class _GlobalConfigNullable implements GlobalConfigNullable { factory _GlobalConfigNullable( {final bool? isolationMode, final bool? enableReportSaver, - final String? goldenDiffGitRepo}) = _$_GlobalConfigNullable; + final String? goldenDiffGitRepo, + final String? runOnly}) = _$GlobalConfigNullableImpl; factory _GlobalConfigNullable.fromJson(Map json) = - _$_GlobalConfigNullable.fromJson; + _$GlobalConfigNullableImpl.fromJson; @override bool? get isolationMode; @@ -193,7 +214,9 @@ abstract class _GlobalConfigNullable implements GlobalConfigNullable { @override String? get goldenDiffGitRepo; @override + String? get runOnly; + @override @JsonKey(ignore: true) - _$$_GlobalConfigNullableCopyWith<_$_GlobalConfigNullable> get copyWith => - throw _privateConstructorUsedError; + _$$GlobalConfigNullableImplCopyWith<_$GlobalConfigNullableImpl> + get copyWith => throw _privateConstructorUsedError; } diff --git a/packages/convenient_test_manager_dart/lib/stores/global_config_store.g.dart b/packages/convenient_test_manager_dart/lib/stores/global_config_store.g.dart index 74e75f4b..3b901787 100644 --- a/packages/convenient_test_manager_dart/lib/stores/global_config_store.g.dart +++ b/packages/convenient_test_manager_dart/lib/stores/global_config_store.g.dart @@ -6,20 +6,22 @@ part of 'global_config_store.dart'; // JsonSerializableGenerator // ************************************************************************** -_$_GlobalConfigNullable _$$_GlobalConfigNullableFromJson( +_$GlobalConfigNullableImpl _$$GlobalConfigNullableImplFromJson( Map json) => - _$_GlobalConfigNullable( + _$GlobalConfigNullableImpl( isolationMode: json['isolationMode'] as bool?, enableReportSaver: json['enableReportSaver'] as bool?, goldenDiffGitRepo: json['goldenDiffGitRepo'] as String?, + runOnly: json['runOnly'] as String?, ); -Map _$$_GlobalConfigNullableToJson( - _$_GlobalConfigNullable instance) => +Map _$$GlobalConfigNullableImplToJson( + _$GlobalConfigNullableImpl instance) => { 'isolationMode': instance.isolationMode, 'enableReportSaver': instance.enableReportSaver, 'goldenDiffGitRepo': instance.goldenDiffGitRepo, + 'runOnly': instance.runOnly, }; // ************************************************************************** @@ -77,12 +79,29 @@ mixin _$GlobalConfig on _GlobalConfig, Store { }); } + late final _$runOnlyAtom = + Atom(name: '_GlobalConfig.runOnly', context: context); + + @override + String? get runOnly { + _$runOnlyAtom.reportRead(); + return super.runOnly; + } + + @override + set runOnly(String? value) { + _$runOnlyAtom.reportWrite(value, super.runOnly, () { + super.runOnly = value; + }); + } + @override String toString() { return ''' isolationMode: ${isolationMode}, enableReportSaver: ${enableReportSaver}, -goldenDiffGitRepo: ${goldenDiffGitRepo} +goldenDiffGitRepo: ${goldenDiffGitRepo}, +runOnly: ${runOnly} '''; } } From 076f44d79aae72990726c94e036abbeffa31cfd6 Mon Sep 17 00:00:00 2001 From: Benjamin Kampmann Date: Fri, 21 Jun 2024 21:50:30 +0530 Subject: [PATCH 2/2] Fixing format --- .../bin/convenient_test_manager_dart.dart | 16 +++++++++----- .../lib/stores/global_config_store.dart | 21 ++++++++++++------- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/packages/convenient_test_manager_dart/bin/convenient_test_manager_dart.dart b/packages/convenient_test_manager_dart/bin/convenient_test_manager_dart.dart index acf8ebc4..a50b031b 100644 --- a/packages/convenient_test_manager_dart/bin/convenient_test_manager_dart.dart +++ b/packages/convenient_test_manager_dart/bin/convenient_test_manager_dart.dart @@ -95,7 +95,8 @@ Future _awaitSuiteInfoNonEmpty() async { while (true) { final suiteInfo = suiteInfoStore.suiteInfo; final numGroupEntries = suiteInfo?.entryMap.length ?? 0; - Log.i(_kTag, 'awaitSuiteInfoNonEmpty check numGroupEntries=$numGroupEntries'); + Log.i( + _kTag, 'awaitSuiteInfoNonEmpty check numGroupEntries=$numGroupEntries'); if (numGroupEntries > 0) return; @@ -106,17 +107,21 @@ Future _awaitSuiteInfoNonEmpty() async { Future _awaitSuperRunStatusTestAllDone() async { final workerSuperRunStore = GetIt.I.get(); - if (workerSuperRunStore.currSuperRunController.superRunStatus == WorkerSuperRunStatus.testAllDone) { + if (workerSuperRunStore.currSuperRunController.superRunStatus == + WorkerSuperRunStatus.testAllDone) { throw AssertionError; } - await asyncWhen((_) => workerSuperRunStore.currSuperRunController.superRunStatus == WorkerSuperRunStatus.testAllDone); + await asyncWhen((_) => + workerSuperRunStore.currSuperRunController.superRunStatus == + WorkerSuperRunStatus.testAllDone); } int _calcExitCode() { final suiteInfoStore = GetIt.I.get(); - final stateCountMap = suiteInfoStore.calcStateCountMap(suiteInfoStore.suiteInfo!.rootGroup); + final stateCountMap = + suiteInfoStore.calcStateCountMap(suiteInfoStore.suiteInfo!.rootGroup); if (stateCountMap[SimplifiedStateEnum.pending] > 0) throw AssertionError; @@ -124,7 +129,8 @@ int _calcExitCode() { Log.w(_kTag, 'See flaky tests.'); } - final hasFailure = stateCountMap[SimplifiedStateEnum.completeFailureOrError] > 0; + final hasFailure = + stateCountMap[SimplifiedStateEnum.completeFailureOrError] > 0; if (hasFailure) { Log.w(_kTag, 'See failed tests.'); } diff --git a/packages/convenient_test_manager_dart/lib/stores/global_config_store.dart b/packages/convenient_test_manager_dart/lib/stores/global_config_store.dart index c447f82e..1e1cba91 100644 --- a/packages/convenient_test_manager_dart/lib/stores/global_config_store.dart +++ b/packages/convenient_test_manager_dart/lib/stores/global_config_store.dart @@ -48,7 +48,8 @@ class GlobalConfigNullable with _$GlobalConfigNullable { String? runOnly, }) = _GlobalConfigNullable; - factory GlobalConfigNullable.fromJson(Map json) => _$GlobalConfigNullableFromJson(json); + factory GlobalConfigNullable.fromJson(Map json) => + _$GlobalConfigNullableFromJson(json); static Future parse({ required List? args, @@ -86,7 +87,8 @@ class GlobalConfigNullable with _$GlobalConfigNullable { if (!await File(configFilePath).exists()) return GlobalConfigNullable(); final configText = await File(configFilePath).readAsString(); - return GlobalConfigNullable.fromJson(jsonDecode(configText) as Map); + return GlobalConfigNullable.fromJson( + jsonDecode(configText) as Map); } catch (e, s) { Log.w(_kTag, 'parseConfigFile error e=$e s=$s'); return GlobalConfigNullable(); @@ -96,10 +98,14 @@ class GlobalConfigNullable with _$GlobalConfigNullable { // ignore: prefer_constructors_over_static_methods static GlobalConfigNullable parseEnvironment() { return GlobalConfigNullable( - isolationMode: _stringToNullableBool(const String.fromEnvironment('CONVENIENT_TEST_ISOLATION_MODE')), - enableReportSaver: _stringToNullableBool(const String.fromEnvironment('CONVENIENT_TEST_ENABLE_REPORT_SAVER')), - goldenDiffGitRepo: _emptyToNull(const String.fromEnvironment('CONVENIENT_TEST_GOLDEN_DIFF_GIT_REPO')), - runOnly: _emptyToNull(const String.fromEnvironment('CONVENIENT_TEST_RUN_ONLY')), + isolationMode: _stringToNullableBool( + const String.fromEnvironment('CONVENIENT_TEST_ISOLATION_MODE')), + enableReportSaver: _stringToNullableBool( + const String.fromEnvironment('CONVENIENT_TEST_ENABLE_REPORT_SAVER')), + goldenDiffGitRepo: _emptyToNull( + const String.fromEnvironment('CONVENIENT_TEST_GOLDEN_DIFF_GIT_REPO')), + runOnly: _emptyToNull( + const String.fromEnvironment('CONVENIENT_TEST_RUN_ONLY')), ); } @@ -131,7 +137,8 @@ class GlobalConfigNullable with _$GlobalConfigNullable { } extension ExtGlobalConfigNullable on GlobalConfigNullable { - GlobalConfigNullable merge(GlobalConfigNullable other) => GlobalConfigNullable( + GlobalConfigNullable merge(GlobalConfigNullable other) => + GlobalConfigNullable( isolationMode: other.isolationMode ?? isolationMode, enableReportSaver: other.enableReportSaver ?? enableReportSaver, goldenDiffGitRepo: other.goldenDiffGitRepo ?? goldenDiffGitRepo,