Commit Graph

41 Commits

Author SHA1 Message Date
Danny Tuppeny
ce0e5c4330
[flutter_tools] Update the mapping for the Dart SDK internal URI (#151170)
This changes the mapping for the Dart SDK inside Flutter from `org-dartlang-sdk:///third_party/dart/sdk` to org-dartlang-sdk:///flutter/third_party/dart/sdk`. This URI changed in https://github.com/flutter/engine/pull/51917 but was not caught by tests because they only tested a specific set of mappings and there were no integration tests checking what URIs were actually produced by a running app.

So, this change also adds an integration tests that ensures that a real running app produces URIs that are then correctly mapped.

Fixes https://github.com/Dart-Code/Dart-Code/issues/5164.
2024-07-02 22:56:17 +00:00
Danny Tuppeny
cea1d6f055
Unpin DDS and roll pub packages (#147925)
DDS was temporarily pinned to 4.1.0 because 4.2.0 triggered some test
failures (see https://github.com/flutter/flutter/pull/147250). Those
failures should be fixed by vm_service 14.2.2, so this unpins DDS and
rolls both of these packages (along with devtools_shared, which is a DDS
dependency).

(If the bot updates vm_service before this is done, I can rebase over
that will reduce the size of this PR to just a few files)
2024-05-08 10:35:28 +01:00
Elliott Brooks
c1c7898b96
Bump dependencies in Flutter (#147546) 2024-04-29 15:53:25 -07: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
Mouad Debbar
7d9010c357
Typo fix in dartdoc in tool test (#139386)
The tree is red due a non-hermetic customer test from `macos_ui`. The
test was disabled in https://github.com/flutter/tests/pull/317 and an
issue was filed at https://github.com/macosui/macos_ui/issues/499.

We need this empty commit in order to re-run CI with the latest
https://github.com/flutter/tests.
2023-12-01 14:24:09 -05:00
Andrew Kolos
1328997b08
give throwsToolExit a more useful description (#136694)
Fixes https://github.com/flutter/flutter/issues/136698.

Alters how `throwToolExit` creates its matcher. This results is an improved description of the matcher.

The mismatch description isn't improved by this, but I writing an entirely custom matcher to fix this isn't ideal either. We can instead mitigate the issue by augmenting the `toString` implementation of `ToolExit` to include the exit code, if it is non-null.

With these changes, the first few lines of output from a test would look like this:

```
Expected: throws <Instance of 'ToolExit'> with `exitCode`: <42> and `message`: contains 'message'
  Actual: <Closure: () => Never>
   Which: threw ToolExit:<Exit code: 41232. Error: message>
```
2023-10-27 06:18:17 +00:00
Michael Goderbauer
b0a90aee17
Enable strict-inference (#135043)
Avoids that dynamic accidentally sneaks in, see https://dart.dev/tools/analysis#enabling-additional-type-checks
2023-09-20 19:59:08 +00:00
Danny Tuppeny
0386f910d1
[flutter_tools/dap] Improve rendering of structured errors via DAP (#131251)
In the legacy VS Code DAP, we would deserialise the Flutter.Error event
and provide some basic colouring (eg. stack frames are faded if not from
user code and the text is split between stdout/stderr to allow the
client to colour it).

In the new DAPs we originally used `renderedErrorText` which didn't
support either of these. This change adds changes to use the structured
data (with some basic parsing because the source classes are in
package:flutter and not accessible here) to provide a similar
experience.

It would be nicer if we could use the real underlying Flutter classes
for this deserialisation, but extracting them from `package:flutter` and
removing all dependencies on Flutter is a much larger job and I don't
think should hold up providing improved error formatting for the new
DAPs.

Some comparisons:


![1_comparison](https://github.com/flutter/flutter/assets/1078012/74e7e6d6-c8d0-471f-b584-37ae148b0ce7)


![2_comparison](https://github.com/flutter/flutter/assets/1078012/21888934-6f2f-4048-86d7-bdf92d5c7301)
2023-07-31 13:03:26 +01:00
Helin Shiah
0b44577f16
Add new hot reload case string (#130008)
This change is for an internal IDE client to send a custom hot reload
request, as custom requests from the client must start with `$/`.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above. (this PR is linked internally)
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2023-07-05 15:16:33 -04:00
Alexander Aprelev
581ebe2965
Roll dds dependency to 2.8.3 for expression evaluation upcoming fixes. (#128124)
The fix is coming as part of https://dart-review.git.corp.google.com/c/sdk/+/306908 dart sdk roll as well as https://github.com/flutter/flutter/pull/128084.

BUG=https://github.com/dart-lang/sdk/issues/52522
2023-06-02 23:31:07 +00:00
Danny Tuppeny
1a6a20cdc6
[flutter_tools] Include mode in app.start event, and forward app.start to DAP clients (#121239)
[flutter_tools] Include mode in app.start event, and forward app.start to DAP clients
2023-04-05 05:39:09 +00:00
Victoria Ashworth
d6593dee96
Make flutter_adapter_test more resilient to pub output (#124139)
Make flutter_adapter_test more resilient to pub output
2023-04-04 19:36:39 +00:00
Danny Tuppeny
cacef57b6e
[flutter_tools] Skip over "Resolving dependencies..." text in integration tests (#120077)
Sometimes when the integration tests run Flutter apps they get this output (perhaps based on timing of file modification times). Some of the tests want to verify strict output but not fail just based on these lines before the app starts.

See https://github.com/flutter/flutter/issues/120015 / https://github.com/flutter/flutter/pull/120016.
2023-02-16 10:12:16 -08:00
Christopher Fujino
c6b636fa51
[flutter_tools] Replace Future.catchError() with Future.then(onError: ...) (#120637)
* wip run_local_linter.dart

* get run_local_linter.dart working

* slow working implementation

* speed up run_local_linter.dart

* fix run_local_linter.dart

* remove catchError

* another fix

* fix another

* fix

* more fixes

* fix moar

* fix moar

* fix

* finish

* fix tests

* clean up further

* code review

* delete run_local_linter.dart
2023-02-15 19:03:00 +00:00
Brandon DeRosier
f10e625eb2
De-flake adapter integration test (#120016) 2023-02-04 15:29:59 -08:00
Danny Tuppeny
8387c2388b
[flutter_tools] Use base DAP detach and ensure correct output (#119076) 2023-02-02 13:28:12 -08:00
Danny Tuppeny
09bd0f6613
Support logging 'flutter run' communication to DAP clients (#118674)
* Support logging 'flutter run' communication to DAP clients

Fixes https://github.com/Dart-Code/Dart-Code/issues/4266.

* Fix test
2023-01-19 23:50:33 +00:00
Danny Tuppeny
5655225cd7
Send progress notifications to clients during hot reload / hot restart (#112455) 2022-09-29 16:27:40 +01:00
Danny Tuppeny
14626c0a6d
[flutter_tools] Test that DAP process terminates at the end of a session (#108301) 2022-08-02 20:44:06 +00:00
Danny Tuppeny
5d31b07ed5
[flutter_tools] [dap] Ensure DAP sends app.stop/app.detach during terminate (#108310)
* [flutter_tools] [dap] Ensure DAP sends app.stop/app.detach during terminate

Fixes an issue where the flutter_tester device may not be cleaned up correctly if we just terminate the Flutter process.

* Update integration test expectations

* Revert accidental commit
2022-07-26 10:48:38 +01:00
Danny Tuppeny
c67d2587d5
Provide more useful error message if a non-compliant DAP tool (or user) sends bad input to DAP server (#107827) 2022-07-19 11:48:05 -07:00
Danny Tuppeny
e2ef8cfe44
Pass app.started events to the DAP client + dart.debuggerUris for Profile mode (#106337) 2022-06-21 12:09:06 -07:00
Danny Tuppeny
147020366a
Fix issues running integration tests through DAP debug adapter (#104618)
* Fix issues running integration tests through DAP

These adapters were incorrectly trying to connect a DDS instance even when Flutter would create its own. This change disables DDS in the DAP layer and leaves it to Flutter (although it passes `--no-dds` on to Flutter if provided to the DAP process).

Also fixes an issue where we would unnecessarily connect the VM Service for tests even in 'noDebug' mode because of a change/fix that now includes a 'vmServiceUri' in the `test.startedProcess` event.
2022-05-26 09:36:30 +01:00
Michael Goderbauer
3fa355c97d
Remove dead code in tools tests (#104567) 2022-05-25 12:48:17 -07:00
Alexandre Ardhuin
07f1c20474
add missing trailing commas in list/set/map literals (#102585) 2022-04-27 09:15:35 +02:00
Danny Tuppeny
675b961573
Unpause and remove breakpoints when detaching from Flutter process with DAP (#101695) 2022-04-11 21:15:37 +01:00
Michael Goderbauer
a01424773e
Enable unnecessary_import (#101600) 2022-04-08 12:56:45 -07:00
Danny Tuppeny
b39a9473f8
Handle Flutter.Error events and disable structure errors for noDebug mode (#100149) 2022-03-17 16:05:21 -07:00
Danny Tuppeny
c659ad6ace
Add support for attachRequest in DAP, running "flutter attach" (#97652)
* Add support for attachRequest in DAP, which runs "flutter attach"

* Update DAP docs for attachRequest

* Improve doc comments

* Fix comments

* Remove noDebug from attach + create a getter for `debug`

* Fix indent
2022-02-07 18:54:07 +00:00
Lau Ching Jun
d7688ca093
Change all instance of throwing strings to throw specific error classes. (#97325) 2022-02-02 10:45:18 -08:00
Caio Agiani
29b44f79d9
packages: fix typos recieve => receive (#97488) 2022-01-31 08:43:15 -08:00
Danny Tuppeny
4fa0e0d449
Make DAP tests more tolerant of output that didn't come from the app being tested (#97291)
Fixes #97238.
2022-01-29 10:03:31 +00:00
Danny Tuppeny
942de67838
Make remaining DAP tests null-safe (#97368) 2022-01-27 20:08:17 +00:00
Michael Goderbauer
5684b9f69e
Enable no_leading_underscores_for_local_identifiers (#96422) 2022-01-21 14:43:59 -08:00
Danny Tuppeny
b865e23aeb
Don't treat stderr output as failures during DAP test teardown (#94335) 2021-12-01 07:19:04 -08:00
Nate Bosch
6d1a840bc5
Roll packages, remove unnecessary overrides (#94172) 2021-11-24 14:43:05 -08:00
Danny Tuppeny
77fca35877
[DAP] Add a custom event to pass flutter.serviceExtensionStateChanged… (#93870) 2021-11-22 20:12:33 -08:00
Danny Tuppeny
99e85b1c5f
Disable pause-on-exceptions for (outgoing) isolates during hot restart (#93411) 2021-11-18 22:23:09 -08:00
Jenn Magder
9e88fe328e
Remove globals_null_migrated.dart, move into globals.dart (#92861) 2021-11-01 17:18:03 -07:00
Danny Tuppeny
57dbf7f7e7
Add support for running tests through debug-adapter (#92587)
* Add support for running tests through debug-adapter

* Improve comments about stdout + remove pedantic
2021-10-28 11:34:05 +01:00
Danny Tuppeny
de966d8a49
Add a "flutter debug_adapter" command that runs a DAP server (#91802) 2021-10-27 06:48:06 -07:00