Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flutter_migrate] Skip slow tests #3270

Merged
merged 1 commit into from
Feb 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[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 flutter/flutter#121257
stuartmorgan committed Feb 22, 2023
commit d23b9f20b325e5b2a17a3a0c7ace18fcc07ec1e4
15 changes: 12 additions & 3 deletions packages/flutter_migrate/test/compute_test.dart
Original file line number Diff line number Diff line change
@@ -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');
}
24 changes: 20 additions & 4 deletions packages/flutter_migrate/test/migrate_test.dart
Original file line number Diff line number Diff line change
@@ -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);
}
6 changes: 5 additions & 1 deletion packages/flutter_migrate/test/utils_test.dart
Original file line number Diff line number Diff line change
@@ -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);