Commit Graph

37 Commits

Author SHA1 Message Date
Jonah Williams
65f45999a3
initial work on coverage generating script for tool (#29494) 2019-04-18 17:59:14 -07:00
Jonah Williams
1c779442a0
Add null checks to coverage collection (#31092) 2019-04-15 17:33:28 -07:00
Jonah Williams
28cb589cd3
make flutterProject option of CoverageCollector optional (#31074) 2019-04-15 12:26:43 -07:00
Jonah Williams
301eaa8c32
Make coverage, like, really fast (#30811) 2019-04-15 08:59:28 -07:00
Jonah Williams
99866f4a3d
Make timeout durations configurable (#30053) 2019-03-27 16:21:16 -07:00
Ian Hickson
31a9626c48
[O] Removing all timeouts (mark II) (#26736)
These are essentially self-inflicted race conditions. Instead of timeouts we're going to try a more verbose logging mechanism that points out when things are taking a long time.
2019-01-19 00:31:05 -08:00
Ian Hickson
8426910a19
Revert "[O] Remove many timeouts. (#23531)" (#25646)
This reverts commit 76f70810e4.
2018-12-20 18:46:36 -08:00
Ian Hickson
76f70810e4
[O] Remove many timeouts. (#23531)
* Remove many timeouts.

These are essentially self-inflicted race conditions. Instead of timeouts we're going to try a more verbose logging mechanism that points out when things are taking a long time.

* Get the attach tests to pass.

* Apply review comments from Todd

* More review comment fixes

* Put back the extended timeouts here now that I know why we have them...
2018-12-20 17:10:40 -08:00
Alexandre Ardhuin
2d3ff10d62
apply lint prefer_void_to_null in packages/flutter_tools (#22686) 2018-10-05 07:54:56 +02:00
Jonah Williams
63f2fb9f5d
Add coverage directory to fuchsia coverage script (#22236) 2018-09-26 13:17:20 -07:00
Alexandre Ardhuin
d927c93310
Unnecessary new (#20138)
* enable lint unnecessary_new

* fix tests

* fix tests

* fix tests
2018-09-12 08:29:29 +02:00
Ian Hickson
10aa41f00f
Fix coverage collection crash (#21015)
* Fix coverage collection crash

Based on Jason's patch in https://github.com/flutter/flutter/pull/19546/

This is more or less the same but I tried to avoid using `dynamic`.

* Improve argument and variable names in flutter_platform

* Don't bother with reduce, since the order is guaranteed.
2018-08-28 14:36:06 -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
Ian Hickson
d581208557
Try to resolve an intermitted crash during coverage collection (#20506)
* Try to resolve an intermitted crash during coverage collection

The only theory I can come up with is that maybe the test completes
before we finish processing the standard input, so I made the test
harness wait for the observatory URL before considering whether the
test has finished or not.

Also, some code cleanup while I'm at it, e.g. avoiding using "onFoo"
for the names of methods, avoiding back-to-back switch statements with
the same values, avoiding `_` argument names, and using `?.` instead
of `if (foo != null) foo.`.

* Revert back the signature of _pipeStandardStreamsToConsole

* Also remove the other additions to this method.
2018-08-17 13:16:50 -07:00
Gary Miguel
a7b59b51b8 Remove redundant check for platform.isLinux. (#19441)
We don't actually care if we're on linux, we care only if the lcov
tool is available. We check for that explicitly just below.
Additionally there is code below which indicates that lcov is available
for macOS. Before this change that code would never execute.
2018-07-23 08:38:20 -07:00
Gary Miguel
66091f9696 Move collectCoverageData into CoverageCollector so it can be re-used. (#19055)
This will let us re-use that code from fuchsia_tester.dart.
Tested by running the stocks example tests with coverage collection before and after.
.lcov files are identical.
2018-07-09 12:52:41 -07:00
Todd Volkert
fb18ac650e
Notify test timeouts differently than test completions. (#16842)
This avoids notifying the coverage collector that we
completed the test when in fact we timed out, which in
turn avoids a downstream exception caused by the fact
that coverage collector assumes it has a valid observatory
port by which it can gather coverage data.

Fixes https://github.com/flutter/flutter/issues/16839
2018-04-21 19:52:46 -07:00
Mehmet Fidanboylu
951b85a12b
Increase coverage collection timeout to 2 minutes. Leafy is hitting the limits of the previous timeout of 30 seconds for tests that touch a lot of code in the app. (#13527) 2017-12-12 15:54:18 -08:00
xster
e28765a997 Delinting future awaits round 3 (#10791)
* round 3

* partially address comments

* merge

* review notes

* review

* review

* review
2017-09-20 17:24:43 -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
Todd Volkert
2841497344 Support IPv6 in coverage collection (#9841)
Builds on engine fixes to #9813

Also fixes #7366
2017-05-05 11:09:55 -07:00
Chris Bracken
7a09316cd0 Declare locals final where not reassigned (flutter_tools) (#8570) 2017-03-03 17:50:46 -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
Jacob Richman
53fc96da9e Small Flutter strong mode cleanup fixes. (#7825)
* Small Flutter strong mode cleanup fixes.

These are cases where strong mode down cast composite errors
generally indicated cases that would performance or correctness
issues if Flutter code was run in a strong mode VM.

* Fix Command API so that it is always in terms of Map<String,String>.

* Fix typedef
2017-02-06 08:55:09 -08:00
Ian Hickson
63aa1397a3 Increase the strictness of our requiring explicit types (#7585)
...now that we have generic methods, their types need to be specified too.
2017-01-23 01:04:31 -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
Ian Hickson
971ca4b835 Check exit code for test subprocess (#7269) 2016-12-15 13:43:45 -08:00
Chris Bracken
0ba0127c1a Support a user-specified observatory port in CoverageCollector (#5217) 2016-08-04 10:43:04 -07:00
Chris Bracken
88536859b4 Correct style in finalizeCoverage parameter list (#5213) 2016-08-03 19:54:33 -07:00
Chris Bracken
a1fa7c94e3 Support passing a custom coverage formatter to finalizeCoverage() (#5208) 2016-08-03 16:58:47 -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
Adam Barth
7b99ecff35 Use relative paths in lcov.info (#4722)
Using relative paths makes it easier to share lcov.info files across machines.
2016-06-23 15:29:54 -07:00
Adam Barth
ed2c24ba2b Add coveralls support to Travis (#4690)
This patch causes us to upload a coverage report to coveralls.io.
2016-06-22 14:47:41 -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