Commit Graph

132 Commits

Author SHA1 Message Date
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
Alexandre Ardhuin
09276bea25
enable lint prefer_equal_for_default_values (#18156) 2018-06-05 08:50:40 +02:00
Todd Volkert
e19db89a0e
Add basic support for golden image file testing (#17094)
* Add a `matchesGoldenFile()` async matcher that will match
  a finder's widget's rasterized image against a golden file.
* Add support for pluggable image comparison backends
* Add a default backend that does simplistic PNG byte
  comparison on locally stored golden files.
* Add support for `flutter test --update-goldens`, which will
  treat the rasterized image bytes produced during the test
  as the new golden bytes and update the golden file accordingly

Still TODO:

* Add support for the `flutter_test_config.dart` test config hook
* Utilize `flutter_test_config.dart` in `packages/flutter/test`
  to install a backend that retrieves golden files from a dedicated
  `flutter/goldens` repo

https://github.com/flutter/flutter/issues/16859
2018-04-30 10:35:56 -07:00
Vyacheslav Egorov
71b2cfb2a0
Turn Dart 2 mode by default. (#15565) 2018-03-16 20:29:38 +01:00
Alexander Aprelev
ded538a1bb
Update dependencies with forced upgrade. (#15344)
* Update dependencies with forced upgrade.

Now that https://github.com/flutter/flutter/issues/15261 is fixed, do the update with upgrade.

* Update test package use following upgrade

* Replace addOption(allowMultiple) with addMultiOption
2018-03-09 10:38:54 -08:00
Jacob Richman
046c6d5f7f
Track which Widget objects were created by the local project. (#15041)
Make flutter test support the --track-widget-creation flag.
Add widget creation location tests. Tests are skipped when
--track-widget-creation flag is not passed.
2018-03-09 08:09:49 -08:00
Josh Soref
c5a5945e92 Spelling (#15229)
* spelling: accommodate

* spelling: allotted

* spelling: anonymous

* spelling: artificial

* spelling: associated

* spelling: asset

* spelling: button

* spelling: canvas

* spelling: compatibility

* spelling: coverage

* spelling: condition

* spelling: decoration

* spelling: deferring

* spelling: diameter

* spelling: direction

* spelling: displacement

* spelling: dropdown

* spelling: needing

* spelling: environment

* spelling: exited

* spelling: expansion

* spelling: explore

* spelling: families

* spelling: horizontal

* spelling: increment

* spelling: indices

* spelling: internationalization

* spelling: labrador

* spelling: localizations

* spelling: midflight

* spelling: milliseconds

* spelling: minimum

* spelling: multiple

* spelling: multiplication

* spelling: navigator

* spelling: overridden

* spelling: package

* spelling: performance

* spelling: platform

* spelling: porsche

* spelling: position

* spelling: preceded

* spelling: precede

* spelling: precedence

* spelling: print

* spelling: property

* spelling: readily

* spelling: reproducibility

* spelling: rounded

* spelling: scroll

* spelling: separate

* spelling: separator

* spelling: services

* spelling: specific

* spelling: specify

* spelling: synchronously

* spelling: through

* spelling: timeout

* spelling: triangle

* spelling: trivial

* spelling: unusual

* spelling: then

* spelling: vertically

* spelling: visible

* spelling: visited

* spelling: voice
2018-03-06 21:36:03 -08:00
Alexandre Ardhuin
841d5d7bd5
prefer_const_declarations on local variables (#14358) 2018-02-01 07:51:26 +01:00
Alexander Aprelev
a50b465c99
Add --preview-dart-2 to 'flutter test' (#14135) 2018-01-19 06:17:28 -08:00
Ben Konyi
3fe19d95c6 update_script 2017-12-11 11:13:16 -08:00
Todd Volkert
a08b5e00af Run command validation on all commands. (#12246)
This makes command validation happen as part of `verifyThenRunCommand()`,
using a newly introduced protected method (`validateCommand()`) rather than
a `commandValidator` property (that subclasses were responsible for manually
invoking).
2017-09-25 18:56:37 -07:00
Phil Quitslund
05562d5734 Quiet debug test runner output when in machine mode. (#11228)
* Quiet debug test runner output when in machine mode.

See: https://github.com/flutter/flutter-intellij/issues/1176

* json => machine
2017-07-14 11:20:50 -07:00
Ian Hickson
5f20f83415 Always run the flutter tool in checked mode. (#11069)
(Needs https://github.com/dart-lang/sdk/issues/28519)
2017-07-02 09:34:31 -07:00
Brian Slesinsky
6841ab22be Add --name and --plain-name to 'flutter test' (#11020)
This adds a way to run only a subset of the tests.
(The new flags do the same thing as 'pub run test'.)
2017-06-29 17:26:19 -07:00
Brian Slesinsky
f01e9418fc change --machine flag for flutter test to report test progress as JSON (#10848)
(The Flutter plugin will use this to update the UI with test progress.)
2017-06-20 14:40:42 -07:00
Brian Slesinsky
d1feb1ad5f Coverage: fix installHook API (#10747)
- remove unused collector parameter
- clarify a comment
- inline _currentPackageTestDir
2017-06-15 14:39:46 -07:00
Brian Slesinsky
3528cd6f2d flutter test: add --machine flag (#10520)
Currently this just prints the observatory URL as a JSON event.
Refactored the code to make this fit in.
2017-06-13 13:26:32 -07:00
xster
9d3fb1f309 Auto provision iOS deploy 2/3 - prompt user to choose a certificate (#10025)
* first pass

* improvements

* extract terminal.dart

* rebase

* add default terminal to context

* The analyzer wants the ../ imports in front of the ./ imports

* review notes
2017-05-18 11:26:43 -07:00
Todd Volkert
ba4bba7498 Support IPv6 in test platform (#9795) 2017-05-03 22:50:24 -07:00
Jason Simmons
e7f1361681 Update artifact names and remove obsolete artifacts (#9091) 2017-03-29 16:30:41 -07:00
Chris Bracken
7a09316cd0 Declare locals final where not reassigned (flutter_tools) (#8570) 2017-03-03 17:50:46 -08:00
Michael Goderbauer
bb1dea7440 change messaging around Windows (#8549) 2017-03-02 20:06:23 -08:00
Todd Volkert
0d2c9670fd Resolve TODOs to migrate from OperatingSystemUtils to Platform (#8314) 2017-02-21 15:11:49 -08:00
Alexandre Ardhuin
2888139c6b prefer const constructor (#8292) 2017-02-20 14:07:16 -08:00
Michael Goderbauer
cd8434d931 Refactor how Artifacts are located (#8234)
Artifacts are now located in a central place.
This will enable us to downlaod artifacts when we need them (instead of
downloading them all upfront).
This also makes replacing sky_snapshot with gen_snapshot easier.
2017-02-16 23:10:11 -08:00
Michael Goderbauer
a55a745c73 Fail tests with an actionable message when FLUTTER_ROOT is not set (#8236)
Also: Fix some analyzer warnings.
2017-02-16 18:50:28 -08:00
Ian Hickson
03ae2cf366 Catch crashes during or before coverage collection. (#8207)
This assumes a fix to https://github.com/dart-lang/test/issues/542

The timeout added in this patch is a workaround for https://github.com/dart-lang/coverage/issues/165
2017-02-15 18:50:19 -08:00
Michael Goderbauer
5e54fd54d9 Ban package:path from Flutter Tools (#8119) 2017-02-13 17:45:50 -08:00
Ian Hickson
65ca387075 Make the Ahem font available to tests. (#7725) 2017-01-28 15:55:47 -08:00
Todd Volkert
417c2f25fc Migrate flutter_tools to use package:platform (#7642) 2017-01-25 16:06:41 -08:00
Todd Volkert
9ba607862e Update to package:process v1.0.1 (#7607) 2017-01-24 10:09:29 -08:00
Ian Hickson
94cac1a69c flutter test --start-paused (#7584)
Make debugging tests in a debugger easier.

Fixes https://github.com/flutter/flutter/issues/163
2017-01-23 11:31:59 -08:00
Ian Hickson
3f1d6d3bca Remove randomness from port assignment during coverage collection. (#7548)
Also, defer to test package for throttling (this will require a test
package update as well).

Also, add a lot more instrumentation to --verbose mode for tests, and
fix minor trivial things here and there, and add error handling in
more places.

Also, refactor how coverage works to be simpler and not use statics.
2017-01-19 15:31:11 -08:00
Todd Volkert
4f9e5c8dc7 Fix race condition in coverage collection (#7455)
Previously, it was possible for the test harness to bail
and the test runner to complete before the platform plugin
triggered the collection of coverage data. This fixes the
race condition such that the pending coverage collection
task is recorded immediately after starting the process.
2017-01-12 13:58:19 -08:00
Todd Volkert
016b5ab0cc Force all dart:io usage to go through 'base/io.dart' (#7390)
This ensures that accidental usages of dart:io's
file API don't creep in over time.
2017-01-09 08:37:00 -08:00
Todd Volkert
8bb270342e Update flutter_tools to use package:file throughout (#7385)
This removes direct file access from within flutter_tools
in favor of using `package:file` via a `FileSystem` that's
accessed via the `ApplicationContext`.

This lays the groundwork for us to be able to easily swap
out the underlying file system when running Flutter tools,
which will be used to provide a record/replay file system,
analogous to what we have for process invocations.
2017-01-06 16:51:44 -08:00
Ian Hickson
971ca4b835 Check exit code for test subprocess (#7269) 2016-12-15 13:43:45 -08:00
Todd Volkert
60b19b2035 Create abstraction layer for dart:io's Process commands (#7100)
With this change, they're run via instance methods on an object
obtained through the context. This will allow us to substitute
that object in tests with replay/record versions to allow us to
mock out the os-layer in tests.
2016-11-30 08:42:42 -08:00
Dan Rubel
34e466f1fd Refactor flutter command exit code - part 3 of 3 (#6838)
* Remove the workaround that pinned args to v0.13.6
This reverts most of the changes in commit 6331b6c8b5
* throw exception if exit code is not an integer
* rework command infrastructure to throw ToolExit when non-zero exitCode
* convert commands to return Future<Null>
* cleanup remaining commands to use throwToolExit for non-zero exit code
* remove isUnusual exception message
* add type annotations for updated args package
2016-11-14 14:21:30 -05:00
Devon Carew
fcfb2a5c55 Better progress (#6677)
* make showElapsedTime default to true

* support nested progresses

* improve hot reload message

* rethrow
2016-11-03 13:28:17 -07:00
Ian Hickson
7a0f3d3405 Remove a sketchy override of a field (#6009)
The way this was implemented is sketchy, especially in strong mode.
2016-09-22 16:07:56 -07:00
Dan Rubel
1821238279 Refactor flutter command execution (#5892)
* refactor _run to runCmd

* replace requiresProjectRoot getter with call to commandValidator

* replace requiresDevice getter with call to findTargetDevice

* trace command requires a debug connection, not a device

* inline androidOnly getter

* rename command methods to verifyTheRunCmd and runCmd

* move common verification into BuildSubCommand

* rename deviceForCommand to device

* rename methods to verifyThenRunCommand and runCommand
2016-09-16 09:13:35 -04:00
pq
72de70250b Merge branch 'dart_1.19.0-dev.0.0' of github.com:pq/flutter into dart_1.19.0-dev.0.0 2016-07-27 11:16:46 -07:00
pq
13c3f9d946 Update Dart (1.19.0-dev.0.0) and analyzer (0.27.4-alpha.19). 2016-07-27 10:44:44 -07:00
Adam Barth
41d6303570 Improve test coverage for material.dart (#4776)
Previously these widget had zero test coverage. Also, improve the
coverage tooling Mac.
2016-06-28 08:48:48 -07:00
Devon Carew
aa364a082d don't rewrite the console in non-ansi mode (#4735) 2016-06-24 09:56:04 -07:00
Adam Barth
46da9e8498 Add a simple way of merging coverage data (#4726)
`flutter test` now has a `--merge-coverage` flag that can be used to merge
coverage data from previous runs, enabling faster iteration cycles.
2016-06-23 18:02:55 -07:00
Adam Barth
b094fa6dd3 Add support for --coverage to flutter test (#4679)
We need https://github.com/dart-lang/coverage/issues/100 to be fixed before
this will be useful.

Fixes #2342
2016-06-22 12:22:01 -07:00
Ian Hickson
f92f71feb9 Lock flutter tool while updating artifacts (#4476)
This prevents multiple simultaneous runs of the analyzer from stomping
over each other (e.g. multiple runs of 'update-packages'). Certain
long-lived commands (like analyze, run, logs) are exempted once they've
done enough work to be safe from most stomping action.

This still doesn't make us entirely safe from craziness, e.g. if you're
half way through an 'update-packages' run and you call 'git pull', who
knows what state you'll end up in. But there's only so much one can do.

Fixes https://github.com/flutter/flutter/issues/2762
2016-06-14 10:16:08 -07:00
Ian Hickson
c9bcf1074e Analyzer was confused when you deleted files (#4528)
Also, make it clear the screen between results so it's more obvious
what's going on when you have new results (especially when you have
fixed everything).
2016-06-13 12:20:03 -07:00
Devon Carew
3ba17136b7 add a restart command to the daemon protocol (#4385)
* refactor the --resident run option into a separate file

* update daemon to run --resident apps

* re-plumbing daemon start

* send app logs

* update tests

* review changes

* fix test runner

* remove PackageMap.createGlobalInstance; rely on the ctor

* review comments
2016-06-07 12:13:35 -07:00
Eric Seidel
880f2f785e flutter test now works on mac as well as linux
@chinmaygarde
2016-05-19 13:10:15 -07:00
Ian Hickson
f284c1a049 Fix tests (#3977)
Also, make sure that broken tests actually break the bots.

And add a test to make sure that keeps happening.
2016-05-17 12:45:37 -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
Yegor
39e741dfb7 [tools] remove --flutter-repo flag in flutter test (#3728) 2016-05-04 14:08:16 -07:00
Devon Carew
29fdc7a464 rename the --release and --debug flags (#3382) 2016-04-18 13:04:59 -07:00
Devon Carew
b172dd5a1a run pub for analyze and test (#3310)
* run pub for analyze and test

* don't run pub when doing repo analysis

* move logic for when to run pub into the commands

* re-write ternary expression
2016-04-13 19:55:28 -07:00
Adam Barth
2e062dfab4 Use --packages rather than --package-root
The .packages file is replacing the packages directory of symlinks.
2016-03-28 15:01:25 -07:00
Devon Carew
2fc8e9a110 create a crash report 2016-03-25 13:29:15 -07:00
Hixie
797e27edd3 Add @override annotations to flutter framework 2016-03-14 14:02:26 -07:00
Devon Carew
e939b152af rename the platform constants 2016-03-12 11:08:21 -08:00
Ian Hickson
1b9cd52081 Enable ALL THE LINTS
Well, all the easy ones, anyway.

For some reason `// ignore:` isn't working for me so I've disabled
lints that need that. Also disabled those that require a ton of work
(which I'm doing, but not in this PR, to keep it reviewable).

This adds:
- avoid_init_to_null
- library_names
- package_api_docs
- package_names
- package_prefixed_library_names
- prefer_is_not_empty
- sort_constructors_first
- sort_unnamed_constructors_first
- unnecessary_getters_setters
2016-03-10 23:15:31 -08:00
Adam Barth
96ec5316b8 Switch from hack_load_vm_file_hook to PlatformPlugin
This patch switches us from using our previous hacking approach to integrating
with package:test to using the new PlatformPlugin interface.
2016-03-03 11:23:36 -08:00
Devon Carew
37290d866e additional validation for device commands 2016-02-24 11:11:23 -08:00
Devon Carew
d5a6fceee5 add a summary option to the doctor class 2016-02-17 09:33:45 -08:00
Devon Carew
cc72bbc7ec rename list->devices, start->run 2016-02-13 23:50:20 -08:00
Devon Carew
2dbceafbc6 introduce globals scoped to the app's context 2016-02-09 22:03:13 -08:00
Collin Jackson
beaffecb7b fix #1443 ensure engine is the correct version 2016-02-01 13:11:30 -08:00
Devon Carew
c46ad29cfb test commands checks for test fir 2016-01-28 15:02:50 -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
Ian Hickson
7151fdd054 Move flutter tests from packages/unit to packages/flutter/test 2015-12-16 08:00:57 -08:00
Adam Barth
fb98a387aa Support flutter test with prebuilt binaries
Now you can run tests with and without --flutter-repo with a prebuilt binary on
Linux.

Fixes #307
2015-12-03 10:05:57 -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
Adam Barth
c7e00449a8 Make it possible to run tests outside the Flutter repo
This patch still requires a locally built engine. I'll remove the need for a
locally built engine in a future patch.

Fixes #278
2015-11-23 13:42:04 -08:00
Hixie
a0227cab15 flutter analyze command
Other changes in this patch:
- Make the 'flutter' tool say "Updating flutter tool..." when it calls
  pub get, to avoid confusion about what the pub get output is about.
- Make the bash flutter tool call pub get when the revision has
  changed. (This was already happening on Windows.)
- Fix a raft of bugs found by the analyzer.
- Fix some style nits in various bits of code that happened to be near
  things the analyzer noticed.
- Remove the logic in "flutter test" that would run "pub get", since
  upon further reflexion it was determined it didn't work anyway.
  We'll probably have to add better diagnostics here and say to run the
  updater script.
- Remove the native velocity tracker script, since it was testing code
  that has since been removed.

Notes on ignored warnings:
- We ignore warnings in any packages that are not in the Flutter repo or
  in the author's current directory.
- We ignore various irrelevant Strong Mode warnings. We still enable
  strong mode because even though it's not really relevant to our needs,
  it does (more or less accidentally) catch a few things that are
  helpful to us.
- We allow CONSTANTS_LIKE_THIS, since we get some of those from other
  platforms that we are copying for sanity and consistency.
- We allow one-member abstract classes since we have a number of them
  where it's perfectly reasonable.
- We unfortunately still ignore warnings in mojom.dart autogenerated
  files. We should really fix those but that's a separate patch.
- We verify the actual source file when we see the 'Name non-constant
  identifiers using lowerCamelCase.' lint, to allow one-letter variables
  that use capital letters (e.g. for physics expressions) and to allow
  multiple-underscore variable names.
- We ignore all errors on lines that contain the following magic
  incantation and a "#" character:
    // analyzer doesn't like constructor tear-offs
- For all remaining errors, if the line contains a comment of the form
    // analyzer says "..."
  ...then we ignore any errors that have that "..." string in them.
2015-11-12 12:23:29 -08:00
Adam Barth
da0a12c611 Rename sky_tools to flutter_tools 2015-11-10 13:20:35 -08:00
Hixie
bd69e2c405 Run 'pub get' the first time the tests are run 2015-11-09 13:44:04 -08:00
Ian Hickson
3419068cb3 Port test logic to Dart. 2015-11-09 09:00:49 -08:00
Adam Barth
2ed113430a Add dev/run_tests
This script runs the Flutter unit tests. By default, the script assumes you
have compiled a SkyShell in an "engine/src" that's a peer to the "flutter"
directory.
2015-11-06 23:14:17 -08:00
Adam Barth
fc8cdf4daf Add a command for running unit tests 2015-11-04 23:43:15 -08:00