Commit Graph

2136 Commits

Author SHA1 Message Date
Devon Carew
0b5072c2ef fix check to ignore bots (#4034) 2016-05-19 10:51:31 -07:00
Ian Hickson
3252701753 Make it possible to run tests live on a device (#3936)
This makes it possible to substitute 'flutter run' for 'flutter test'
and actually watch a test run on a device.

For any test that depends on flutter_test:

1. Remove any import of 'package:test/test.dart'.

2. Replace `testWidgets('...', (WidgetTester tester) {`
      with `testWidgets('...', (WidgetTester tester) async {`

3. Add an "await" in front of calls to any of the following:
    * tap()
    * tapAt()
    * fling()
    * flingFrom()
    * scroll()
    * scrollAt()
    * pump()
    * pumpWidget()

4. Replace any calls to `tester.flushMicrotasks()` with calls to
   `await tester.idle()`.

There's a guarding API that you can use, if you have particularly
complicated tests, to get better error messages. Search for
TestAsyncUtils.
2016-05-16 12:53:13 -07:00
Devon Carew
483922d15c allow per-command analytics suppression (#3919)
* allow per-command analytics suppression

* rev the usage package dep
2016-05-15 20:06:27 -07:00
Devon Carew
40c0d6ea12 Consolidate observatory code (#3892)
* rename service_protocol.dart to protocol_discovery.dart

* add a wrapper around the obs. protocol

* use json-rpc in run

* consolidate obs. code; implement flutter run --benchmark

* review comments
2016-05-12 18:15:23 -07:00
Jason Simmons
32846de9f8 Remove ArtifactStore and move flutterRoot into Cache (#3883) 2016-05-12 15:54:35 -07:00
Jason Simmons
a590ee2671 Remove BuildConfigurations (#3879)
Artifacts from local engine builds will be found based on the --local-engine flag
2016-05-12 12:22:15 -07:00
Jason Simmons
0f53f7966b Remove Toolchain and extend ToolConfiguration to locate host tools such as sky_snapshot (#3870)
Host tools can be found in the artifact cache directory for the host platform.
If a developer wants to use a local engine build instead, then provide an
--engine-build flag that selects the specific engine build variant.
2016-05-11 15:47:26 -07:00
Devon Carew
826936cd33 use vendored dart sdk; check the expected version of flutter (#3831)
* use vendored dart sdk; check the expected version of flutter

* search up directories looking for the flutter root
2016-05-10 16:21:30 -07:00
Jason Simmons
6ab77622e4 Update flutter_tools for the "unoptimized" engine build flag and the new output directory naming scheme (#3832) 2016-05-10 12:02:09 -07:00
Hans Muller
74c3e74fba Call it Flutter Gallery (#3801) 2016-05-09 11:00:54 -07:00
Devon Carew
a5b198e9b9 remove the --checked option (#3799) 2016-05-09 10:58:47 -07:00
pq
4311ddb461 Duplicate test fix. 2016-05-05 13:39:58 -07:00
pq
79d1d3a7c4 Prefer implict equals matcher in test expectations.
@Hixie: as per our conversation, a little more concise.
2016-05-04 13:58:45 -07:00
Devon Carew
e365453eac better parsing of adb devices output (#3726)
* better parsing of adb devices output

* re-order lines
2016-05-04 12:32:46 -07:00
Devon Carew
713830964c make the usage text more visible (#3693)
* make the usage text more visible

* update the look of the usage text
2016-05-03 15:17:30 -07:00
Devon Carew
c9010c91f6 fix analysis errors (#3677)
* fix analysis errors

* review comments; fix test

* re-add an export for debugPrint
2016-05-03 09:09:00 -07:00
Devon Carew
60755f6d9c fix an issue parsing adb output (#3629) 2016-04-29 09:52:44 -07:00
Devon Carew
b0dca79671 Flutter run (#3553)
* rework flutter run

* fix npe with --debug-port

* connect to obs and exit when that conneciton closes

* update todos
2016-04-27 14:43:42 -07:00
Devon Carew
adac927501 add google analytics to flutter_tools (#3523)
* add google analytics

* send in the run target type

* track device type targets

* use the real GA code

* review comments

* rev to usage 2.0

* rev to 2.2.0 of usage; add tests

* review comments
2016-04-26 16:25:11 -07:00
Devon Carew
435fdbff25 move driver create test to the flutter_tools package (#3433)
* move driver create test to the flutter_tools package

* review comments
2016-04-20 10:48:27 -07:00
Devon Carew
80fabfd3dd allow flutter create to re-gen over an existing project (#3419)
* allow flutter create to re-gen over an existing project

* add a regression test
2016-04-19 19:30:49 -07:00
Devon Carew
6f0bb20658 rename deploy to release (#3407) 2016-04-19 11:17:00 -07:00
Devon Carew
1c0a966384 rename the --develop option to --debug (#3384)
* rename the --develop option to --debug

* fail if both --debug and --deploy are specified
2016-04-18 16:41:15 -07:00
Devon Carew
29fdc7a464 rename the --release and --debug flags (#3382) 2016-04-18 13:04:59 -07:00
Devon Carew
12cac94cda Use arm deploy (#3374)
* download android-arm-deploy

* wire up --deploy to android-arm-deploy

* fix interpolation
2016-04-18 09:01:43 -07:00
Devon Carew
f132acaf1d use the new cache code to locate more artifacts (#3361)
* use the new cache code to locate more artifacts

* add todo

* review comments
2016-04-15 21:08:03 -07:00
Devon Carew
2a33e3f0c0 make flutter upgrade less verbose (#3237)
* more terse flutter upgrade

* fix an issue when updating and the engine update code has changed

* call flutter precache; add a --no-color hidden option

* fix a lint related to getters/setters
2016-04-11 11:17:09 -07:00
stevemessick
8847b86681 Add validity checks to create (#3215)
* Add validity checks to create

* Adjust indent
2016-04-08 20:37:50 -07:00
Jason Simmons
9d022ed26d Add a command that can capture a Skia picture of a Flutter frame and send it to a file or skiaserve debugger (#3165) 2016-04-07 12:33:11 -07:00
Devon Carew
653566dd23 simplify toolchain setup 2016-04-04 13:10:56 -07:00
Devon Carew
fe37825fd5 run pub with --no-package-symlinks 2016-03-29 19:02:14 -07:00
Yegor Jbanov
28b5186746 [driver] propagate exit code from package:test
Driver returns exit code 0 even when tests fail. This commit fixes it by
propagating the exit code set by `package:test`.
2016-03-28 16:19:20 -07:00
Chinmay Garde
c8377d7428 Dont differentiate between ios_arm and ios_x64 in flutter_tools
All artifacts for iOS are universal.
2016-03-21 14:41:26 -07:00
Devon Carew
f1cdf6df39 refactor; fix apk warning 2016-03-21 09:24:56 -07:00
Ian Hickson
a7016062bc Improve flutter create help text. 2016-03-20 20:06:30 -07:00
Devon Carew
99b70dab62 handle android n in the android sdk 2016-03-17 15:30:47 -07:00
John McCutchan
83e6ee36a0 Sniff service protocol port from device 2016-03-17 11:44:16 -07:00
Devon Carew
f8374cd966 consolidate build commands under the 'build' command 2016-03-17 07:22:41 -07:00
Hixie
797e27edd3 Add @override annotations to flutter framework 2016-03-14 14:02:26 -07:00
Adam Barth
e2744e9a30 Stop using a prebuilt APK
Instead, require an AndroidManifest.xml and always build an APK.

Fixes #2517
2016-03-14 13:32:00 -07:00
Ian Hickson
d745e20853 Even more types 2016-03-14 09:41:54 -07:00
Devon Carew
e939b152af rename the platform constants 2016-03-12 11:08:21 -08:00
Hixie
e6b82b6fa9 flutter analyze test
Test that flutter analyze catches no error if two imported libraries
have the same name.

Also, make tests know how to find the flutter root and fix style in one
test to be consistent with the rest of the file.
2016-03-11 14:26:38 -08:00
Devon Carew
5ad6a57007 remove some references to DeviceStore 2016-03-11 11:25:03 -08:00
Devon Carew
780e4e6212 move the analysis_options to a file 2016-03-10 13:47:20 -08:00
Yegor
c2b175d1db Merge pull request #2575 from yjbanov/ios-device-discovery
[ios] look for the best available devicetype/runtime when booting
2016-03-10 11:25:56 -08:00
Yegor Jbanov
9383466dd5 [ios] look for the best available devicetype/runtime when booting 2016-03-10 11:04:02 -08:00
Hixie
c7339de6bc Enable always_declare_return_types lint
And fix a zillion omissions this uncovered.
2016-03-09 17:57:39 -08:00
John McCutchan
9cb7001a39 Add ServiceProtocolDiscovery 2016-03-08 15:13:48 -08:00
Devon Carew
52efc7fb68 implement --watch for flutter analyze 2016-03-07 13:46:42 -08:00
Steve Messick
913315bc87 Improve the error message when a target is specified but not found.
https://github.com/flutter/flutter/issues/2368
2016-03-07 08:53:33 -08:00
Steve Messick
cea21fb7b1 Merge remote-tracking branch 'upstream/master' 2016-03-04 14:38:55 -08:00
Steve Messick
2e878746a3 Improve message when target not found 2016-03-04 14:36:32 -08:00
Devon Carew
c1caa26989 fix a mac test 2016-03-04 13:10:51 -08:00
Devon Carew
8283ce87e2 fix the stop command tests 2016-03-03 13:58:49 -08:00
Devon Carew
022047f5eb remove the isConnected() method from device 2016-02-26 13:23:48 -08:00
Yegor Jbanov
677e63b79d decouple flutter drive from flutter start
flutter start's method of finding devices to run the app on is not suitable for flutter drive.

This commit also refactors several tool services to allow mocking in unit tests.
2016-02-26 10:18:24 -08:00
Devon Carew
37290d866e additional validation for device commands 2016-02-24 11:11:23 -08:00
Yegor
3301ae7d09 Merge pull request #2097 from yjbanov/flutter-driver-create
"flutter create" can generate a basic driver test; "flutter drive" gains new options
2016-02-22 17:18:54 -08:00
yjbanov
278630e688 "flutter create" can generate a basic driver test
"flutter create" adds option `--with-driver-test` that adds
dependencies to `flutter_driver` in `pubspec.yaml` and creates
a basic driver test runnable via `flutter drive
--target=test_driver/e2e.dart`

"flutter drive" new options:

- `--keep-app-running` tells the driver to not stop the app after tests
  are done
- `--use-existing-app` tells the driver to not start a new app but use
  an already running instance
2016-02-22 17:10:31 -08:00
Devon Carew
3463d89cf6 remove iosSimulator field from ApplicationPackageStore 2016-02-22 12:37:08 -08:00
Devon Carew
67046f933d add the ability to start and stop device polling 2016-02-20 22:00:11 -08:00
yjbanov
a2b1bd4673 "flutter drive" command
Runs a test app and a driver test simultaneously, then stops the app.

Usage:

```
flutter drive --target=/path/to/test/app.dart
```

This command will look for `/path/to/test/app_test.dart` by
convention. We will expand into other ways of discovering tests in the
future.
2016-02-19 18:11:53 -08:00
Chinmay Garde
9ed4e417d0 Fix flutter_tools tests 2016-02-19 11:48:39 -08:00
Chinmay Garde
df946dd875 iOS: Treat the initial Info.plist string as a mustache template.
Use the project name to initialize the bundle name and identifier
2016-02-19 11:37:05 -08:00
Devon Carew
d5a6fceee5 add a summary option to the doctor class 2016-02-17 09:33:45 -08:00
Devon Carew
7ae6f7f391 make the ios development path less mandatory 2016-02-17 00:38:47 -08:00
Devon Carew
cc72bbc7ec rename list->devices, start->run 2016-02-13 23:50:20 -08:00
Devon Carew
dcf0b7bae6 allow any android sdk version 2016-02-13 14:37:41 -08:00
Devon Carew
2dbceafbc6 introduce globals scoped to the app's context 2016-02-09 22:03:13 -08:00
Eric Seidel
91c2255894 Skip flutter_simple in create_test on Mac for now
Returns 69 instead of 0 in the `create --out` part.
https://github.com/flutter/flutter/issues/1709

@devoncarew
2016-02-09 05:26:21 -08:00
Devon Carew
9e6d45cb03 general refactoring around device management
remove the device factory methods as well as the device cache
2016-02-06 11:49:48 -08:00
Matt Perry
5d2281b69b 'flutter start' calls 'flutter apk' if necessary.
flutter start no longer depends on a pre-built SkyShell.apk. It builds a
new one, as long as an AndroidManifest.xml exists.

We rebuild the .apk every time either AndroidManifest.xml or
flutter.yaml changes.
2016-02-03 12:21:20 -08:00
Collin Jackson
3094348ad4 Merge pull request #1483 from collinjackson/engine_safety
In addition to checking for the existence of the engine, ensure that it’s the correct version
2016-02-01 16:10:03 -08:00
Collin Jackson
beaffecb7b fix #1443 ensure engine is the correct version 2016-02-01 13:11:30 -08:00
Devon Carew
78e05884ed refactor flutter logs 2016-02-01 12:56:46 -08:00
Devon Carew
d7fbf5302d use status(), error(), and trace() for logging
rename to printTrace(), printStatus(), and printError()
2016-01-28 12:44:17 -08:00
Devon Carew
76d069f9c0 rename the init command to create 2016-01-27 14:37:29 -08:00
Devon Carew
7ac4e6248f refactor the list command 2016-01-27 14:03:41 -08:00
Devon Carew
080896a305 improve device notification support 2016-01-25 13:50:59 -08:00
Devon Carew
5bce2fbdec refactor platform specific code out of device.dart
remove device type specific checks
2016-01-22 10:51:49 -08:00
Devon Carew
5ac6f9313d Merge pull request #1305 from devoncarew/device_notification
Device notification
2016-01-20 10:03:56 -08:00
Devon Carew
87e6b9a082 name and grammar tweaks 2016-01-20 08:38:50 -08:00
Devon Carew
8bb8e1d9e7 add device notifications to the daemon command 2016-01-19 21:29:20 -08:00
Devon Carew
e5beea64d2 add tests 2016-01-19 14:33:02 -08:00
Devon Carew
ff74ba812d remove noSuchMethod hints 2015-12-21 14:57:20 -08:00
Adam Barth
9662d49e12 Clean up code organization in flutter_tools
1) Moved basic utility code into base/ directory to make it clear which code
   doesn't depend on Flutter-specific knowldge.
2) Move the CommandRunner subclasses into a runner/ directory because these
   aren't commands themselves.
2015-11-28 21:16:55 -08:00
Devon Carew
8500aca7ad fix analysis errors; add missing icon 2015-11-24 23:19:25 -08:00
Adam Barth
ae585eb12e Remove start_test
This test was a bad mock-based test that hasn't ever caught a bug but has
required a lot of maintenance. Currently its broken because its mock doesn't
match the real interface.
2015-11-24 17:44:15 -08:00
Adam Barth
860547c1d4 Add support for system-level routing
Now you can supply a route argument to flutter start:

  $ flutter start --route /foo

which will start the app at /foo instead of /.
2015-11-24 16:13:20 -08:00
Adam Barth
cada8b3faa Import path.dart as path rather than p
Fixes #311
2015-11-17 22:44:54 -08:00
Adam Barth
da0a12c611 Rename sky_tools to flutter_tools 2015-11-10 13:20:35 -08:00
Adam Barth
6e7f575950 flutter start should give better errors when it can't find main
Now we suggest using -t to specify the main Dart file.

Fixes #53
2015-11-09 11:31:11 -08:00
Adam Barth
2710e0f468 Teach flutter init how to depend on flutter using a relative path 2015-11-07 21:30:26 -08:00
Adam Barth
113500206a Remove the --http option 2015-11-06 20:17:24 -08:00
Adam Barth
3804107e2d Enable --no-http by default
We still have the --http option as a fallback for now. Once we're confident the
--no-http version works, we'll drop the --http support.

Also, create the FLX in a temp directory and then delete the temp directory
when we're done. Finally, pull the Linux artifacts from the cloud storage
bucket that the buildbot is uploading to.
2015-11-03 19:39:47 -08:00
Devon Carew
7d0a298b0b start a daemon command
wrap up first daemon implementation
2015-11-03 15:58:02 -08:00
Devon Carew
5dc4a7cce4 abstract some OS operations 2015-11-02 13:07:56 -08:00
Devon Carew
4c99319f5d Merge pull request #156 from devoncarew/skip_test_windows
skip a test on windows
2015-10-31 13:57:46 -07:00
Adam Barth
94b472ff67 Add a --no-http flag to start command
This flag builds a local FLX file and pushes that to the device instead of
using an HTTP server.
2015-10-31 12:18:03 -07:00
Devon Carew
39cf521896 skip a test on windows 2015-10-30 13:13:58 -07:00
Devon Carew
15acf8ef6b increase test timeout 2015-10-29 16:45:11 -07:00
Devon Carew
b7f918c92b change how we specify test timeout 2015-10-24 12:33:17 -07:00
Devon Carew
98d61fc181 create an all.dart test script to work around an issue with pub run test on windows 2015-10-24 12:28:05 -07:00
Devon Carew
e7da41afd5 Update init_test.dart
Increase the test timeout for the `init` test to 2 minutes (test was timing out downloading assets on appveyor).
2015-10-24 11:42:19 -07:00
Devon Carew
5dbeb8f018 fix tests on windows
remove a runInShell arg on windows when launching pub
2015-10-23 22:44:56 -07:00
Devon Carew
bb1da703a6 return exit codes on failures 2015-10-17 11:50:23 -07:00
Adam Barth
12f75817ce Refactor the build command so that it can be used internally
Instead of calling through `pub` to invoke build, this patch refactors the
build command so that it can be called directly.
2015-10-13 10:00:06 -07:00
Adam Barth
8df5e9f738 Polish up some error handling
This patch improves the error handling for several arbitrary issues I
encountered while experimenting with the tool this evening.
2015-10-12 00:55:13 -07:00
Adam Barth
bdd20661d7 Teach sky_tools about prebuilt artifacts
This patch makes `flutter start` work without a clone of the engine git
repository. Making this work pulled a relatively large refactor of how the
commands interact with application packages and devices. Now commands that want
to interact with application packages or devices inherit from a common base
class that holds stores of those objects as members.

In production, the commands download and connect to devices based on the build
configuration stored on the FlutterCommandRunner. In testing, these fields are
used to mock out the real application package and devices.
2015-10-12 00:03:55 -07:00
Ian Fischer
a6a3f212ee IOSSimulator implementation.
Also fixes some minor bugs with iOS and Android interactions.
2015-10-11 19:36:06 -07:00
Adam Barth
287817f224 Move Command subclasses into commands directory
I'm trying to get a feel for the code by writing some simple cleanup patches.
2015-10-09 23:22:20 -07:00
Ian Fischer
ae32410995 Get iOS devices working on Mac if you specify sky-src-path. 2015-10-09 16:23:33 -07:00
Ian Fischer
f4ec459c23 Add support for log commands on iOS. 2015-10-08 15:10:25 -07:00
Ian Fischer
844678ddce Add implementation of start and stop commands for iOS. 2015-10-07 15:44:02 -07:00
Devon Carew
3694517617 run tests sequentially 2015-10-06 16:00:24 -07:00
Devon Carew
f98f134ccf ws changes to prod the build 2015-10-06 15:48:04 -07:00
Ian Fischer
a9cbe436c4 Merge pull request #67 from iansf/ios_basics
Beginning implementation of IOSDevice. Implements list and install.
2015-10-06 14:20:53 -07:00
Devon Carew
524d8379f4 more verbose test failures 2015-10-06 12:08:08 -07:00
Ian Fischer
12192d00c1 Beginning implementation of IOSDevice. Implements list and install.
Also update tests to be compatible with the presence of iOS and add tests for list and install.
2015-10-06 11:46:29 -07:00
Ian Fischer
d07ca92995 Basic sky_tools list command, Android implementation, and test. 2015-10-01 08:43:57 -07:00
Ian Fischer
b8085cd033 Add sky_tools trace command, Android implementation, and basic test. 2015-09-30 14:02:29 -07:00
Ian Fischer
00bed774ce Add listen command and basic test, and don’t do unnecessary repeated work when listening or poking the android server. 2015-09-29 17:10:47 -07:00
Ian Fischer
6a5fe19540 Basic sky_tools logs test. 2015-09-29 14:26:42 -07:00
Ian Fischer
8cac55a4e2 Add sky_tools start command and associated android support. 2015-09-29 09:54:10 -07:00
Ian Fischer
fa59233746 Add stop command and supporting Android support. 2015-09-25 16:16:19 -07:00
Devon Carew
c35c06e6f2 rename sky ==> flutter in the starting app template 2015-09-25 13:28:21 -07:00
Ian Fischer
cae053c353 Refactor all the commands to be Commands from the Args package. Also use CommandRunner for the top-level command. 2015-09-24 15:51:23 -07:00
Ian Fischer
343d96a48e Some basic tests for AndroidDevice that don’t require a device to be attached. 2015-09-22 15:17:11 -07:00
Ian Fischer
0cc758d24e Set up plumbing for getting relevant paths to the right places without too much global state.
`dart bin/sky_tools.dart --debug --sky-src-path=/path/to/sky/src/ install` now works.
2015-09-22 11:17:39 -07:00
Ian Fischer
c5ea40980a Most of the infrastructure needed to install an APK on Android. 2015-09-16 12:56:10 -07:00
Devon Carew
e6b45c5023 use mokito in the init tests 2015-09-11 16:12:27 -07:00
Ian Fischer
ab441685e2 Test install command 2015-09-11 15:26:55 -07:00
Devon Carew
a03deafac8 update the sky_tools template and readme 2015-08-09 23:50:16 -07:00
Devon Carew
b114623b1a fix typo 2015-08-07 14:26:50 -07:00
Devon Carew
2efd13159c add a sky_tools init command to create a new project 2015-08-07 14:20:14 -07:00