Commit graph

871 commits

Author SHA1 Message Date
xster cda2c223f5
Turn on unawaited_futures in flutter_tools (#21048) 2018-08-30 20:57:44 -07:00
Chris Bracken 6d7ecab25c
Minor improvements to analyzer test naming (#21234)
Clarify the intent of these tests.
2018-08-30 14:07:34 -07:00
Alexander Aprelev e4b7e87bdd
Pass uri instead of filepaths when hot-reloading. (#21201)
* Pass uri instead of filepaths when hot-reloading.

Bug: https://github.com/flutter/flutter/issues/21168

* Remove imports. Enable another test

* Restore skipping of test on mac
2018-08-30 12:08:23 -07:00
Mikkel Nygaard Ravn 22832d3634
Support for flutter run/build module on iOS (#21216) 2018-08-30 16:18:44 +02:00
Greg Spencer 7cebaac985
Makes switching channels remove version freshness stamp. (#21182)
When switching between channels, we were leaving around the version freshness stamp file (bin/cache/flutter_version_check.stamp), which meant that the flutter tool would read from that file to see what the cached date of the most recent commit to the current channel (branch) was. The problem was that since the file was created while on the previous channel, the cached date was for the wrong channel, so if you switch from master to beta, flutter would think that the channel was out of date, and a new version was available, at least for three days after the first time it checked (after three days since the last time the freshness was checked, the cached date would get updated).

This PR modifies the channel command to remove that stamp file whenever the user switches channels, so that the cached date will be from the right channel when it is recreated.

Fixes #21134
2018-08-29 21:53:39 -07:00
Danny Tuppeny a9275d2154
Swap order of attach/stop in flutter_attach integration test (#21106)
This is a bit of a stab in the dark for a flake sometimes seen on bots (but I can't repro locally) #20822. Detaching from a Flutter app currently seems to terminate it, so it may be the cause of the "app not found" when trying to stop the app subsequently.

This change means we stop the app from the main process first, before terminating the attach process.
2018-08-29 07:58:11 +01:00
David Shuckerow 77095356e9
Attach command: add Bazel filesystem support (#21082) 2018-08-28 14:50:03 -06:00
Ian Hickson 53b635817c
Re-enable missing_return (#20844) 2018-08-28 11:22:57 -07:00
Danny Tuppeny 8b0227b4a3
Don't time out if process terminates when told to stop (#21103)
* Don't time out if process terminates when told to stop but response was not processed

While trying to reproduce #20822 I found a condition where the app may quit before the `app.stop` response is received but this code (which is called in integration test teardown) would sit around waiting and time out. With this change, the process exit is considered a valid response to the stop request.

* Add process exit to log for better errors in failures

This log can be turned on for debugging but is also dumped when a test fails (in certain conditions). With this in the log, it'll be clear if the timeout is because we're waiting for an event but the process quit.
2018-08-28 18:26:46 +01:00
Danny Tuppeny 4466c9db4c
Re-enable integration tests (#20947)
* Unskip expression evaluation integration tests for non-Windows

* Add additional into to skip comments

* Add missing import
2018-08-27 09:29:07 +01:00
Danny Tuppeny 363543fc19
Don't try to stop the same app twice in flutter_attach test (#20905)
This test is sometimes flaky (#20822) because the two processes try to stop the same app. This fix changes to just gracefully terminate the attach process without explicitly trying to stop and then uses the original spawning process to stop the app.

I can't repro the flake locally to be certain, but I've verified only one stop command is sent now so it *should* be good.
2018-08-22 17:13:34 +01:00
Danny Tuppeny 65985db142
Double all timeouts on flutter_tools integration tests (#20872)
Due to CPU contention we've seen these go really slow on Cirrus (see https://github.com/flutter/flutter/issues/19542#issuecomment-414265152), and there's also a chance our flakes are timeouts due to running slow rather than hanging.
2018-08-22 17:13:23 +01:00
Danny Tuppeny e870b1a20f
Provide better error messages in integration tests when apps don't launch successfully (#20813)
* Don't keep parsing results once we've had the event we expected

* Report errors if an app.stop event is received while waiting for another event

* Don't throw if we see app.stop event when we've just sent an app.stop request

* Improve debug print to include --start-paused if being used

* Improve wrapping
2018-08-21 20:39:35 +01:00
Devon Carew 392a178169
add a --use-cfe option to flutter analyze (#20742)
* add a --use-cfe option to flutter analyze

* useCFE ==> useCfe
2018-08-21 10:45:37 -07:00
Ian Hickson ad1eaff45a
flutter analyze cleanup (#20490)
* `flutter analyze` cleanup

* Make `--dartdocs` work in all modes.
* Make `analyze-sample-code.dart` more resilient.
* Add a test for `analyze-sample-code.dart`.
* Minor cleanup in related code and files.

* Apply review comments

* Fix tests
2018-08-20 12:51:07 -07:00
Ian Hickson 8c79f40d71
Fixes resulting from audit of issues links (#20772)
* Fixes resulting from audit of issues links

I looked at every link to GitHub in our repo. For cases where we had a TODO that was waiting for a bug to be fixed, and the bug has now been fixed, I applied the pending change. For cases where the link was out of date, I updated the link.

* Update run_test.dart

skip this test again since it failed on linux and macos bots
2018-08-18 16:44:39 -07:00
Ian Hickson 3dec6a6930
Clean up usage of temporary directories (#20682)
All temporary directory start with `flutter_` and have their random component separated from the name by a period, as in `flutter_test_bundle.YFYQMY`.

I've tried to find some of the places where we didn't cleanly delete temporary directories, too. This greatly reduces, though it does not entirely eliminate, the directories we leave behind when running tests, especially `flutter_tools` tests.

While I was at it I standardized on `tempDir` as the variable name for temporary directories, since it was the most common, removing occurrences of `temp` and `tmp`, among others.

Also I factored out some common code that used to catch exceptions that happen on Windows, and made more places use that pattern.
2018-08-17 13:17:23 -07:00
Alexander Aprelev e1534b8ecb
Add '-t' option to 'attach' command. (#20539)
* Add '-t' option to 'attach' command.

* Add test

* Make analyzer happy

* Fix tests so they use memory file system and can find lib/main.dart
2018-08-16 13:11:44 -07:00
Stanislav Baranov b5b55447a4
Remove unused snapshot.d depfile parameter (#20584) 2018-08-16 08:47:20 -07:00
Stanislav Baranov 2c0329a103
Replace flutter --build-snapshot with --precompile that takes input (#20574) 2018-08-16 08:46:57 -07:00
Stanislav Baranov 393f9276ca
Reland Flutter tool support for dynamic code #20543 (#20646) 2018-08-16 08:43:41 -07:00
Mikkel Nygaard Ravn 26ba937846
Fix compiler error (#20687) 2018-08-16 13:59:27 +02:00
Mikkel Nygaard Ravn 405d1c473b
Avoid having flutter_tools test outcome depend on packages get (#20683) 2018-08-16 13:22:13 +02:00
Mikkel Nygaard Ravn d4e5e1e11e
Materialize Flutter module, Android (#20520) 2018-08-16 13:21:55 +02:00
Martin Kustermann 9299c02cf7 Reland "Roll engine to version e3687f70c7ece72000b32ee1b3c02755ba5361ac (#20427)" (#20633)
* Reland "Roll engine to version b148e628ec86b3a9a0382e0bcfae73f0390a8232 (#20427)"

This is a re-land with downgraded `package:flutter_gallery_assets`
version.

* Downgrade package:flutter_gallery_assets to 0.1.4

* Change engine.version to 81baff97c29bb08cbf8453a3f9042c5813f84ad3 (which contains an additional fix)

* Change engine.version to e3687f70c7ece72000b32ee1b3c02755ba5361ac (since mac tarballs are corrupted on earlier commit)
2018-08-15 15:35:12 -07:00
Jonah Williams 58e52cc177
Revert "Flutter tool support for dynamic code" (#20644)
* Revert "iOS Dialog blur, brightness, and layout (#18381)"

This reverts commit 21bc9f1b02.

* Revert "Flutter tool support for dynamic code. (#20543)"

This reverts commit 25ba90aafa.
2018-08-15 13:32:22 -07:00
Stanislav Baranov 25ba90aafa
Flutter tool support for dynamic code. (#20543) 2018-08-15 12:27:35 -07:00
Martin Kustermann 515909ecb6
Revert "Roll engine to version b148e628ec86b3a9a0382e0bcfae73f0390a8232 (#20427)" (#20631)
Reason for revert: The package:flutter_gallery_assets has removed some images which are required for the examples/flutter_gallery, so the gallery build is failing (only discovered after landing, since gallery doesn't seem to get built during github PR presubmit checks)
2018-08-15 16:25:51 +02:00
Martin Kustermann c7c493ea5d
Roll engine to version b148e628ec86b3a9a0382e0bcfae73f0390a8232 (#20427)
This CL

  * rolls `engine.version` to flutter/engine@b148e628 (which includes dart sdk 2.1.0-dev)
  * rolls `goldens.version` to flutter/goldens@6c45fafdf (which includes updates due to skia changes in engine)
  * changes `platform.dill` to `platform_strong.dill` in various places due to flutter/engine@a84b210b
  * adds explicit `environment: sdk: ">=2.0.0-dev.68 < 3.0.0"` constraints to `pubspec.yaml` and `pubspec.yaml.tmpl` files (since pub defaults to `<2.0.0` if omitted) 
  * upgrades to newer versions of various 3rd party packages (to ensure transitive dependencies have `<3.0.0` sdk constraint)
2018-08-15 15:22:05 +02:00
Ian Hickson 686d8f8a22 Shim package:test to avoid matcher issues (#20602)
* Upgrade everything except matcher.
* Roll matcher (and test)
* Adjust tests that depend on flutter:test directly to depend on a shim
* Require use of package:test shim and remove other references to package:test
2018-08-14 20:33:58 -07:00
Mikkel Nygaard Ravn e69b434602
Fix broken Flutter module with plugins (#20496) 2018-08-13 10:35:59 +02:00
Mikkel Nygaard Ravn a737c86a19
Avoid null manifests in FlutterProject (#20332) 2018-08-10 21:49:24 +02:00
Mikkel Nygaard Ravn 3c83c52697
FlutterProject refactoring and test coverage (#20296) 2018-08-07 23:43:15 +02:00
Matteo Crippa 8c02b8f889 Fix issue for iOS to build any app and run on simulator #19618 (#19863)
A different approach to get the url from the string and avoid any interference by extra chars not allowed in url

Fixes #19618
2018-08-04 12:06:56 -07:00
Mikkel Nygaard Ravn 651c5ab374
Fix latent type error in Flutter manifest (#20143) 2018-08-02 19:16:32 +02:00
Mikkel Nygaard Ravn b280074815
Move async from member access to construction (#20035) 2018-08-02 14:12:25 +02:00
Alexandre Ardhuin eda03e2586
re-re-enable lint unnecessary_const (#20103) 2018-08-02 12:02:32 +02:00
Danny Tuppeny 93705691a4
Skip tests that are expected to fail with timeouts (#20074)
* Skip tests instead of expecting failure, because expected failure = timeout which is slow

Some of these tests are known to fail and were coded to expect it; however because the failure is a timeout it's just dragging out test runs (shortening timeouts will make the tests flakier).

* Make it easier to find skipped tests

* Change SKIP to TODO
2018-08-01 17:50:38 +01:00
Devon Carew e816f64bf2
remove the option to pass in the --no-preview-dart-2 flag to analysis (#20041)
remove the option to pass in the --no-preview-dart-2 flag to analysis
2018-07-31 19:15:11 -07:00
Danny Tuppeny 12eff1d5da
Change from .first to .single to ensure this (#19981) 2018-07-31 08:05:24 +01:00
Ian Hickson acf4b6c1aa
Clean up startProgress logic. (#19695) (#20009)
Disallow calling stop() or cancel() multiple times. This means that
when you use startProgress you have to more carefully think about what
exactly is going on.

Properly cancel startProgress in non-ANSI situations, so that
back-to-back startProgress calls all render to the console.
2018-07-30 16:58:07 -07:00
Todd Volkert 00aac68e2d
Revert flutter/flutter#19592 (#19861)
It was causing problems rolling Flutter into Fuchsia
2018-07-27 08:44:39 -07:00
Jonah Williams 9c159638bc
Revert "Clean up startProgress logic. (#19695)" (#19842)
This reverts commit 0636c6fe60.
2018-07-26 16:44:27 -07:00
Ian Hickson 0636c6fe60
Clean up startProgress logic. (#19695)
Disallow calling stop() or cancel() multiple times. This means that
when you use startProgress you have to more carefully think about what
exactly is going on.

Properly cancel startProgress in non-ANSI situations, so that
back-to-back startProgress calls all render to the console.
2018-07-26 14:02:25 -07:00
Danny Tuppeny 93dd3f193c
Skip integration tests that use flutter-tester on Windows (#19773)
* Skip integration tests that use flutter-tester on Windows

This is known to be broken. I will un-skip all of these once a fix for flutter-tester lands on Windows.

* Save with added import!
2018-07-25 18:31:50 +01:00
Danny Tuppeny b3c319e4f1
Add integration tests to ensure flutter run does not quit at startup (#19473)
* Add tests to ensure flutter run does not quit at startup

These tests require https://github.com/dart-lang/vm_service_client/pull/38 to be merged and currently the third test (pause-on-exceptions) fails because of a bug.

* Remove TODO

Probably makes most sense this way for now.

* Address PR comments
2018-07-25 17:29:35 +01:00
Danny Tuppeny 2a679bd858
Look up breakpoints rather than relying on magic numbers (#19708)
* Look up breakpoints rather than relying on magic numbers

* Make breakpoint comment more obvious
2018-07-25 15:31:57 +01:00
Danny Tuppeny bdf0dd466d
Skip attach test on Windows due to #17833 (#19763) 2018-07-25 14:56:29 +01:00
Danny Tuppeny d71d10094d
Rename file -> _test so it runs on CI! (#19749) 2018-07-25 13:43:36 +01:00
moznion 46da8536b6 Add some options to format subcommand (#18360)
* Add `--dry-run` option to `flutter format` sub command

* Add `--set-exit-if-changed` option to `format` sub command

* Add `--machine` option to `format` sub command

* Make variable names to be not shorthand: cmd -> command

Fix https://github.com/flutter/flutter/pull/18360#discussion_r199656120
2018-07-24 16:37:00 -07:00
Ian Hickson b4d3808a15
Fix the checksum verification to be more sensitive (#19290)
* Fix the checksum verification to be more sensitive

* update packages
2018-07-23 13:01:22 -07:00
Alexandre Ardhuin 27018359d2
re-enable lint unnecessary_const (#19592)
* re-enable lint unnecessary_const

* remove trailling whitespaces

* remove unnecessary const (after merge)
2018-07-23 08:31:48 +02:00
Leaf Petersen 32f94443cc
Remove uses of deprecated constants and change int.parse to int.tryParse (#19575)
* Remove uses of deprecated constants
* Change int.parse to int.tryParse where appropriate
2018-07-20 15:07:24 -07:00
Greg Spencer 1cc036519c
Removes trailing whitespace from source files. (#19329) 2018-07-19 23:03:58 -07:00
Sigurd Meldgaard 2d3a5c744d
Revert "Revert "Use FlutterProject to locate files (#18913)" (#19409)" (#19456)
With a fix of a path being printed relative instead of absolute.
2018-07-20 08:00:30 +02:00
Danny Tuppeny d9ee971e38
Fix copy/paste error in test (#19564) 2018-07-19 19:52:15 +01:00
amirh c1de12dd44
Skip flaky test (expression_evaluation_test) (#19543) 2018-07-19 10:20:28 -07:00
Danny Tuppeny ed9afbbc72
Add --machine support for flutter attach (#19077)
* Extract some of startApp into a reusable method

* Get basic attach --machine working

* Attach --machine tweaks

Move validation to validate method and create daemon early so we get the startup event before trying to get a connection.

* Bump daemon version so we know whether it's valid to flutter attach

* Tweak output text

* Swap package imports for relative

* Review tweaks (naming, formatting, typedefs)

* Separate arguments from process spawning

This will make calling attach easier

* Add a basic test for flutter attach --machine

* Fix crash if port unforward modifies the list of forwarded ports

* Add a no-op port forwarder for flutter-tester

* Switch to using BasicProject instead of our own inline code

* Fix expectation in test now we have a portForwarder

* Remove stale TODO (this is done)

* Tweak formatting

* Change some Completers to void to fix Dart 2 issues
2018-07-19 13:38:29 +01:00
Danny Tuppeny 442fc3cf06
Make cleanup of flutter processes in tests more reliable (#19307)
* Make cleanup of flutter processes in tests more reliable

* Fix quit signals

I confused SigInt&SigTerm for SigTerm&SigKill when I first did this. SigTerm can be blocked and doesn't guarantee the process will be terminated.

* Don't use deprecated constants

* Fix typo

* Add some additional info to debug buffer

* Fix return types on Futures
2018-07-19 11:37:40 +01:00
Danny Tuppeny d3f6128c21
Flutter emulator launch crash running in dart-2-mode (#19454)
* Only printError on our simple messages

Any other type is a real error that should be a normal crash (to get a proper error log).

See #19453.

* Add toList() to convert Iterable<String> -> List<String>

This code previously throw in Dart-2 mode.

Fixes #19453.

* Move getSimulatorPath into Xcode

* Add a test that we tried to launch the simulator

* Remove unused import
2018-07-19 10:32:44 +01:00
Ryan Macnak b8b6d4166c
Build snapshots with --sync-async to match the engine. (#19495)
Bug: https://github.com/flutter/flutter/issues/19494
2018-07-17 18:07:54 -07:00
Ian Hickson f630f90d6d
Revert "enable lint unnecessary_const (#19342)" (#19423)
This reverts commit cc1cf13eec.
2018-07-16 13:30:27 -07:00
Alexandre Ardhuin cc1cf13eec
enable lint unnecessary_const (#19342) 2018-07-16 21:43:48 +02:00
Sigurd Meldgaard 6a8f904104
Revert "Use FlutterProject to locate files (#18913)" (#19409)
This reverts commit 57d78cc739.
2018-07-16 16:21:20 +02:00
Sigurd Meldgaard 57d78cc739
Use FlutterProject to locate files (#18913) 2018-07-16 09:39:37 +02:00
Greg Spencer 5d0d1b038f
Add Bash and Zsh command-line completion for flutter (#19243)
This uses @kevmoo's completion package to do command line completion for flutter, and a new command "bash-completion" (with alias "zsh-completion") that will output the necessary shell script setup code, and adds the hidden command "completion" that does the actual completion.

Because it adds a dependency, I also had to do flutter update-packages --force-upgrade.

Fixes #18988.
2018-07-13 21:24:36 -07:00
Alexander Aprelev 7ebf2728dc
Revert "Revert "Roll engine to fed2ea458ed49088d33eddabc546ba56d600c717 (includes dart roll) again (#19277)" (#19295)" (#19322)
This reverts commit cc122f1672.
2018-07-12 14:59:22 -07:00
Danny Tuppeny 1363bd1795
Ensure timeouts in flutter_tools integration tests include all messages received (#19253)
* Allow a longer timeout for app launches

* Include timings in errors when waiting for events

* Extract a helper that adds a timeout and includes message logging

* Ensure all timeouts include messages

* Ensure logs are set up before we invoke actions

* Ensure all messages are logged during timeout periods

This adds a new stream _allMessages that collects all output (as routed through debugPrint) and updates _timeoutWithMessages to use that instead of stdin/out of only the flutter run process (since that was missing stdin - the sends, and both input/output to the VM service).
2018-07-12 18:17:33 +01:00
Alexander Aprelev cc122f1672
Revert "Roll engine to fed2ea458ed49088d33eddabc546ba56d600c717 (includes dart roll) again (#19277)" (#19295)
This reverts commit 700cb767c9 as it
breaks Windows tests.
2018-07-11 19:52:28 -07:00
Alexander Aprelev 700cb767c9
Roll engine to fed2ea458ed49088d33eddabc546ba56d600c717 (includes dart roll) again (#19277)
* Revert "Revert "Roll engine to fed2ea458ed49088d33eddabc546ba56d600c717 (includes dart roll) (#19044)" (#19276)"

This reverts commit cf932490b7 as it also
includes fix for type error that broke tests.

* Add type cast for dart2 type checks.

* Move up to latest goldens

* Make inDirectory() type-parameterized.

* Add typecasting to transitions_perf_test.dart and microbenchmarks.

* Add boolean flag initialization in save_catalog_screenshots.dart

* Add type conversion to gallery transition test
2018-07-11 19:26:33 -07:00
Chris Bracken 379a2d5654
Push /usr/bin to front of PATH for ios-deploy runs (#19281)
ios-deploy relies on LLDB.framework, which relies on /usr/bin/python and
the 'six' module that's installed on the system. However, it appears to
use the first version of Python on PATH, rather than explicitly
specifying the system install.  If a user has a custom install of Python
(e.g., via Homebrew or MacPorts) ahead of the system Python on their
PATH, LLDB.framework will pick up that version instead. If the user
hasn't installed the 'six' module, ios-deploy will fail with a
relatively cryptic error message.

This patch pushes /usr/bin to the front of PATH for the duration of the
ios-deploy run to avoid this scenario.

This patch also removes checks for package six.

Neither Flutter nor any of its direct dependencies/tooling relies on
package six. ios-deploy depends on LLDB.framework (included with Xcode),
which relies on a Python script that imports this package but uses
whichever Python is at the front of the path. Flutter now invokes
ios-deploy with a PATH with /usr/bin forced to the front in order to
avoid this problem.

We could have retained the check out of paranoia, but this seems
unnecessary since it's entirely possible LLDB.framework may one day drop
this dependency, in which case I'd expect the base system install of
Python would likely drop it as well.
2018-07-11 17:33:06 -07:00
jslavitz 94959a340c Fixed code sign error message width (#19026)
* Fixed codesign error message width

* Fixed mac_test

* Removed snackbar code
2018-07-11 16:51:25 -07:00
Alexander Aprelev cf932490b7
Revert "Roll engine to fed2ea458ed49088d33eddabc546ba56d600c717 (includes dart roll) (#19044)" (#19276)
This reverts commit f4a038da63 as it breaks microbenchmark tests.
2018-07-11 12:48:55 -07:00
Alexander Aprelev f4a038da63
Roll engine to fed2ea458ed49088d33eddabc546ba56d600c717 (includes dart roll) (#19044)
* Roll engine to rolled dart
Add connectionTimeout property to class that extends HttpOverrides.
Upgrade packages.
Add more type fixes.
Update goldens hash.
Add more type fixes.
Upgrade packages.
Fix tests.
Remove strong-mode from analysis options yaml file.
Increase dev/devicelab timeout from 2 to 10 seconds.
Added getVM to waitForViews. Fix type errors in compileExpression.

* Pick up engine revision with fix for microbenchmarks regression.
Increase default timeout from 20/30 to 60s.
2018-07-11 12:13:28 -07:00
Danny Tuppeny b931640c1d
Improve flutter tools integration tests (#18865)
* Rename util -> test_utils

* Rename flutter_test_driver -> test_driver

* Switch testWithContext -> test

* Remove unused import

* Move test project into a class to make it easier to have multiple of these

Each "TestProject" class can contain its files and things like named breakpoint locations.

* Split expression evaluation tests into own file

* Include last response in error messages

* Update expectations based on current bugs

* Fix async-ness in tests

* Fix incorrect expectation in test

* Fix incorrect evaluations

* Remove skips for tests that are now passing on master

* Expect pass on Linux

🤷‍♂️

* Call the code

* Skip expression evaluation tests on Windows

* Skip whole group, not just one test

* Remove duplicated method from merge

* Fix misplaced close of group

* Remove code that was duplicated from test we copied

Not sure how this ended up in here?

* Re-fix typo
2018-07-10 06:51:12 +01:00
Ralph Bergmann 779eea681f make tests in xcodeproj_test.dart and gradle_test.dart hermetic (#18093) (#18548) 2018-07-09 10:36:17 -07:00
Danny Tuppeny 4630fa8e60
Additional integration test driver functionality (#19085)
* Add additional functionality to integration test driver

* Typo

* Remove delays we shouldn't need + comments

* Fix typos
2018-07-09 10:41:16 +01:00
abykov2 e5d9feb59d Adding a setup function for hot restart (#18921)
* Adding a setup function for hot restart that can be overwritten to perform any necessary initialization before a restart is started.

* Adding a test for setupHotRestart

* Removing local pubspec change

* Fixing some type annotation errors

* Responding to comments
2018-07-06 15:18:57 -07:00
Mikkel Nygaard Ravn b1c6224590
flutter attach should handle non-singular device gracefully (#19036) 2018-07-03 16:18:06 +02:00
Mark Fielbig af5d4c6882 Fix type errors in iOS simulator discovery. (#18960) 2018-06-30 17:17:35 -07:00
Danny Tuppeny abc3c4eb09
Remove flaky flutter_tester test (#18916)
This test was designed to ensure flutter_tester keeps running (previously it would quit immediately). However it's turned out ot be rather flaky and we have new tests on the way that supersede this by actually testing real things (debug stepping, reloading, expression evaluation).
2018-06-28 16:46:36 +01:00
Danny Tuppeny 108da01310
Remove the 'app' domain from flutter daemon (#18873)
* Remove the 'app' domain from flutter daemon

By default the daemon won't register the "app" domain, you need to opt-in (which the 'run' command does, as well as the tests for the app functionality).

Fixes #6658.

* Tweak text

* Put restart/callServiceExtension/stop back into daemon mode

* Add a comment about removing discoverApps
2018-06-28 16:22:02 +01:00
Sigurd Meldgaard 1e8ef602c3
Add iOS module template (#18830) (#18903)
Add iOS module template

This will enable integration of flutter-views into existing iOS project.
2018-06-28 14:35:00 +02:00
Sigurd Meldgaard 4a6558f88f
Revert "Add iOS module template (#18830)" (#18902)
This reverts commit 8be198d8a0 that broke the build.
2018-06-28 11:16:08 +02:00
Danny Tuppeny 328f9b30cb
Re-skip flutter_device_tester test (#18900)
After landing the un-skip this test failed with a timeout. It then passed on the next build (!). I think it's too flaky to leave running until we can better diagnose what's happening.
2018-06-28 10:04:02 +01:00
Sigurd Meldgaard 8be198d8a0
Add iOS module template (#18830)
Add iOS module template

This will enable integration of flutter-views into existing iOS project.
2018-06-28 10:03:16 +02:00
Danny Tuppeny 3158d8572b
Add process output for flutter_tester test and unskip (#18899)
* Add process output for flutter_tester test and unskip

* Add a comment about this potential flake
2018-06-28 08:54:02 +01:00
Danny Tuppeny cdb01187f8
Add --create option to flutter emulators command (#18235)
* Add --create option to flutter emulators

* Tweaks to error message

* Simplify emulator search logic

* Make name optional

* Add a note about this option being used with --create

* Tweaks to help information

* Switch to processManager for easier testing

* Don't crash on missing files or missing properties in Android Emulator

* Move name suffixing into emulator manager

This allows it to be tested in the EmulatorManager tests and also used by daemon later if desired.

* Pass the context's android SDK through so it can be mocked by tests

* Misc fixes

* Add tests around emulator creation

Process calls are mocked to avoid needing a real SDK (and to be fast). Full integration tests may be useful, but may require ensuring all build environments etc. are set up correctly.

* Simplify avdManagerPath

Previous changes were to emulatorPath!

* Fix lint errors

* Fix incorrect file exgtension for Windows

* Fix an issue where no system images would crash

reduce throws on an empty collection.

* Fix "null" appearing in error messages

The name we attempted to use will now always be returned, even in the case of failure.

* Add additional info to missing-system-image failure message

On Windows after installing Andriod Studio I didn't have any of these and got this message. Installing with sdkmanager fixed the issue.

* Fix thrown errors

runResult had a toString() but we moved to ProcessResult when switching to ProcessManager to this ended up throwing "Instance of ProcessResult".

* Fix package import

* Fix more package imports

* Move mock implementation into Mock class

There seemed to be issues using Lists in args with Mockito that I couldn't figure out (docs say to use typed() but I couldn't make this compile with these lists still)..

* Rename method that's ambigious now we have create

* Handle where there's no avd path

* Add another toList() :(

* Remove comment that was rewritten

* Fix forbidden import

* Make optional arg more obviously optional

* Reformat doc

* Note that we create a pixel device in help text

* Make this a named arg
2018-06-28 08:07:40 +01:00
Ian Hickson 35ad2a786d
Remove race conditions involving finding available ports (#18698)
This is an attempt to reland #18488 with less breakage on macOS.
2018-06-27 16:44:28 -07:00
Danny Tuppeny cfd26d321e
Revert "Add process output for flutter_tester test and unskip (#18868)" (#18871)
This reverts commit 5d8ea59d86.
2018-06-27 13:23:15 +01:00
Danny Tuppeny 5d8ea59d86
Add process output for flutter_tester test and unskip (#18868) 2018-06-27 12:52:32 +01:00
Danny Tuppeny e616c6cef2
Improve update checking (#18193)
* Improve update checking

This change emables pinging the server to check for updates regardless of whether the local version is "out of date". The server code already has a 7-day cache so the result is that we can now ping the server once every 7 days instead of waiting for the local install to be 4 weeks out of date before pinging.

The original 4 week period is still used for when we'll start warning the user they're out of date if we could not confirm with the server whether there's a new version.

* Improve message when we know there's a new version available

* Fix bnullable bool checks

* Switch nullable bool to enum

* Fix casing of enum values

* Remove stale comment

The names are now descriptive so doesn't need additional explanation.

* Improve name of function

* Remove note:

* Rename kPauseToLetUserReadTheMessage -> timeToPauseToLetUserReadTheMessage

* Change kVersionAgeConsideredUpToDate to 5 weeks from 4

* Inline the isNewerFrameworkVersionAvailable check

* Fix indenting (?)

* Fix more indenting

* Rename function to be clearer it's getting the commit date

* Formating tweaks

* Update stamp when connection failed, and reduce time before we'll try again

Previously we would hit the server on every command if we thought we might be out of date and we never successfully connected (eg. if you're offline). This makes the stamp update even when there's a conneciton failure so that this won't happen, but reduces the time till we check again from 7 days to 3 days to compensate a little in case it was a one-off.

https://github.com/flutter/flutter/pull/18193#issuecomment-399222269

* Fix comment

* Don't perform update checks if not on an official channel
2018-06-27 12:50:40 +01:00
Danny Tuppeny 0fb209726f
Mark flutter-tester-runs-forever test as skip (#18867)
This test is failing on mac_bot (but passing elsewhere) because flutter-tester is apparently quitting earlier than expected. Locally it fails with an even weirder error and almost all tests are failing with "Compilation failed" (this isn't happening on the builds, so something is bad on my MacBook). Marking as skip to fix build while investigating; there's no real impact of this test not running; it's testing a tool that its itself used for testing (and not currently in any way that should be affected by this failure).
2018-06-27 10:57:34 +01:00
Danny Tuppeny 3456dc6248
Add failing tests for #17833, #18441 and #18678 (#18560) 2018-06-27 08:04:55 +01:00
Florian Loitsch d248725e15
Flutter attach (#18677)
Add `flutter attach` command.

This command allows Flutter to connect to applications that haven't been launched using `flutter run`.
2018-06-25 15:33:42 +02:00
Sarah Zakarias def7634ba0
Support running apk with more than one activity (#18716) 2018-06-25 13:38:08 +02:00
Mikkel Nygaard Ravn d89a6b544e
Add module template for Android (#18697) 2018-06-22 18:19:37 +02:00
Sam Rawlins 9f8a70be4c Bump mockito to 3.0.0-beta (#18462)
* Bump mockito to 3.0.0-beta

* Few fixes

* fix test

* Bump image

* Fix

* New packages update

* With matcher pinned

* No more typed
2018-06-21 16:23:47 -07:00
Alexander Aprelev 2828a459f6
Serialize expression compilation requests (#18618)
* Serialize compilation requests.
2018-06-21 11:13:21 -07:00
Yegor 9da80217fc
make crash server URL customizable from environment (#18649) 2018-06-20 15:43:43 -07:00
Ian Hickson 6599271bf5
Revert matcher package (#18614)
The new matcher package deprecates isInstanceOf which seems eggregious.
2018-06-19 17:22:56 -07:00
Greg Spencer 08d1ec36de Roll engine to 0c119932c0d6cb30dafd75ec717d1eda76fd7651 (#18575) 2018-06-19 09:58:20 +02:00
Ian Hickson 0fa5ba43a1
Revert "Remove race conditions involving finding available ports (#18488)" (#18521)
This reverts commit 7750872251.
2018-06-15 15:37:20 -07:00
Ian Hickson 7750872251
Remove race conditions involving finding available ports (#18488) 2018-06-15 14:16:18 -07:00
Stanislav Baranov bcaf026c08
Add flutter tool support for creating app-specific VM snapshots. (#18417)
Add flutter tool support for creating app-specific VM snapshots.
2018-06-15 11:53:30 -07:00
Danny Tuppeny 48f4ff6dda
Ensure errors launching emulators are exposed to the daemon (#18446) 2018-06-14 07:59:50 +01:00
Chris Bracken 2ae48845a8
Revert elimination of Dart 1 (#18460)
fuchsia_tester.dart still assumes Dart 1. Previously, it ran tests directly
from source, flutter_platform.dart automatically runs a kernel compile when
operating in Dart 2 mode, but this assumes a functional Dart SDK is available
in the artifacts directly, and fuchsia_tester.dart mocks out the artifacts
directory with an empty temp dir.

Remaining work is:
1. Get the frontend server building as a dependency on Fuchsia.
2. Patch fuchsia_tester.dart to use a valid Dart SDK and frontend server.

This also reverts migration to Dart 2 typedef syntax.

This reverts commit 6c56bb2. (#18362)
This reverts commit 3daebd0. (#18316)
2018-06-13 12:46:39 -07:00
Greg Spencer 6c56bb2420
Update typedef syntax to use Function notation and turn on lint for old notation. (#18362)
Now that Dart 1 is turned off, reapplying my change to turn on the prefer_generic_function_type_aliases analysis option, and fix all the typedefs to Dart 2 preferred syntax.

Also eliminated the unused analysis_options_repo.yaml file and turned on public_member_api_docs in analysys_options.yaml.

No logic changes, just changing the typedef syntax for all typedefs, and updating analysis options.
2018-06-11 15:51:45 -07:00
Mehmet Fidanboylu 3019ad976d
Passing any to named params require the name of the parameter itself. (#18361) 2018-06-11 11:31:25 -07:00
Chris Bracken 4db7daf751
Handle malformed depfiles in Fingerprinter (#18321)
Fingerprinter.doesFingerprintMatch() now returns false rather than
throwing if a depfile is malformed.
2018-06-08 17:56:14 -07:00
Chris Bracken 3daebd059c
It's time to #deleteDart1 (again) (#18316)
* It's time to #deleteDart1 (#18293)

Eliminates support for Dart 1 in flutter_tools, and drops our Dart 1
benchmarks. All commands now run in Dart 1 mode only.

Eliminates --preview-dart-2 / --no-preview-dart-2 support.

* Fix indentation, remove no longer necessary .toList()

* Only push udpated kernel if >0 invalidated srcs
2018-06-08 15:49:24 -07:00
Chris Bracken 9495df4bc3
Revert "It's time to #deleteDart1 (#18293)" (#18313)
Several benchmarks started failing during kernel compile:
1. Timeouts:
   * commands_test
   * hot_mode_dev_cycle__benchmark
   * run_machine_concurrent_hot_reload
   * service_extensions_test

2. Kernel compiler crash:
   * hot_mode_dev_cycle_linux__benchmark
   * routing_test

3. Unexpected termination:
   * hot_mode_dev_cycle_win__benchmark

This reverts commit ed63e7082a.
2018-06-08 12:43:11 -07:00
Chris Bracken ed63e7082a
It's time to #deleteDart1 (#18293)
Eliminates support for Dart 1 in flutter_tools, and drops our Dart 1
benchmarks. All commands now run in Dart 1 mode only.

Eliminates --preview-dart-2 / --no-preview-dart-2 support.
2018-06-08 11:04:57 -07:00
Alexander Aprelev f11c8d967c
Add compile-expression service. (#16161)
This registers compile-expression service that is used by dart vm to evaluate expressions when debugging flutter applications.
2018-06-05 13:22:13 -07:00
Keerti Parthasarathy da7670c2ee
Fixes for test failures in Dart 2 mode (#18122) 2018-06-05 12:38:30 -07:00
Alexandre Ardhuin 09276bea25
enable lint prefer_equal_for_default_values (#18156) 2018-06-05 08:50:40 +02:00
Ian Hickson 6be81ebf9b
Be more resilient to bad data from VM (#18132)
Fixes https://github.com/flutter/flutter/issues/14517
Or at least, fixes the crash part of that.
2018-06-04 19:12:55 -07:00
Ian Hickson e3427550e9
Be less verbose in the logs. (#17401)
Now that we have thousands of tests, it doesn't make sense to display a separate line for each test. The result is just megabytes of logs that you have to scrub through to find error messages.
2018-06-04 15:22:19 -07:00
Sam Rawlins fba81d0f1d Use anyNamed when mocking named arguments (#17996) 2018-05-31 08:24:26 -07:00
Sigurd Meldgaard 758711c85d
Allow --use-application-binary using app-bundles on ios (#17691)
This makes it easier to run ios add2app apps with Flutter run.
2018-05-31 10:33:15 +02:00
Jacob Richman 62febaa140
Add support for --track-widget-creation back to ios build rules. (#18046) 2018-05-30 14:53:35 -07:00
Greg Spencer b921fdc58e
Revert "Update typedef syntax to use Function notation and turn on lint for old notation. (#18035)" (#18041)
This reverts commit 3258602073.
2018-05-30 13:51:14 -07:00
Greg Spencer 3258602073
Update typedef syntax to use Function notation and turn on lint for old notation. (#18035)
Fixes #18028

Just changes typedef declarations, no logic changes.
2018-05-30 12:13:58 -07:00
Ralph Bergmann c65e9d19a4 add version to pubspec.yaml (#16857)
Uses the `version` property from the `pubspec.yaml` file to set the corresponding fields in the `local.properties` file respectively in the `Generated.xcconfig` file.

The `--build-name` and `--build-number` options have changed. Now they trump the `version` property from the `pubspec.yaml` file.

If the `version` property is not set and the  `--build-name` and `--build-number` options are not provided, the build command will not change the `local.properties` / `Generated.xcconfig` file.
2018-05-30 07:51:25 -07:00
Danny Tuppeny 42c9719ff0
Change doctor to point at Flutter extension (#17987) 2018-05-29 17:11:34 +01:00
Danny Tuppeny 24e2b238d4
Send an event at startup with the protocol version and pid (#17873)
* Send an event at startup with the protocol version and pid

The pid will help with some of the issues of terminate the process when launched through a shell script and the version will allow clients to make decisions about supported features.

I've also bumped the protocol version number for two reasons:

1. This change
2. We didn't increase it when we added the previous emulator commands
2018-05-28 22:02:53 +01:00
Chris Bracken 7587f54b20
Build single-architecture for local iOS engines (#17919)
When running with --local-engine, build single-architecture apps, rather
than what's declared in the Xcode project.

By default, Flutter creates Xcode projects that generate universal
binaries supporting both armv7 and arm64 processors. Since local engine builds
are all single-architecture, override the Xcode project's ARCHS setting
with the appropriate value for the specific engine.

NOTE: this assumes engine paths consistent with those used in the engine
repo: 32-bit iOS engine builds end in _arm, 64-bit builds do not.
2018-05-25 14:53:10 -07:00
Tim Neumann 54899c7638 Support multi-line log messages on iOS devices (#17327) 2018-05-23 19:03:05 -07:00
Devon Carew b7a268fed2
increase the timeout for analyze_once_test tests (#17845) 2018-05-23 13:04:40 -07:00
Danny Tuppeny dfc0244e19
Add emulator.getEmulators and emulator.launch to daemon (#17466)
Related to:

#14822
Dart-Code/Dart-Code#490
#13379
2018-05-22 07:39:08 +01:00
Danny Tuppeny e2181a6ad9
First run simulator with -n to ensure it always opens a device (#17460) 2018-05-22 07:35:42 +01:00
Konstantin Scheglov eba194f776
Mark testWidgets() and testUsingContext() with @isTest. (#17772) 2018-05-21 11:11:23 -07:00
fmatosqg 197d4315a9 Scan assets from disk (#16413)
Scan folders when asset specified finishes with `/`
2018-05-20 17:52:33 -07:00
Sam Rawlins 1f76f7f9d2 Migrate to Mockito 3's anyNamed (#17632) 2018-05-16 10:19:05 -07:00
liyuqian ae8586cfa1
Show help info instead of crashing if Android SDK is not found (#17610)
Fixes #16832
2018-05-15 14:42:12 -07:00
Vyacheslav Egorov 4931b46772
Make --build-shared-library more robust. (#17420)
* Search for a suitable ARM sysroot instead of hardcoding it;
* Add facility to explain why NDK was not found;
2018-05-14 16:36:54 +02:00
Chris Bracken 1605fbb31a
Add more unit tests for AOT snapshotting (#17493)
Adds unit tests for the following AOT build configurations:
* iOS armv7 profile
* iOS armv7 release
* Android armv7 profile (AOT blob)
* Android arm64 profile (AOT blob)
* Android armv7 release (AOT blob)
* Android arm64 release (AOT blob)
2018-05-10 17:45:51 -07:00
Devon Carew 8e4b349c4f
increase test timeouts (#17477) 2018-05-10 11:33:01 -07:00
Devon Carew 09dec7f508
re-write flutter analyze to use the analysis server (#16979)
re-write flutter analyze (the single-shot and --flutter-repo) to use the analysis server
2018-05-10 09:48:40 -07:00
Chris Bracken a751678563
Allow 32-bit iOS device simulators (#17443)
Previously, Flutter did not support iOS devices with armv7 or armv7s
CPUs. We now support these devices. This eliminates the previous
hardcoded checks that prevented running on simulators of older devices.

We maintain the existing restriction on running on watchOS or tvOS
simulators.
2018-05-09 13:34:39 -07:00
Chris Bracken 1c27a458a8
Correct profile-mode AOT snapshot flags (#17435)
Previously, in non-release (i.e. profile) AOT builds, we were setting
--no-checked and --conditional_directives flags. --no-checked is the
default, and we don't make use of conditional directives in Flutter.
2018-05-09 12:31:36 -07:00
Chris Bracken e4f553324a
Add pathFilter to Fingerprinter (#17412)
Allows users of Fingerprinter to filter the set of paths collected from
the explicitly-specified paths and those collected from depfiles.

In some cases, depfiles are emitted with files that are not present on
the local disk (e.g. the frontend compiler currently emits buildbot
paths for the dart core libraries and dart:ui). These files will not
materially affect whether we need to re-run a build action for which
they are inputs, since they're not present in the filesystem and
therefore cannot change.
2018-05-09 10:55:23 -07:00
Danny Tuppeny e8f454c96f Fix signature of mock launch 2018-05-09 16:03:59 +01:00
Danny Tuppeny 3cb539fdb5 Switch streams to Future<Lists> 2018-05-09 16:03:59 +01:00
Danny Tuppeny e456330a91 Remove superflous whitespace 2018-05-09 16:03:59 +01:00
Danny Tuppeny 445273f7d5 Fix filtering of emulator list
`flutter emulators nexus` will now return only those that'd match (eg. same things that `flutter emulators --start nexus` would match).
2018-05-09 16:03:59 +01:00
Danny Tuppeny 799678f0a7 Add some tests around device+ini parsing 2018-05-09 16:03:59 +01:00
Danny Tuppeny 4c67885b8e Add support for launching emulators 2018-05-09 16:03:59 +01:00
Danny Tuppeny 4d7c3c775f Read information about AVDs from config.ini 2018-05-09 16:03:59 +01:00
Danny Tuppeny 486e9534bf Add some emulator tests 2018-05-09 16:03:59 +01:00