Commit Graph

4156 Commits

Author SHA1 Message Date
Loïc Sharma
ede7fc67f5 Add more CMake unit tests (#106076)
Currently CMake is tested entirely through `build_linux_test.dart`. However, CMake is also used for Windows builds. This adds additional "generic" tests:

1. Parsing CMake files
2. Generating CMake config files.

In the future, this will be used to test that generated CMake config files contain the expected version information, which will be used to flow version information to Windows executables.

Part of https://github.com/flutter/flutter/issues/73652.
2022-06-16 11:48:17 -07:00
Christopher Fujino
589dd8028b [flutter_tools] print override storage warning to STDERR instead of STDOUT (#106068) 2022-06-15 23:22:06 +00:00
Jonah Williams
92034482f9 [flutter_tool] partial null safety migration of tool source code (#105798) 2022-06-15 20:02:07 +00:00
Christopher Fujino
d31c250e38 [flutter_tools] Fix leaky test (#105927) 2022-06-13 16:12:29 -07:00
Elliott Brooks (she/her)
fe57704594 Enable skipped test for Dart URI logs from DWDS (#105274) 2022-06-09 15:03:11 -07:00
Lau Ching Jun
d30ad47eda Make flutter attach respect the --dds-port flag. (#105560) 2022-06-09 13:03:09 -07:00
Christopher Fujino
8bea63287a [flutter_tools] add shuffle to hermetic run_tests (#105462) 2022-06-09 12:53:09 -07:00
Lasse R.H. Nielsen
c951d2d7a0 Stop using FallThroughError. (#105600) 2022-06-08 22:38:08 -07:00
Gary Qian
696110ba46 Migrate apply (#102787) 2022-06-06 17:38:06 -07:00
Nils Reichardt
64db621980 Remove new keyword in a few files (#104438) 2022-06-06 16:08:06 -07:00
Gary Qian
e9a3cbf2b4 Migrate abandon (#102789) 2022-06-06 12:58:07 -07:00
Christopher Fujino
712752d2fb [flutter_tools] return terminal to echo and line mode before exiting resident_runner (#105283) 2022-06-06 10:19:40 -07:00
Jenn Magder
003f2b69d2 Pass run and drive --trace-systrace for iOS (#105321) 2022-06-03 16:48:11 -07:00
Gary Qian
0895130e51 Migrate status (#102785) 2022-06-03 16:43:11 -07:00
Jesús S Guerrero
3da9eee2f0 [flutter_tools] re-use findProjectRoot on flutter command (#104850) 2022-06-03 15:23:10 -07:00
Jesús S Guerrero
889a15eb9d [flutter_tools] add needsFullRestart flag on hot runner (#104562) 2022-06-03 10:18:16 -07:00
Jenn Magder
3f1f0a8170 Add flutter build macos-framework command (#105242) 2022-06-03 10:13:08 -07:00
Emmanuel Garcia
975e04ba6d Move corrupted zip to a separate handler and ask user (#105054) 2022-06-03 10:08:08 -07:00
jensjoha
9929446ea3 Extra timing on hot reload (#104242)
This PR adds extra timings for a hot reload.
As an example, before a user might see

> Performing hot reload...                                                
> Reloaded 1 of 788 libraries in 554ms.

With this PR it would instead be something like

> Performing hot reload...                                                
> Reloaded 1 of 788 libraries in 554ms (compile: 33 ms, reload: 153 ms, reassemble: 310 ms).
2022-06-03 08:41:14 +02:00
Jenn Magder
208a418abc flutter drive --enable-software-rendering --skia-deterministic-rendering (#105161) 2022-06-02 13:33:08 -07:00
Jenn Magder
dffddf00a2 Refactor BuildIOSFrameworkCommand with common darwin baseclass (#105194) 2022-06-02 10:28:08 -07:00
Christopher Fujino
99d0f8f279 [flutter_tools] handle HandshakeException in httphostvalidator (#105076) 2022-06-01 14:08:13 -07:00
Christopher Fujino
ac791adbc0 [flutter_tools] flutter daemon handles a closed stdout IOSink (#105075) 2022-06-01 10:08:13 -07:00
Emmanuel Garcia
3b20fb3f89 Retry builds when SSL exceptions are thrown (#105078) 2022-05-31 19:53:12 -07:00
Gary Qian
c02be8cd47 Support string compileSdkVersion for preview android SDKs (#104662) 2022-05-31 13:08:09 -07:00
Anna Gringauze
5cd979e441 Retry getting tabs in chrome launcher on ConnectionException (#104218) 2022-05-26 15:20:11 -07:00
Gary Qian
cc733660ed Add link to more detailed multidex information. (#104558) 2022-05-26 13:05:08 -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
Jenn Magder
09987dc00a Migrate create command to null safety (#104484) 2022-05-24 18:48:10 -07:00
Jenn Magder
a56c5e51ae Migrate some test files to null safety (#104469) 2022-05-24 16:53:08 -07:00
Jesús S Guerrero
336aa267f9 [flutter_tools] General info project validator (#103653) 2022-05-24 16:28:10 -07:00
Loïc Sharma
c29a7a2d22 Ignore replacement characters from vswhere.exe output (#104284)
Flutter uses `vswhere.exe` to find Visual Studio installations and determine if they satisfy Flutter's requirements. However, `vswhere.exe`'s JSON output is known to contain bad UTF-8. This change ignores bad UTF-8 as long as they affect JSON properties that are either unused, or, used only for display purposes by Flutter.

Fixes: https://github.com/flutter/flutter/issues/102451
2022-05-24 13:30:37 -07:00
Chris Bracken
f9765c136f [tool] Add tests for FakeProcessManager (#104456)
Adds a bit more clarifying documentation to the implementation of the
outputFollowsExit case, and adds tests that verify the behaviour of
stderr, stdout of processes launched via FakeProcessManager.

Specifically:
* Verifies that stderr, stdout are not emitted immediately after process
  exit if outputFollowsExit is true. They must be emitted at least one
  turn through the event loop later.
* Verifies that ProcessResult.stderr, stdout have the type documented
  according to the encoding passted to Process.run/runSync:
  * List<int> if null is passed as the encoding.
  * String (in the default system encoding) if no encoding is specified.
  * String (in the specified encoding) if an encoding is specified.

This is additional testing relating to refactoring landed in:
https://github.com/flutter/flutter/pull/103947

Issue: https://github.com/flutter/flutter/issues/102451
2022-05-23 22:57:34 -07:00
Jenn Magder
c5d046c00c continue->next in Ruby script (#104296) 2022-05-23 18:43:05 -07:00
Chris Sells
4c66e304d1 fixes 103234 to enable debugging Flutter apps on VR headset (#104135) 2022-05-20 21:58:09 -07:00
Loïc Sharma
52e19ef7ec Refactor vswhere.exe integration (#104133)
`VisualStudio` calls `vswhere.exe` to find Visual Studio installations and determine if they satisfy Flutter's requirements. Previously, `VisualStudio` stored the JSON output from `vswhere.exe` as `Map`s, resulting in duplicated logic to read the JSON output (once to validate values, second to expose values). Also, `VisualStudio` stored two copies of the JSON output (the latest valid installation as well as the latest VS installation).

This change simplifies `VisualStudio` by introducing a new `VswhereDetails`. This type contains the logic to read `vswhere.exe`'s JSON output, and, understand whether an installation is usable by Flutter. In the future, this `VswhereDetails` type will be used to make Flutter doctor resilient to bad UTF-8 output from `vswhere.exe`.

Part of https://github.com/flutter/flutter/issues/102451.
2022-05-20 10:12:25 -07:00
Zachary Anderson
ab7f6e5cfe Pass --verbosity=error to the Dart front-end (#104020) 2022-05-20 09:10:31 -07:00
Emmanuel Garcia
0052566c7e Show custom error message when Kotlin or Gradle bump is required (#102421) 2022-05-19 14:38:13 -07:00
Christopher Fujino
586b15cbcb [flutter_tools] Upgrade only from flutter update-packages (#103924) 2022-05-19 13:33:11 -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
Jonah Williams
851c9521c7 [flutter_tools] pass --compact-async to frontend_server (#104026) 2022-05-17 19:52:10 -07:00
Jenn Magder
52ddc9d174 Handle null values during yaml metadata parsing validation (#104022) 2022-05-17 18:32:09 -07:00
Chris Bracken
9d9e272e70 [tool] Add tests for FakeProcess (#104013)
Because this class has some subtle behaviour with regards to control of
exit timing and when and how it streams data to stderr and stdout, it's
worth adding unit tests for this class directly, as well as (in a
followup patch) for FakeProcessManager.

This is additional testing relating to refactoring landed in:
https://github.com/flutter/flutter/pull/103947

Issue: https://github.com/flutter/flutter/issues/102451
2022-05-17 16:54:08 -07:00
Christopher Fujino
0116b2e77d [flutter_tools] fix RangeError in flutter channel command (#103766) 2022-05-17 16:22:12 -07:00
Jonah Williams
2ad7ced916 [flutter_tools] pass --enable-impeller to android (#104014) 2022-05-17 15:52:09 -07:00
Aman Verma
8fbf89b9f2 [flutter_tools] throw error when argResults is null (#103827) 2022-05-17 12:37:08 -07:00
Lau Ching Jun
a633f3df32 Add ability for PrebuiltWindowsApp to accept a zip archive. (#103918) 2022-05-17 11:27:11 -07:00
Chris Bracken
928bb1229b [tool] Consistent FakeProcessManager.run/runSync (#103947)
`FakeProcessManager` is a test-oriented implementation of `ProcessManager`
that simulates launching processes and returning `ProcessResult` objects
whose `exitCode`, `stdout`, `stderr` can be used to write platform-portable,
hermetic tests that don't rely on actually launching processes from
executables on disk. Its `run` and `runSync` methods provide asynchronous and
synchronous variants of this functionality.

Previously, the behaviour of `run` and `runSync` were inconsistent with
regards to the treatment of the `stdoutEncoding` (similarly,
`stderrEncoding`) parameters:

`run`:
* if the encoding was null, `ProcessResult.stdout` was returned as a
  String in UTF-8 encoding. This was incorrect. The behaviour as
  specified in `ProcessResult.stdout` is that in this case, a raw
  `List<int>` should be returned.
* If the encoding was unspecified, `ProcessResult.stdout` was returned as
  a `String` in the `io.systemEncoding` encoding. This was correct.
* If the encoding was non-null, `ProcessResult.stdout` was returned as a
  `String` in the specified encoding. This was correct.

`runSync`:
* if the encoding was null, `ProcessResult.stdout` was returned as a
  `List<int>` in UTF-8 encoding. This was incorrect. The behaviour as
  specified in `ProcessResult.stdout` is that in this case, a raw
  `List<int>` should be returned.
* If the encoding was unspecified, `ProcessResult.stdout` was returned as
  `List<int>` in UTF-8 encoding. This was incorrect. The behaviour as
  specified in `ProcessResult.stdout` is that in this case, a String a
  `String` in the `io.systemEncoding` encoding should be returned.
* if the encoding was non-null, `ProcessResult.stdout` was returned as a
  `String` in unknown (but probably UTF-8) encoding. This was incorrect.
  The behaviour as specified in `ProcessResult.stdout` is that in this
  case, a `String` in the specified encoding should be returned.

`_FakeProcess`, from which we obtain the fake stdout and stderr values now
holds these fields as raw `List<int>` of bytes rather than as `String`s. It
is up to the user to supply values that can be decoded with the encoding
passed to `run`/`runAsync`.

`run` and `runAsync` have been updated to set stdout (likewise, stderr) as
specified in the `ProcessResult` documentation.

This is pre-factoring for #102451, in which the tool throws an exception
when processing the JSON output from stdout of the `vswhere.exe` tool,
whose output was found to include the `U+FFFD` Unicode replacement
character during UTF-8 decoding, which triggers a `toolExit` exception
when decoded using our [Utf8Decoder][decoder] configured with `reportErrors` =
true. Because `FakeProcessManager.runAsync` did not previously invoke
`utf8.decode` on its output (behaviour which differs from the non-fake
implementation), it was impossible to write tests to verify the fix.

Ref: https://api.flutter.dev/flutter/dart-io/ProcessResult/stdout.html

Issue: https://github.com/flutter/flutter/issues/102451

[decoder]: fd312f1ccf/packages/flutter_tools/lib/src/convert.dart (L51-L60)
2022-05-17 11:15:54 -07:00
Jenn Magder
bf7a32628e Up CocoaPods minumum to 1.10 (#103655) 2022-05-16 17:42:19 -07:00