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

Adds test harnesses for integration tests on Android #4200

Merged
merged 9 commits into from Jul 30, 2021

Conversation

bparrishMines
Copy link
Contributor

@bparrishMines bparrishMines commented Jul 27, 2021

Fixes flutter/flutter#83358

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.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@bparrishMines bparrishMines requested review from stuartmorgan and blasten and removed request for cyanglaz July 28, 2021 04:12
@stuartmorgan
Copy link
Contributor

Hm, it looks like something may be wrong with the sharding logic? I'm not seeing most of these plugins showing up in the run, either as run or skipped. I'll try to investigate that later today.

@stuartmorgan
Copy link
Contributor

I spent way too long debugging that locally (with no success) before realizing that the problem is that the exclude list wasn't updated, so those plugins are being excluded. This PR will need to remove all the plugins that are now supported from exclude_integration_android.yaml

(This did highlight that exclude and sharding interact oddly, so I'll fix that separately.)

@@ -36,6 +36,7 @@ android {
applicationId "io.flutter.plugins.imagepicker.example"
minSdkVersion 16
targetSdkVersion 28
multiDexEnabled true
Copy link

Choose a reason for hiding this comment

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

did it hit the 64K limit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea it did. And same for the other plugins that I also added the property to in this PR

import 'package:integration_test/integration_test.dart';

void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

testWidgets('placeholder test', (WidgetTester tester) async {});
Copy link

Choose a reason for hiding this comment

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

does the old_ prefix in the filename mean something?

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 dont think it does. It was just an empty test before. I think we just never changed the test name: https://github.com/flutter/plugins/commits/master/packages/image_picker/image_picker/example/integration_test

I changed it to just Image_picker_test.dart.

androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
api 'androidx.test:core:1.2.0'
Copy link

Choose a reason for hiding this comment

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

do you know why this requires api instead of androidTestImplementation? https://developer.android.com/training/testing/set-up-project#add-gradle-dependencies

Copy link

Choose a reason for hiding this comment

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

same for the other ones

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was the installation requirements for the espresso package. I wasn't able to get it to work with androidTestImplementation. I'm also not familiar enough with gradle to understand why its api without doing some more research.

Copy link

Choose a reason for hiding this comment

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

I see. this is probably due to flutter/flutter#56591

Copy link

@blasten blasten left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@stuartmorgan stuartmorgan left a comment

Choose a reason for hiding this comment

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

LGTM!

@bparrishMines bparrishMines added the waiting for tree to go green (Use "autosubmit") This PR is approved and tested, but waiting for the tree to be green to land. label Jul 30, 2021
@fluttergithubbot fluttergithubbot merged commit 97fa266 into flutter:master Jul 30, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 30, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 30, 2021
@bparrishMines bparrishMines deleted the scaffolding branch August 5, 2021 23:32
fotiDim pushed a commit to fotiDim/plugins that referenced this pull request Sep 13, 2021
amantoux pushed a commit to amantoux/plugins that referenced this pull request Sep 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes p: google_maps_flutter p: google_sign_in p: image_picker p: quick_actions platform-android waiting for tree to go green (Use "autosubmit") This PR is approved and tested, but waiting for the tree to be green to land.
Projects
None yet
4 participants