From f5e2b0586e4b33a2409588a44a5d08c3446f7d9d Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Tue, 6 Jun 2023 16:31:46 -0400 Subject: [PATCH 1/6] [ci] Exclude maps unit tests on Windows Now that `google_maps_flutter` supports web, add it to the list of tests that don't currently run correctly on a Windows CI host. --- script/configs/windows_unit_tests_exceptions.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/script/configs/windows_unit_tests_exceptions.yaml b/script/configs/windows_unit_tests_exceptions.yaml index 9a729de3caa..b837d567713 100644 --- a/script/configs/windows_unit_tests_exceptions.yaml +++ b/script/configs/windows_unit_tests_exceptions.yaml @@ -15,6 +15,7 @@ - camera_web - file_selector - file_selector_web +- google_maps_flutter - google_maps_flutter_web - google_sign_in - google_sign_in_web From 210e1f2734ecf3321d0cdc80183581223767264f Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Tue, 6 Jun 2023 16:38:06 -0400 Subject: [PATCH 2/6] [tool] Only run unit tests in Chrome for inline web Currently we are running Dart unit tests in Chrome for any plugin with web support, but it should only be necessary for plugins that have an inline web implementation, not for app-facing packages that endorse a web implementation. --- script/configs/windows_unit_tests_exceptions.yaml | 8 -------- script/tool/lib/src/test_command.dart | 4 +++- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/script/configs/windows_unit_tests_exceptions.yaml b/script/configs/windows_unit_tests_exceptions.yaml index b837d567713..76396080fb7 100644 --- a/script/configs/windows_unit_tests_exceptions.yaml +++ b/script/configs/windows_unit_tests_exceptions.yaml @@ -11,20 +11,12 @@ # Unit tests for plugins that support web currently run in # Chrome, which isn't currently supported by web infrastructure. # TODO(ditman): Fix this in the repo tooling. -- camera - camera_web -- file_selector - file_selector_web -- google_maps_flutter - google_maps_flutter_web -- google_sign_in - google_sign_in_web -- image_picker - image_picker_for_web -- shared_preferences - shared_preferences_web -- url_launcher - url_launcher_web -- video_player - video_player_web - webview_flutter_web diff --git a/script/tool/lib/src/test_command.dart b/script/tool/lib/src/test_command.dart index 5101b8f19e7..5c793f63ed4 100644 --- a/script/tool/lib/src/test_command.dart +++ b/script/tool/lib/src/test_command.dart @@ -66,7 +66,9 @@ class TestCommand extends PackageLoopingCommand { '--color', if (experiment.isNotEmpty) '--enable-experiment=$experiment', // TODO(ditman): Remove this once all plugins are migrated to 'drive'. - if (pluginSupportsPlatform(platformWeb, package)) '--platform=chrome', + if (pluginSupportsPlatform(platformWeb, package, + requiredMode: PlatformSupport.inline)) + '--platform=chrome', ], workingDir: package.directory, ); From 94492b5792cf318de39a47d7dc6352b82dd7ad4b Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Tue, 6 Jun 2023 16:41:44 -0400 Subject: [PATCH 3/6] Add unit test --- script/tool/test/test_command_test.dart | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/script/tool/test/test_command_test.dart b/script/tool/test/test_command_test.dart index 5d34e390fd0..c4c655bf719 100644 --- a/script/tool/test/test_command_test.dart +++ b/script/tool/test/test_command_test.dart @@ -15,7 +15,7 @@ import 'mocks.dart'; import 'util.dart'; void main() { - group('$TestCommand', () { + group('TestCommand', () { late FileSystem fileSystem; late Platform mockPlatform; late Directory packagesDir; @@ -239,6 +239,27 @@ void main() { ); }); + test('Does not run on Chrome for web endorsements', () async { + final RepositoryPackage plugin = createFakePlugin( + 'plugin', + packagesDir, + extraFiles: ['test/empty_test.dart'], + platformSupport: { + platformWeb: const PlatformDetails(PlatformSupport.federated), + }, + ); + + await runCapturingPrint(runner, ['test']); + + expect( + processRunner.recordedCalls, + orderedEquals([ + ProcessCall(getFlutterCommand(mockPlatform), + const ['test', '--color'], plugin.path), + ]), + ); + }); + test('enable-experiment flag', () async { final RepositoryPackage plugin = createFakePlugin('a', packagesDir, extraFiles: ['test/empty_test.dart']); From ecf06e55fcf63a9fc72f6defed7d5e2f22caf2e5 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Tue, 6 Jun 2023 18:30:05 -0400 Subject: [PATCH 4/6] Enable multidex in local_auth --- packages/local_auth/local_auth/example/android/app/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/local_auth/local_auth/example/android/app/build.gradle b/packages/local_auth/local_auth/example/android/app/build.gradle index 191167b5fe9..0520ad0e2b6 100644 --- a/packages/local_auth/local_auth/example/android/app/build.gradle +++ b/packages/local_auth/local_auth/example/android/app/build.gradle @@ -36,6 +36,7 @@ android { versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + multiDexEnabled true } buildTypes { From 46741229bc38d62ef1fefee3cefee112027a36d3 Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Tue, 6 Jun 2023 19:41:10 -0400 Subject: [PATCH 5/6] Remove illegal character from test --- .../video_player/video_player/test/video_player_test.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/video_player/video_player/test/video_player_test.dart b/packages/video_player/video_player/test/video_player_test.dart index ef4f0bfa210..bef0298c80c 100644 --- a/packages/video_player/video_player/test/video_player_test.dart +++ b/packages/video_player/video_player/test/video_player_test.dart @@ -350,12 +350,12 @@ void main() { test('file with special characters', () async { final VideoPlayerController controller = - VideoPlayerController.file(File('A #1 Hit?.avi')); + VideoPlayerController.file(File('A #1 Hit.avi')); await controller.initialize(); final String uri = fakeVideoPlayerPlatform.dataSources[0].uri!; expect(uri.startsWith('file:///'), true, reason: 'Actual string: $uri'); - expect(uri.endsWith('/A%20%231%20Hit%3F.avi'), true, + expect(uri.endsWith('/A%20%231%20Hit.avi'), true, reason: 'Actual string: $uri'); }, skip: kIsWeb /* Web does not support file assets. */); From f454adb8a689545e4c8c9219dd19c735810aabc8 Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Tue, 6 Jun 2023 19:43:00 -0400 Subject: [PATCH 6/6] Re-remove google_maps_flutter from exceptions --- script/configs/windows_unit_tests_exceptions.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/script/configs/windows_unit_tests_exceptions.yaml b/script/configs/windows_unit_tests_exceptions.yaml index 86ff053b6de..76396080fb7 100644 --- a/script/configs/windows_unit_tests_exceptions.yaml +++ b/script/configs/windows_unit_tests_exceptions.yaml @@ -13,7 +13,6 @@ # TODO(ditman): Fix this in the repo tooling. - camera_web - file_selector_web -- google_maps_flutter - google_maps_flutter_web - google_sign_in_web - image_picker_for_web