From 3fb6b28db7e602c12df145049338a1acdd7fe168 Mon Sep 17 00:00:00 2001 From: Michael Klimushyn Date: Fri, 18 Oct 2019 15:55:54 -0700 Subject: [PATCH 1/2] Fix testing instructions in CONTRIBUTING.md --- CONTRIBUTING.md | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e6e3e957af29..589a63149ad0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,26 +42,46 @@ USB and debugging enabled on that device. ## Running the tests -Flutter plugins have both unit tests of their Dart API and integration tests that run on a virtual or actual device. +### Integration tests -To run the unit tests: +To run the integration tests using Flutter driver: -``` -flutter test test/_test.dart +```console +cd example +flutter drive test/.dart ``` -To run the integration tests using Flutter driver: +To run integration tests as instrumentation tests on a local Android device: -``` +```console +flutter build apk cd example -flutter drive test/.dart +(cd android && ./gradlew -Ptarget=$(pwd)/../test_live/_test.dart connectedAndroidTest) ``` -To run integration tests as instrumentation tests on a local Android device: +These tests may also live in "flutter_driver" folders, and have filenames ending +with "e2e." +### Dart unit tests + +To run the unit tests: + +```console +flutter test test/_test.dart ``` + +### Java unit tests + +These can be ran through Android Studio once the example app is opened as an +Android project. + +Without Android Studio, they can be ran through the terminal. + +```console cd example -(cd android && ./gradlew -Ptarget=$(pwd)/../test_live/_test.dart connectedAndroidTest) +flutter build apk +cd android +./gradlew test ``` ## Contributing code From c4911c8650cd6e18969dc24ec557a5b3818886bb Mon Sep 17 00:00:00 2001 From: Michael Klimushyn Date: Tue, 29 Oct 2019 09:05:48 -0700 Subject: [PATCH 2/2] Review fixup. --- CONTRIBUTING.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 589a63149ad0..493bf7f55c25 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,19 +48,19 @@ To run the integration tests using Flutter driver: ```console cd example -flutter drive test/.dart +flutter drive test_driver/.dart ``` To run integration tests as instrumentation tests on a local Android device: ```console -flutter build apk cd example -(cd android && ./gradlew -Ptarget=$(pwd)/../test_live/_test.dart connectedAndroidTest) +flutter build apk +cd android && ./gradlew -Ptarget=$(pwd)/../test_driver/_test.dart app:connectedAndroidTest ``` -These tests may also live in "flutter_driver" folders, and have filenames ending -with "e2e." +These tests may also be in folders just named "test," or have filenames ending +with "e2e". ### Dart unit tests