From d23b9f20b325e5b2a17a3a0c7ace18fcc07ec1e4 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Wed, 22 Feb 2023 15:52:24 -0500 Subject: [PATCH] [flutter_migrate] Skip slow tests Currently `flutter_migrate` unit tests take 10 minutes to run, which is 1/6 of our total time allowance for a Cirrus test run, and 1-2 orders of magnitude slower than all of our other unit tests. This skips the slow tests, with references to a tracking issue. At some point when there are more eng resources on `flutter_migrate` someone can revisit these tests to speed them up and/or make them another type of test (such as a custom `run_tests` test). Part of https://github.com/flutter/flutter/issues/121257 --- .../flutter_migrate/test/compute_test.dart | 15 +++++++++--- .../flutter_migrate/test/migrate_test.dart | 24 +++++++++++++++---- packages/flutter_migrate/test/utils_test.dart | 6 ++++- 3 files changed, 37 insertions(+), 8 deletions(-) diff --git a/packages/flutter_migrate/test/compute_test.dart b/packages/flutter_migrate/test/compute_test.dart index eea7200a7a9..523162cad38 100644 --- a/packages/flutter_migrate/test/compute_test.dart +++ b/packages/flutter_migrate/test/compute_test.dart @@ -251,7 +251,10 @@ void main() { .existsSync(), false); }, timeout: const Timeout(Duration(seconds: 500))); - }); + }, + // TODO(stuartmorgan): These should not be unit tests, see + // https://github.com/flutter/flutter/issues/121257. + skip: 'TODO: Speed up, or move to another type of test'); group('MigrateRevisions', () { setUp(() async { @@ -486,7 +489,10 @@ migration: .baseRevision, '36427af29421f406ac95ff55ea31d1dc49a45b5f'); }); - }); + }, + // TODO(stuartmorgan): These should not be unit tests, see + // https://github.com/flutter/flutter/issues/121257. + skip: 'TODO: Speed up, or move to another type of test'); group('project operations', () { setUp(() async { @@ -865,5 +871,8 @@ migration: expect(result.mergeResults[10].hasConflict, false); expect(result.mergeResults[11].hasConflict, false); }, timeout: const Timeout(Duration(seconds: 500))); - }); + }, + // TODO(stuartmorgan): These should not be unit tests, see + // https://github.com/flutter/flutter/issues/121257. + skip: 'TODO: Speed up, or move to another type of test'); } diff --git a/packages/flutter_migrate/test/migrate_test.dart b/packages/flutter_migrate/test/migrate_test.dart index 10158ea3fd1..beeddb329c8 100644 --- a/packages/flutter_migrate/test/migrate_test.dart +++ b/packages/flutter_migrate/test/migrate_test.dart @@ -106,7 +106,11 @@ Modified files: .existsSync(), true); expect(tempDir.childFile('analysis_options.yaml').existsSync(), true); - }, timeout: const Timeout(Duration(seconds: 500)), skip: isWindows); + }, + timeout: const Timeout(Duration(seconds: 500)), + // TODO(stuartmorgan): These should not be unit tests, see + // https://github.com/flutter/flutter/issues/121257. + skip: true); // Migrates a clean untouched app generated with flutter create testUsingContext('vanilla migrate builds', () async { @@ -167,7 +171,11 @@ class MyApp extends StatelessWidget { // Skipped due to being flaky, the build completes successfully, but sometimes // Gradle crashes due to resources on the bot. We should fine tune this to // make it stable. - }, timeout: const Timeout(Duration(seconds: 900)), skip: true); + }, + timeout: const Timeout(Duration(seconds: 900)), + // TODO(stuartmorgan): These should not be unit tests, see + // https://github.com/flutter/flutter/issues/121257. + skip: true); testUsingContext('migrate abandon', () async { // Abandon in an empty dir fails. @@ -209,7 +217,11 @@ class MyApp extends StatelessWidget { ], workingDirectory: tempDir.path); expect(result.exitCode, 0); expect(result.stdout.toString(), contains('Abandon complete')); - }, timeout: const Timeout(Duration(seconds: 300))); + }, + timeout: const Timeout(Duration(seconds: 300)), + // TODO(stuartmorgan): These should not be unit tests, see + // https://github.com/flutter/flutter/issues/121257. + skip: true); // Migrates a user-modified app testUsingContext('modified migrate process succeeds', () async { @@ -436,5 +448,9 @@ flutter: .existsSync(), true); expect(tempDir.childFile('analysis_options.yaml').existsSync(), true); - }, timeout: const Timeout(Duration(seconds: 500)), skip: isWindows); + }, + timeout: const Timeout(Duration(seconds: 500)), + // TODO(stuartmorgan): These should not be unit tests, see + // https://github.com/flutter/flutter/issues/121257. + skip: true); } diff --git a/packages/flutter_migrate/test/utils_test.dart b/packages/flutter_migrate/test/utils_test.dart index 35a0bf50e9e..4c52156d9a6 100644 --- a/packages/flutter_migrate/test/utils_test.dart +++ b/packages/flutter_migrate/test/utils_test.dart @@ -281,7 +281,11 @@ void main() { projectRoot.deleteSync(recursive: true); }); - }, timeout: const Timeout(Duration(seconds: 500))); + }, + timeout: const Timeout(Duration(seconds: 500)), + // TODO(stuartmorgan): These should not be unit tests, see + // https://github.com/flutter/flutter/issues/121257. + skip: 'TODO: Speed up, or move to another type of test'); testWithoutContext('conflictsResolved', () async { expect(utils.conflictsResolved(''), true);