[go: nahoru, domu]

Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

[flutter_plugin_tools] Replace xctest and java-test with native-test #4176

Merged
merged 9 commits into from
Jul 22, 2021

Conversation

stuartmorgan
Copy link
Contributor

Creates a new native-test command that will be used to run native unit and UI/integration tests for all platforms over time. This replaces both xctest and java-test.

For CI we can continue to run each platform separately for clarity, but the combined command makes it easier to use (and remember how to use) for local development, as well as avoiding the need to introduce several new commands for desktop testing as support for that is added to the tool.

Fixes flutter/flutter#84392
Fixes flutter/flutter#86489

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Note that unlike the flutter/flutter repo, the flutter/plugins repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
  • I updated CHANGELOG.md to add a description of the change.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test exempt.
  • All existing and new tests are passing.

@stuartmorgan
Copy link
Contributor Author
stuartmorgan commented Jul 21, 2021

It looks like the overall change broke the rename detection threshold, so it'll be easier to review the individual commits rather than the whole PR's diff.

Also, if you'd rather I split this into "convert xctest to native-test" and "fold java-test into native-test" as separate PRs I can easily do that. I was going to do it initially, but I thought seeing what it looked like with more than one platform's test might make the overall structure clearer.

Copy link
Member
@jmagman jmagman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM w/ spelling nit

extraFlags: _iosDestinationFlags);
}

Future<_PlatformResult> _testMacOs(Directory plugin, _TestMode mode) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Future<_PlatformResult> _testMacOs(Directory plugin, _TestMode mode) {
Future<_PlatformResult> _testMacOS(Directory plugin, _TestMode mode) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I never know what to do with iOS and macOS in Dart code :P I hadn't realized there was an exception for two-letter acronyms in Dart style though, thanks for flagging this!

if (mode.unitOnly) {
testTarget = 'RunnerTests';
} else if (mode.integrationOnly) {
testTarget = 'RunnerUITests';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to address it in this PR since I know this was copied, but I just remembered about the image_picker RunnerUITestiOS14 target. It probably doesn't make sense for that to be a separate target, I wasn't involved in the recent creation of that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I found that when checking the repo to make sure this would work, and discussed it with folks this morning; it should get folded back in in the next day or two.

@stuartmorgan stuartmorgan merged commit b6d1345 into flutter:master Jul 22, 2021
@stuartmorgan stuartmorgan deleted the native-tests branch July 22, 2021 18:14
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 27, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 27, 2021
fotiDim pushed a commit to fotiDim/plugins that referenced this pull request Sep 13, 2021
…lutter#4176)

Creates a new `native-test` command that will be used to run native unit and UI/integration tests for all platforms over time. This replaces both `xctest` and `java-test`.

For CI we can continue to run each platform separately for clarity, but the combined command makes it easier to use (and remember how to use) for local development, as well as avoiding the need to introduce several new commands for desktop testing as support for that is added to the tool.

Fixes flutter/flutter#84392
Fixes flutter/flutter#86489
amantoux pushed a commit to amantoux/plugins that referenced this pull request Sep 27, 2021
…lutter#4176)

Creates a new `native-test` command that will be used to run native unit and UI/integration tests for all platforms over time. This replaces both `xctest` and `java-test`.

For CI we can continue to run each platform separately for clarity, but the combined command makes it easier to use (and remember how to use) for local development, as well as avoiding the need to introduce several new commands for desktop testing as support for that is added to the tool.

Fixes flutter/flutter#84392
Fixes flutter/flutter#86489
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
2 participants