Skip to content

Commit

Permalink
Fixing format
Browse files Browse the repository at this point in the history
  • Loading branch information
gnunicorn committed Jun 21, 2024
1 parent 704d94b commit 076f44d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ Future<void> _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;

Expand All @@ -106,25 +107,30 @@ Future<void> _awaitSuiteInfoNonEmpty() async {
Future<void> _awaitSuperRunStatusTestAllDone() async {
final workerSuperRunStore = GetIt.I.get<WorkerSuperRunStore>();

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<SuiteInfoStore>();

final stateCountMap = suiteInfoStore.calcStateCountMap(suiteInfoStore.suiteInfo!.rootGroup);
final stateCountMap =
suiteInfoStore.calcStateCountMap(suiteInfoStore.suiteInfo!.rootGroup);

if (stateCountMap[SimplifiedStateEnum.pending] > 0) throw AssertionError;

if (stateCountMap[SimplifiedStateEnum.completeSuccessButFlaky] > 0) {
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.');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ class GlobalConfigNullable with _$GlobalConfigNullable {
String? runOnly,
}) = _GlobalConfigNullable;

factory GlobalConfigNullable.fromJson(Map<String, dynamic> json) => _$GlobalConfigNullableFromJson(json);
factory GlobalConfigNullable.fromJson(Map<String, dynamic> json) =>
_$GlobalConfigNullableFromJson(json);

static Future<GlobalConfig> parse({
required List<String>? args,
Expand Down Expand Up @@ -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<String, Object?>);
return GlobalConfigNullable.fromJson(
jsonDecode(configText) as Map<String, Object?>);
} catch (e, s) {
Log.w(_kTag, 'parseConfigFile error e=$e s=$s');
return GlobalConfigNullable();
Expand All @@ -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')),
);
}

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 076f44d

Please sign in to comment.