Commit Graph

34 Commits

Author SHA1 Message Date
Michael Goderbauer
5491c8c146
Auto-format Framework (#160545)
This auto-formats all *.dart files in the repository outside of the
`engine` subdirectory and enforces that these files stay formatted with
a presubmit check.

**Reviewers:** Please carefully review all the commits except for the
one titled "formatted". The "formatted" commit was auto-generated by
running `dev/tools/format.sh -a -f`. The other commits were hand-crafted
to prepare the repo for the formatting change. I recommend reviewing the
commits one-by-one via the "Commits" tab and avoiding Github's "Files
changed" tab as it will likely slow down your browser because of the
size of this PR.

---------

Co-authored-by: Kate Lovett <katelovett@google.com>
Co-authored-by: LongCatIsLooong <31859944+LongCatIsLooong@users.noreply.github.com>
2024-12-19 20:06:21 +00:00
flutter-pub-roller-bot
f9351fae7e
Roll pub packages (#154267)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-08-29 16:28:08 +00:00
Michael Goderbauer
546bdec7ef
Fix implementation imports outside of lib (#143594)
Work towards https://github.com/dart-lang/linter/issues/4859

There are libraries outside a `lib/` directory, which violate `implementation_imports`.

Supersedes https://github.com/flutter/flutter/pull/143560.
2024-02-16 22:38:10 +00:00
Liam Appelbe
e12d1a798c
Reland coverableLineCache optimisation (#136851) (#137385)
Relands #136851, which was rolled back in #137121

package:coverage has been rolled, so the breakages should be fixed.
Also, in this reland I've changed the `coverableLineCache` parameter to
be optional, which is safer.
2023-10-30 11:00:30 +13:00
auto-submit[bot]
8df62188f0
Reverts "Use coverage.collect's coverableLineCache param to speed up coverage" (#137121)
Reverts flutter/flutter#136851
Initiated by: CaseyHillers
This change reverts the following previous change:
Original Description:
One of the reasons gathering coverage information is expensive is that we have to force compile every function in the libraries we're interested in. Without this, functions that haven't been invoked (so haven't been compiled) won't have any line number information, so the coverage tool doesn't know which lines to add to the list of misses. In flutter's case, the test infra spawns many VMs, and each of these needs to recompile all those libraries.

To fix this, we need a way of skipping force compilation for libraries we've already seen in previous tests, without losing the information about which lines in each library are coverable. So I [added](https://github.com/dart-lang/coverage/pull/466) the `coverableLineCache` to `coverage.collect` in package:coverage v1.7.0. This cache starts out empty, but fills up with lists of all the lines that are coverable for every library as coverage is gathered. package:coverage can then tell the VM not to force compile any libraries in this cache (using `getSourceReport`'s `librariesAlreadyCompiled` param). So the first test suite will still have to compile everything, but subsequent test suites will be much faster.

This speeds up coverage collection significantly, for large test suites:

| Running flutter/packages/flutter tests... | Time | Overhead |
| --- | --- | --- |
| without coverage | 8:53 | - |
| with coverage | 20:25 | 130% |
| with `coverableLineCache` | 12:21 | 40% |

Bug: https://github.com/flutter/flutter/issues/100751
2023-10-24 02:38:27 +00:00
Liam Appelbe
fb297e1d3b
Use coverage.collect's coverableLineCache param to speed up coverage (#136851)
One of the reasons gathering coverage information is expensive is that we have to force compile every function in the libraries we're interested in. Without this, functions that haven't been invoked (so haven't been compiled) won't have any line number information, so the coverage tool doesn't know which lines to add to the list of misses. In flutter's case, the test infra spawns many VMs, and each of these needs to recompile all those libraries.

To fix this, we need a way of skipping force compilation for libraries we've already seen in previous tests, without losing the information about which lines in each library are coverable. So I [added](https://github.com/dart-lang/coverage/pull/466) the `coverableLineCache` to `coverage.collect` in package:coverage v1.7.0. This cache starts out empty, but fills up with lists of all the lines that are coverable for every library as coverage is gathered. package:coverage can then tell the VM not to force compile any libraries in this cache (using `getSourceReport`'s `librariesAlreadyCompiled` param). So the first test suite will still have to compile everything, but subsequent test suites will be much faster.

This speeds up coverage collection significantly, for large test suites:

| Running flutter/packages/flutter tests... | Time | Overhead |
| --- | --- | --- |
| without coverage | 8:53 | - |
| with coverage | 20:25 | 130% |
| with `coverableLineCache` | 12:21 | 40% |

Bug: https://github.com/flutter/flutter/issues/100751
2023-10-23 20:16:03 +00:00
Pavel Mazhnik
3a1190a5a8
[flutter_tools] Support coverage collection for dependencies (#129513)
PR provides a new option to the `test` command to include coverage info of specified packages.  
It helps collecting coverage info in test setups where test code lives in separate packages or for multi-package projects.
At present, only current package is included to the final report.

Usage:

Consider an app with two packages: `app`, `common`.
Some of the tests in `app` use (indirectly) code that is located in `common`. When running with `--coverage` flag, that code is not included in the coverage report by default. To include `common` package in report, we can run:

```sh
flutter test --coverage --coverage-package app --coverage-package common
```

Note that `--coverage-package` accepts regular expression. 

Fixes https://github.com/flutter/flutter/issues/79661
Fixes https://github.com/flutter/flutter/issues/101486
Fixes https://github.com/flutter/flutter/issues/93619
2023-07-17 08:42:13 +00:00
Ben Konyi
ecd7518df5
Reland "Remove references to Observatory (#118577)" (#121606)
This reverts commit 275ab9c69b.
2023-02-28 11:57:04 -05:00
Michael Goderbauer
275ab9c69b
Revert "Reland "Remove references to Observatory (#118577)" (#121215)" (#121555)
Revert "Reland "Remove references to Observatory (#118577)""
2023-02-27 23:46:53 +00:00
Ben Konyi
fbae472fc3
Reland "Remove references to Observatory (#118577)" (#121215)
This reverts commit 298d8c76ba.
2023-02-27 09:26:43 -05:00
Casey Hillers
298d8c76ba
Revert "Remove references to Observatory (#118577)" (#120929)
This reverts commit 2df140f40d.
2023-02-16 21:28:30 -08:00
Ben Konyi
2df140f40d
Remove references to Observatory (#118577)
Observatory is being deprecated for Dart 3.0 so it should no longer be
referenced in tooling messaging / flags.

See https://github.com/dart-lang/sdk/issues/50233
2023-02-13 14:29:30 -05:00
Liam Appelbe
ea0ddc94cc
Fix NPE in coverage collector (#114177) 2022-10-27 19:24:00 -07:00
Liam Appelbe
0c14308404
Add branch coverage to flutter test (#113802) 2022-10-24 14:31:17 -07:00
Liam Appelbe
278ac62755
Migrate flutter_tools to use package:coverage (#111681) 2022-09-29 18:36:21 +00:00
jensjoha
981bdf5476
[flutter_tools] Make flutter test -v print timing of different phases (#108864) 2022-08-18 16:26:56 +00:00
jensjoha
803ef6a456
Improve coverage speed by using new caching option for package:coverage (#107395)
Speedup coverage test runs by using (new) coverage handle with caching.

On a `flutter test --coverage` run on `packages/flutter` the runtime goes from ~828 seconds to ~617 seconds, or a ~25% reduction in time spent (testing without coverage takes ~236 seconds so the overhead of `--coverage` in this case goes from ~592 seconds to ~381 seconds, or a ~35% reduction).
2022-07-13 11:07:59 +02:00
Jonah Williams
db829c1e20
[flutter_tools] migrate more unit tests to null safety (#106153) 2022-06-17 21:34:27 -07:00
Liam Appelbe
d2ba83d421
Use libraryFilters flag to speed up coverage collection (#104122)
* Use libraryFilters flag to speed up coverage collection

* Allow libraryNames to be null

* Unconditionally enable the reportLines flag

* Fix analysis errors
2022-05-19 12:19:52 -07:00
Alexandre Ardhuin
07f1c20474
add missing trailing commas in list/set/map literals (#102585) 2022-04-27 09:15:35 +02:00
Liam Appelbe
9afbab8477
Use report_lines flag in flutter coverage (#90142)
* Use the report lines flag

* Handle major version bumps in the version check

* Fix existing tests and add a new test
2021-09-16 11:33:32 -07:00
Jonah Williams
895b317e2c
[flutter_tools] use package:vm_service types for coverage collection requests (#80526) 2021-04-19 14:59:04 -07:00
Jenn Magder
a2f67720ef
Migrate test/src/common to null safety (#79907) 2021-04-06 22:55:03 -07:00
Jonah Williams
74bd7b6f6d
[flutter_tools] opt all flutter tool libraries and tests out of null safety. (#74832)
* opt out the flutter tool

* oops EOF

* fix import

* Update tool_backend.dart

* Update daemon_client.dart

* fix more
2021-01-27 15:17:53 -08:00
Jonah Williams
9b7b9d795e
[flutter_tools] reland remove flutter view cache (#56387)
Fixes #56194

Remove caching of FlutterView and poll forever if the list of flutter views is empty. Added test for missing release mode logic.
2020-05-05 12:09:51 -07:00
Jonah Williams
d98d3a973f
Revert "[flutter_tools] remove flutter view cache (#56223)" (#56385)
This reverts commit 209bdcb669.
2020-05-05 11:15:33 -07:00
Jonah Williams
209bdcb669
[flutter_tools] remove flutter view cache (#56223)
Remove caching of FlutterView. Perhaps the FlutterView RPC might return an empty list if the VM is not quite up yet? We had some old logic to poll the flutter views RPC for up to 200ms. That doesn't seem like a great approach, so instead we could forgo it entirely and trust that either the views come up before the developer tries to interact, or we crash.
2020-05-05 10:47:01 -07:00
Jonah Williams
ac2dfcf338
[version] update all versions (#56141) 2020-05-01 15:14:36 -07:00
Jonah Williams
534b0608ce
[flutter_tools] remove vm service (#55794)
Finishes the gradual vm service migration by deleting the flutter tooling's vm_service
2020-04-29 11:52:46 -07:00
Jonah Williams
723bc76847
[flutter_tools] update coverage collector to use vmservice api (#54682) 2020-04-13 16:10:02 -07:00
Ian Hickson
449f4a6673
License update (#45373)
* Update project.pbxproj files to say Flutter rather than Chromium

Also, the templates now have an empty organization so that we don't cause people to give their apps a Flutter copyright.

* Update the copyright notice checker to require a standard notice on all files

* Update copyrights on Dart files. (This was a mechanical commit.)

* Fix weird license headers on Dart files that deviate from our conventions; relicense Shrine.

Some were already marked "The Flutter Authors", not clear why. Their
dates have been normalized. Some were missing the blank line after the
license. Some were randomly different in trivial ways for no apparent
reason (e.g. missing the trailing period).

* Clean up the copyrights in non-Dart files. (Manual edits.)

Also, make sure templates don't have copyrights.

* Fix some more ORGANIZATIONNAMEs
2019-11-27 15:04:02 -08:00
Jonah Williams
349d694fb7
Revert "Added a null check for ranges in the sourceReport map. (#43667)" (#43827)
This reverts commit 0dc5ea4a95.
2019-10-30 10:57:35 -07:00
Larry McKenzie
0dc5ea4a95 Added a null check for ranges in the sourceReport map. (#43667) 2019-10-30 10:35:45 -07:00
Ian Hickson
d919e694b8
Move tools tests into a general.shard directory in preparation to changing how we shard tools tests (#36108) 2019-07-13 11:51:44 -07:00