Skip to content

Commit

Permalink
[flutter_migrate] Skip slow tests (flutter#3270)
Browse files Browse the repository at this point in the history
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 flutter#121257
  • Loading branch information
stuartmorgan committed Feb 23, 2023
1 parent 3cc754a commit 13ee644
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 8 deletions.
15 changes: 12 additions & 3 deletions packages/flutter_migrate/test/compute_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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');
}
24 changes: 20 additions & 4 deletions packages/flutter_migrate/test/migrate_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
}
6 changes: 5 additions & 1 deletion packages/flutter_migrate/test/utils_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 13ee644

Please sign in to comment.