Files
stuartmorgan ce899a3151 Ensure that integration tests are actually being run (#3857)
Many of our integration tests weren't actually being run on CI because they were in the wrong place and/or missing the driver file, and it seems we've just never noticed. This makes a number of changes:
- Ensures that all packages with integration tests also have a driver file in the right location.
  - Also standardizes the format of those files, as the boilerplate `main()` is available in `integration_test`.
- Ensures that all integration_test directories are in the right place.
  - In a couple of places, removes a duplicate copy of the integration test file.
- Makes it an error for a plugin that's not excluded to not have integration tests, so this can't easily happen again.
- Adds logging of what's being run and skipped, so if something does go wrong in the future it's easy to determine what from the logs.
  - Excludes `*_platform_interface` since the logging was (potentially confusingly) reporting that they were skipped because they don't support the current platform. Skipping them is correct, just not for that reason.
- Excludes the plugins that currently have no integration tests, with references to issues about adding them.

Fixes https://github.com/flutter/flutter/issues/81929
2021-05-10 11:14:45 -07:00
..
2021-04-29 20:05:38 -07:00

Flutter Plugin Tools

This is a set of utilities used in the flutter/plugins and flutter/packages repositories. It is no longer explictily maintained as a general-purpose tool for multi-package repositories, so your mileage may vary if using it in other repositories.


Note: The commands in tools are designed to run at the root of the repository or <repository-root>/packages/.

To run the tool (in flutter/plugins):

cd <path_to_plugins>/script/tool && dart pub get && cd ../../
dart run ./script/tool/lib/src/main.dart <args>

Format Code

cd <path_to_plugins>
dart run /script/tool/lib/src/main.dart format --plugins plugin_name

Run static analyzer

cd <path_to_plugins>
pub run ./script/tool/lib/src/main.dart analyze --plugins plugin_name

Run Dart unit tests

cd <path_to_plugins>
pub run ./script/tool/lib/src/main.dart test --plugins plugin_name

Run XCTests

cd <path_to_plugins>
dart run lib/src/main.dart xctest --target RunnerUITests --skip <plugins_to_skip>

Publish and tag release

sh cd <path_to_plugins> git checkout <commit_hash_to_publish> dart run ./script/tool/lib/src/main.dart publish-plugin --package <package>

By default the tool tries to push tags to the upstream remote, but some additional settings can be configured. Run dart run ./script/tool/lib/src/main.dart publish-plugin --help for more usage information.

The tool wraps pub publish for pushing the package to pub, and then will automatically use git to try to create and push tags. It has some additional safety checking around pub publish too. By default pub publish publishes everything, including untracked or uncommitted files in version control. publish-plugin will first check the status of the local directory and refuse to publish if there are any mismatched files with version control present.

There is a lot about this process that is still to be desired. Some top level items are being tracked in flutter/flutter#27258.