Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Move exclude lists from Cirrus config to config files
  • Loading branch information
stuartmorgan-g committed Jul 22, 2021
commit 39149cf2dd9dbf2d7ca5da2b278eca1531ad6646
36 changes: 5 additions & 31 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ task:
CHANNEL: "stable"
tool_script:
- cd script/tool
- dart analyze --fatal-infos --custom_analysis=configs/custom_analysis.yaml
- dart analyze --fatal-infos --custom_analysis=script/configs/custom_analysis.yaml
script:
- ./script/tool_runner.sh analyze
### Android tasks ###
Expand Down Expand Up @@ -137,22 +137,6 @@ task:
CHANNEL: "stable"
MAPS_API_KEY: ENCRYPTED[596a9f6bca436694625ac50851dc5da6b4d34cba8025f7db5bc9465142e8cd44e15f69e3507787753accebfc4910d550]
GCLOUD_FIREBASE_TESTLAB_KEY: ENCRYPTED[07586610af1fdfc894e5969f70ef2458341b9b7e9c3b7c4225a663b4a48732b7208a4d91c3b7d45305a6b55fa2a37fc4]
# Currently missing harness files (https://github.com/flutter/flutter/issues/86749):
# camera/camera
# google_sign_in/google_sign_in
# in_app_purchase/in_app_purchase
# in_app_purchase_android
# quick_actions
# shared_preferences/shared_preferences
# url_launcher/url_launcher
# video_player/video_player
# webview_flutter
# Deprecated; no plan to backfill the missing files:
# android_intent,connectivity/connectivity,device_info/device_info,sensors,share,wifi_info_flutter/wifi_info_flutter
# No integration tests to run:
# image_picker/image_picker - Native UI is the critical functionality
# espresso - No Dart code, so no integration tests
PLUGINS_TO_EXCLUDE_INTEGRATION_TESTS: "camera/camera,google_sign_in/google_sign_in,in_app_purchase/in_app_purchase,in_app_purchase_android,quick_actions,shared_preferences/shared_preferences,url_launcher/url_launcher,video_player/video_player,webview_flutter,android_intent,connectivity/connectivity,device_info/device_info,sensors,share,wifi_info_flutter/wifi_info_flutter,image_picker/image_picker,espresso"
build_script:
# Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they
# might include non-ASCII characters which makes Gradle crash.
Expand All @@ -175,16 +159,13 @@ task:
- export CIRRUS_COMMIT_MESSAGE=""
- if [[ -n "$GCLOUD_FIREBASE_TESTLAB_KEY" ]]; then
- echo $GCLOUD_FIREBASE_TESTLAB_KEY > ${HOME}/gcloud-service-key.json
- ./script/tool_runner.sh firebase-test-lab --device model=flame,version=29 --device model=starqlteue,version=26 --exclude $PLUGINS_TO_EXCLUDE_INTEGRATION_TESTS
- ./script/tool_runner.sh firebase-test-lab --device model=flame,version=29 --device model=starqlteue,version=26 --exclude=script/configs/exclude_integration_android.yaml
- else
- echo "This user does not have permission to run Firebase Test Lab tests."
- fi
### Web tasks ###
- name: build-web+drive-examples
env:
# Currently missing; see https://github.com/flutter/flutter/issues/81982
# and https://github.com/flutter/flutter/issues/82211
PLUGINS_TO_EXCLUDE_INTEGRATION_TESTS: "file_selector,shared_preferences_web"
matrix:
CHANNEL: "master"
CHANNEL: "stable"
Expand All @@ -197,7 +178,7 @@ task:
build_script:
- ./script/tool_runner.sh build-examples --web
drive_script:
- ./script/tool_runner.sh drive-examples --web --exclude $PLUGINS_TO_EXCLUDE_INTEGRATION_TESTS
- ./script/tool_runner.sh drive-examples --web --exclude=script/configs/exclude_integration_web.yaml

# macOS tasks.
task:
Expand All @@ -219,10 +200,6 @@ task:
- name: build-ipas+drive-examples
env:
PATH: $PATH:/usr/local/bin
# in_app_purchase_ios is currently missing tests; see https://github.com/flutter/flutter/issues/81695
# ios_platform_images is currently missing tests; see https://github.com/flutter/flutter/issues/82208
# sensor hangs on CI.
PLUGINS_TO_EXCLUDE_INTEGRATION_TESTS: "in_app_purchase_ios,ios_platform_images,sensors"
matrix:
PLUGIN_SHARDING: "--shardIndex 0 --shardCount 4"
PLUGIN_SHARDING: "--shardIndex 1 --shardCount 4"
Expand All @@ -245,7 +222,7 @@ task:
# `drive-examples` contains integration tests, which changes the UI of the application.
# This UI change sometimes affects `xctest`.
# So we run `drive-examples` after `xctest`, changing the order will result ci failure.
- ./script/tool_runner.sh drive-examples --ios --exclude $PLUGINS_TO_EXCLUDE_INTEGRATION_TESTS
- ./script/tool_runner.sh drive-examples --ios --exclude=script/configs/exclude_integration_ios.yaml
### macOS desktop tasks ###
- name: build_all_plugins_macos
env:
Expand All @@ -257,9 +234,6 @@ task:
- ./script/build_all_plugins_app.sh macos
- name: build-macos+drive-examples
env:
# conncectivity_macos is deprecated, so is not getting unit test backfill.
# package_info is deprecated, so is not getting unit test backfill.
PLUGINS_TO_EXCLUDE_MACOS_XCTESTS: "connectivity_macos,package_info"
matrix:
CHANNEL: "master"
CHANNEL: "stable"
Expand All @@ -270,6 +244,6 @@ task:
xcode_analyze_script:
- ./script/tool_runner.sh xcode-analyze --macos
xctest_script:
- ./script/tool_runner.sh xctest --macos --exclude $PLUGINS_TO_EXCLUDE_MACOS_XCTESTS
- ./script/tool_runner.sh xctest --macos --exclude=script/configs/exclude_native_macos.yaml
drive_script:
- ./script/tool_runner.sh drive-examples --macos
22 changes: 22 additions & 0 deletions script/configs/exclude_integration_android.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Currently missing harness files: https://github.com/flutter/flutter/issues/86749)
- camera/camera
- google_sign_in/google_sign_in
- in_app_purchase/in_app_purchase
- in_app_purchase_android
- quick_actions
- shared_preferences/shared_preferences
- url_launcher/url_launcher
- video_player/video_player
- webview_flutter

# Deprecated; no plan to backfill the missing files
- android_intent
- connectivity/connectivity
- device_info/device_info
- sensors
- share
- wifi_info_flutter/wifi_info_flutter

# No integration tests to run:
- image_picker/image_picker
- espresso
6 changes: 6 additions & 0 deletions script/configs/exclude_integration_ios.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Currently missing: https://github.com/flutter/flutter/issues/81695
- in_app_purchase_ios
# Currently missing: https://github.com/flutter/flutter/issues/82208
- ios_platform_images
# Hangs on CI. Deprecated, so there is no plan to fix it.
- sensors
5 changes: 5 additions & 0 deletions script/configs/exclude_integration_web.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

# Currently missing: https://github.com/flutter/flutter/issues/81982
- shared_preferences_web
# Currently missing: https://github.com/flutter/flutter/issues/82211
- file_selector
4 changes: 4 additions & 0 deletions script/configs/exclude_native_macos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

# Deprecated plugins that will not be getting unit test backfill.
- connectivity_macos
- package_info
13 changes: 12 additions & 1 deletion script/tool/lib/src/common/plugin_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'package:file/file.dart';
import 'package:git/git.dart';
import 'package:path/path.dart' as p;
import 'package:platform/platform.dart';
import 'package:yaml/yaml.dart';

import 'core.dart';
import 'git_version_finder.dart';
Expand Down Expand Up @@ -214,8 +215,18 @@ abstract class PluginCommand extends Command<void> {
/// of packages in the flutter/packages repository.
Stream<Directory> _getAllPlugins() async* {
Set<String> plugins = Set<String>.from(getStringListArg(_packagesArg));

final Set<String> excludedPlugins =
Set<String>.from(getStringListArg(_excludeArg));
getStringListArg(_excludeArg).expand<String>((String item) {
if (item.endsWith('.yaml')) {
final File file = packagesDir.fileSystem.file(item);
return (loadYaml(file.readAsStringSync()) as YamlList)
.toList()
.cast<String>();
}
return <String>[item];
}).toSet();

final bool runOnChangedPackages = getBoolArg(_runOnChangedPackagesArg);
if (plugins.isEmpty &&
runOnChangedPackages &&
Expand Down
13 changes: 13 additions & 0 deletions script/tool/test/common/plugin_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,19 @@ void main() {
expect(plugins, unorderedEquals(<String>[plugin2.path]));
});

test('exclude accepts config files', () async {
createFakePlugin('plugin1', packagesDir);
final File configFile = packagesDir.childFile('exclude.yaml');
configFile.writeAsStringSync('- plugin1');

await runCapturingPrint(runner, <String>[
'sample',
'--packages=plugin1',
'--exclude=${configFile.path}'
]);
expect(plugins, unorderedEquals(<String>[]));
});

group('test run-on-changed-packages', () {
test('all plugins should be tested if there are no changes.', () async {
final Directory plugin1 = createFakePlugin('plugin1', packagesDir);
Expand Down