Skip to content

Commit

Permalink
Merge pull request #395 from gnunicorn/ben-cli-limit-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fzyzcjy authored Jun 21, 2024
2 parents ff4150c + 076f44d commit 608196a
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -35,9 +36,10 @@ Future<void> main(List<String> args) async {
await _awaitSuiteInfoNonEmpty();

Log.i(_kTag, 'step hotRestartAndRunTests');
GetIt.I
.get<MiscDartService>()
.hotRestartAndRunTests(filterNameRegex: RegexUtils.kMatchEverything);
final regExp = GlobalConfigStore.config.runOnly != null
? RegexUtils.matchPrefix(GlobalConfigStore.config.runOnly!)
: RegexUtils.kMatchEverything;
GetIt.I.get<MiscDartService>().hotRestartAndRunTests(filterNameRegex: regExp);

StatusPeriodicLogger.run();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
}

Expand All @@ -41,6 +45,7 @@ class GlobalConfigNullable with _$GlobalConfigNullable {
bool? isolationMode,
bool? enableReportSaver,
String? goldenDiffGitRepo,
String? runOnly,
}) = _GlobalConfigNullable;

factory GlobalConfigNullable.fromJson(Map<String, dynamic> json) =>
Expand Down Expand Up @@ -99,6 +104,8 @@ class GlobalConfigNullable with _$GlobalConfigNullable {
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')),
);
}

Expand All @@ -107,13 +114,15 @@ 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);

return 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?,
);
}

Expand All @@ -133,12 +142,14 @@ extension ExtGlobalConfigNullable on 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,
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -12,7 +12,7 @@ part of 'global_config_store.dart';
T _$identity<T>(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<String, dynamic> json) {
return _GlobalConfigNullable.fromJson(json);
Expand All @@ -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<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
Expand All @@ -39,7 +40,8 @@ abstract class $GlobalConfigNullableCopyWith<$Res> {
$Res call(
{bool? isolationMode,
bool? enableReportSaver,
String? goldenDiffGitRepo});
String? goldenDiffGitRepo,
String? runOnly});
}

/// @nodoc
Expand All @@ -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
Expand All @@ -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')
Expand All @@ -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
Expand All @@ -119,59 +128,70 @@ 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<String, dynamic> json) =>
_$$_GlobalConfigNullableFromJson(json);
factory _$GlobalConfigNullableImpl.fromJson(Map<String, dynamic> json) =>
_$$GlobalConfigNullableImplFromJson(json);

@override
final bool? isolationMode;
@override
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<String, dynamic> toJson() {
return _$$_GlobalConfigNullableToJson(
return _$$GlobalConfigNullableImplToJson(
this,
);
}
Expand All @@ -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<String, dynamic> json) =
_$_GlobalConfigNullable.fromJson;
_$GlobalConfigNullableImpl.fromJson;

@override
bool? get isolationMode;
Expand All @@ -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;
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 608196a

Please sign in to comment.