mirror of
https://github.com/flutter/packages.git
synced 2025-06-03 09:41:19 +08:00
[flutter_plugin_tools] Add a summary for successful runs (#4118)
Add a summary to the end of successful runs for everything using the new looping base command, similar to what we do for summarizing failures. This will make it easy to manually check results for PRs that we know should be changing the set of run packages (adding a new package, adding a new test type to a package, adding a new test type to the tool), as well as spot-checking when we see unexpected results (e.g., looking back and why a PR didn't fail CI when we discover that it should have). To support better surfacing skips, this restructures the return value of `runForPackage` to have "skip" as one of the options. As a result of it being a return value, packages that used `printSkip` to indicate that *parts* of the command were being skipped have been changed to no longer do that. Fixes https://github.com/flutter/flutter/issues/85626
This commit is contained in:
@ -44,21 +44,16 @@ void main() {
|
||||
|
||||
test('building for iOS when plugin is not set up for iOS results in no-op',
|
||||
() async {
|
||||
final Directory pluginDirectory = createFakePlugin('plugin', packagesDir,
|
||||
createFakePlugin('plugin', packagesDir,
|
||||
extraFiles: <String>['example/test']);
|
||||
|
||||
final Directory pluginExampleDirectory =
|
||||
pluginDirectory.childDirectory('example');
|
||||
|
||||
final List<String> output =
|
||||
await runCapturingPrint(runner, <String>['build-examples', '--ios']);
|
||||
final String packageName =
|
||||
p.relative(pluginExampleDirectory.path, from: packagesDir.path);
|
||||
|
||||
expect(
|
||||
output,
|
||||
containsAllInOrder(<Matcher>[
|
||||
contains('BUILDING $packageName for iOS'),
|
||||
contains('Running for plugin'),
|
||||
contains('iOS is not supported by this plugin'),
|
||||
]),
|
||||
);
|
||||
@ -113,23 +108,17 @@ void main() {
|
||||
test(
|
||||
'building for Linux when plugin is not set up for Linux results in no-op',
|
||||
() async {
|
||||
final Directory pluginDirectory =
|
||||
createFakePlugin('plugin', packagesDir, extraFiles: <String>[
|
||||
createFakePlugin('plugin', packagesDir, extraFiles: <String>[
|
||||
'example/test',
|
||||
]);
|
||||
|
||||
final Directory pluginExampleDirectory =
|
||||
pluginDirectory.childDirectory('example');
|
||||
|
||||
final List<String> output = await runCapturingPrint(
|
||||
runner, <String>['build-examples', '--linux']);
|
||||
final String packageName =
|
||||
p.relative(pluginExampleDirectory.path, from: packagesDir.path);
|
||||
|
||||
expect(
|
||||
output,
|
||||
containsAllInOrder(<Matcher>[
|
||||
contains('BUILDING $packageName for Linux'),
|
||||
contains('Running for plugin'),
|
||||
contains('Linux is not supported by this plugin'),
|
||||
]),
|
||||
);
|
||||
@ -176,23 +165,17 @@ void main() {
|
||||
|
||||
test('building for macos with no implementation results in no-op',
|
||||
() async {
|
||||
final Directory pluginDirectory =
|
||||
createFakePlugin('plugin', packagesDir, extraFiles: <String>[
|
||||
createFakePlugin('plugin', packagesDir, extraFiles: <String>[
|
||||
'example/test',
|
||||
]);
|
||||
|
||||
final Directory pluginExampleDirectory =
|
||||
pluginDirectory.childDirectory('example');
|
||||
|
||||
final List<String> output = await runCapturingPrint(
|
||||
runner, <String>['build-examples', '--macos']);
|
||||
final String packageName =
|
||||
p.relative(pluginExampleDirectory.path, from: packagesDir.path);
|
||||
|
||||
expect(
|
||||
output,
|
||||
containsAllInOrder(<Matcher>[
|
||||
contains('BUILDING $packageName for macOS'),
|
||||
contains('Running for plugin'),
|
||||
contains('macOS is not supported by this plugin'),
|
||||
]),
|
||||
);
|
||||
@ -239,24 +222,18 @@ void main() {
|
||||
});
|
||||
|
||||
test('building for web with no implementation results in no-op', () async {
|
||||
final Directory pluginDirectory =
|
||||
createFakePlugin('plugin', packagesDir, extraFiles: <String>[
|
||||
createFakePlugin('plugin', packagesDir, extraFiles: <String>[
|
||||
'example/test',
|
||||
]);
|
||||
|
||||
final Directory pluginExampleDirectory =
|
||||
pluginDirectory.childDirectory('example');
|
||||
|
||||
final List<String> output =
|
||||
await runCapturingPrint(runner, <String>['build-examples', '--web']);
|
||||
final String packageName =
|
||||
p.relative(pluginExampleDirectory.path, from: packagesDir.path);
|
||||
|
||||
expect(
|
||||
output,
|
||||
containsAllInOrder(<Matcher>[
|
||||
contains('BUILDING $packageName for web'),
|
||||
contains('Web is not supported by this plugin'),
|
||||
contains('Running for plugin'),
|
||||
contains('web is not supported by this plugin'),
|
||||
]),
|
||||
);
|
||||
|
||||
@ -304,29 +281,23 @@ void main() {
|
||||
test(
|
||||
'building for Windows when plugin is not set up for Windows results in no-op',
|
||||
() async {
|
||||
final Directory pluginDirectory =
|
||||
createFakePlugin('plugin', packagesDir, extraFiles: <String>[
|
||||
createFakePlugin('plugin', packagesDir, extraFiles: <String>[
|
||||
'example/test',
|
||||
]);
|
||||
|
||||
final Directory pluginExampleDirectory =
|
||||
pluginDirectory.childDirectory('example');
|
||||
|
||||
final List<String> output = await runCapturingPrint(
|
||||
runner, <String>['build-examples', '--windows']);
|
||||
final String packageName =
|
||||
p.relative(pluginExampleDirectory.path, from: packagesDir.path);
|
||||
|
||||
expect(
|
||||
output,
|
||||
containsAllInOrder(<Matcher>[
|
||||
contains('BUILDING $packageName for Windows'),
|
||||
contains('Running for plugin'),
|
||||
contains('Windows is not supported by this plugin'),
|
||||
]),
|
||||
);
|
||||
|
||||
// Output should be empty since running build-examples --macos with no macos
|
||||
// implementation is a no-op.
|
||||
// Output should be empty since running build-examples --windows with no
|
||||
// Windows implementation is a no-op.
|
||||
expect(processRunner.recordedCalls, orderedEquals(<ProcessCall>[]));
|
||||
});
|
||||
|
||||
@ -368,23 +339,17 @@ void main() {
|
||||
test(
|
||||
'building for Android when plugin is not set up for Android results in no-op',
|
||||
() async {
|
||||
final Directory pluginDirectory =
|
||||
createFakePlugin('plugin', packagesDir, extraFiles: <String>[
|
||||
createFakePlugin('plugin', packagesDir, extraFiles: <String>[
|
||||
'example/test',
|
||||
]);
|
||||
|
||||
final Directory pluginExampleDirectory =
|
||||
pluginDirectory.childDirectory('example');
|
||||
|
||||
final List<String> output =
|
||||
await runCapturingPrint(runner, <String>['build-examples', '--apk']);
|
||||
final String packageName =
|
||||
p.relative(pluginExampleDirectory.path, from: packagesDir.path);
|
||||
|
||||
expect(
|
||||
output,
|
||||
containsAllInOrder(<Matcher>[
|
||||
contains('\nBUILDING APK for $packageName'),
|
||||
contains('Running for plugin'),
|
||||
contains('Android is not supported by this plugin'),
|
||||
]),
|
||||
);
|
||||
@ -419,7 +384,7 @@ void main() {
|
||||
expect(
|
||||
output,
|
||||
containsAllInOrder(<String>[
|
||||
'\nBUILDING APK for $packageName',
|
||||
'\nBUILDING $packageName for Android (apk)',
|
||||
]),
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user