Port the deprecated settings devicelab test to tool integration shard. Tests that apps can be built using the deprecated android/settings.gradle file.
Part of #65790
Currently these tests are taking CI time without providing any value, because there is no verification that network connectivity is avoided. This is better covered by a unit test that verifies that --offline is passed to pub.
To allow tests to begin migrating to null safety, sound null safety needs to be disabled. Also removes the experiment flag that is unnecessary since the framework is on the SDK allowlist.
Like Android/iOS, only enable --null-assertions if asked. Previously this was enabled by default for web, but in general this has proved to be too breaking to enable by default.
#61042
This reverts #62710, since it has a noSuchMethodError in some circumstances.
This isn't just a straight git revert, because I had to resolve the conflicts in the reverted pubspec.yaml files and re-run flutter update-packages --force-upgrade to make the checksums match.
There are some occasional difficult to repro flakes on the tool integration tests. Try running only a single isolate to simplify the environment a bit.
Enable null safety asserts for web debug mode. This induces runtime asserts at the boundaries between null safe and non-null safe libraries. Adds integration test that validates assertion error is thrown.
#61042
Use tester (disclaimer, written by me) to unit test the flutter tools general shard. Since these tests are designed to be hermetic, the single compilation/single isolate model offers a tremendous speedup over the default pub run test workflow. On previous linux shard, test execution alone took 10:30, while now it takes only 1:30.
Update all versions, specifically file which fixes some bugs that caused tests to fail if run in different orders:
- systemTemp directories created by MemoryFileSystem will allot names based on the file system instance instead of globally.
- MemoryFile.readAsLines()/readAsLinesSync() no longer treat a final newline in the file as the start of a new, empty line.
- RecordingFile.readAsLine()/readAsLinesSync() now always record a final newline.
Ensure that the language version of the test/web generated entrypoint matches the language version of the test file to run, or the overall package language version if no annotation is provided.
Also combines experiments into extraGenSnapshot/ExtraFrontEndOptions. Allows providing --no-sound-null-safety to allow out of order migration and running.
Fixes#58003
The .dart_tool directory can contain build assets, as well as the package_config.json file - the replacement for .packages. Remove it for the same reason we remove .packages
An upcoming Dart SDK change
(fa2fd41166)
changes the precise text of the exception generated by `utf8.decode`
if a non-UTF8 file is found. This is causing a breakage in the Dart
team's `flutter-analyze` bot (and will presumably cause a breakage in
the corresponding Flutter bot as soon as this change is rolled into
Flutter). To avoid this breakage, the bot shouldn't rely on the exact
exception text; it is sufficient to simply catch a FormatException.
Ensure iOS and android builds can be correctly cached. Use the performance-measurement-file to verify that all targets were skipped on the second invocation. This is only run on the flutter_gallery build.
This moves the app template more toward being a more generic starting
point for any Flutter application, eliminating some hard-code
assumptions about there being a single window/engine pair that is
directly bound to the life of the application:
- Moves the runloop into its own class, making it capable of servicing
any number of engine instances.
- Moves the logic for setting up a window containing only a Flutter view
into a window subclass for ease of re-use.
- Makes quit-on-window-close an optional property. (Long term this
should be even more generic, like a quit-when-last-window-closes
option, but this is a short-term improvement that removes the binding
between the runloop and the window).
- Allows for multiple instances of Win32Window to exist without issues
relating to the window class registration.
Since there are getting to be a non-trivial number of files associated
with the runner, this moves the source into a runner/ directory, as is
already done on some other platforms.
Note that creating multiple Flutter windows at the same time still
doesn't work correctly even with this change, but this addresses some of
the known issues, and makes it easier to test in the future (e.g., for
debugging engine-level issues with multiple instances).
Fixes#45397
Adds initial support for flutter create of apps and plugins. This is derived from the current FDE example app and sample plugin, adding template values where relevant.
Since the APIs/tooling/template aren't stable yet, the app template includes a version marker, which will be updated each time there's a breaking change. The build now checks that the template version matches the version known by that version of the tool, and gives a specific error message when there's a mismatch, which improves over the current breaking change experience of hitting whatever build failure the breaking change causes and having to figure out that the problem is that the runner is out of date. It also adds a warning to the create output about the fact that it won't be stable.
Plugins don't currently have a version marker since in practice this is not a significant problem for plugins yet the way it is for runners; we can add it later if that changes.
Fixes#30704
* Fix web test flakiness; enable web golden tests
The fix is three-part:
- Only allow one test to load _and_ test at any point in time.
- Use a fresh Chrome instance for each test file.
- Increase Cirrus resources.
The first two changes only fix the "Unknown error loading" error, but not hanging tests. The resource increase also prevents hanging tests.
Other minor changes:
- Remove test batching (it's no longer necessary)
- Fix the Chrome class, which was using the wrong Completer.
Move Flutter Gallery to dev/integration_tests/ as it is an older copy used only for testing. The current version of the Flutter Gallery now lives in https://github.com/flutter/gallery.
The stocks example app is outdated and deprecated, but we still use it for some benchmark tests. Moving it into the benchmarks directory to indicate its status.
dev_finder name is deprecated. device-finder is preferred.
Functionality remains identical, this is an aesthetic change.
This change was generated via:
$ find . -not -path '*/\.*' -type f -exec sed -i 's/(^import.*)!dev_finder/device-finder/g' {} \;
* [fuchsia] Create an entry-point script to run driver tests on Fuchsia
This script currently only paves the device. This will soon run a
driver test on a NUC in LUCI.
* reference the engine script and fix comment
* Update packages.
* Add many more global analyses.
* Catch trailing spaces and trailing newlines in all text files.
Before we were only checking newly added files, but that means we
missed some.
* Port the trailing spaces logic to work on Windows too.
* Correct all the files with trailing spaces and newlines.
* Refactor some of the dev/bots logic into a utils.dart library.
Notably, the "exit" and "print" shims for testing are now usable
from test.dart, analyze.dart, and run_command.dart.
* Add an "exitWithError" function that prints the red lines and
then exits. This is the preferred way to exit from test.dart,
analyze.dart, and run_command.dart.
* More consistency in the output of analyze.dart.
* Refactor analyze.dart to use the _allFiles file enumerating logic
more widely.
* Add some double-checking logic to the _allFiles logic to catch
cases where changes to that logic end up catching fewer files
than expected (helps prevent future false positives).
* Add a check to prevent new binary files from being added to
the repository. Grandfather in the binaries that we've already
added.
* Update all the dependencies (needed because we now import crypto in
dev/bots/analyze.dart).
* Support Flutter Driver test for Flutter Web application.
* Support Flutter Driver test for Flutter Web application.
* Fix documentation issues.
* Support Flutter Driver test for Flutter Web application.
* Fix documentation.
* Remove unused file from dartdoc check.
* Sync to date.
* Revert change to dartdoc.
* Address comments.
* Apply suggestions from code review
Co-Authored-By: Jonah Williams <jonahwilliams@google.com>
* Update copyrights.
* Update allowed list for browsers.
* Verify command line arguments for Drive command is correctly parsed.
* Make waitUntilFirstFrameRasterized throw unimplementedError for Flutter Web Driver.
* Add comment for why sync WebDriver is used.
* Update documentations.
* Add more unit tests and update documentation.
* Configure test.dart so that web_extension_test will be executed with --platform=chrome.
* Revert unnecessary changes.
* Add new file path for Windows to blacklist.
* Reconstruct the structure of flutter_driver/test/src folder to remove filtering logic in dev/bots/test.dart/
* Fix path to web_extension_test.dart.
* Add instructions for how to use WebFlutterDriver.
* Update getLayerTree to use sendCommand instead of _sendCommand.
* Update pubspec files.
* Add tests to gen_l10n.dart tool
* Separate out LocalizationsGenerator class to improve testability of code
* Add testing dependencies to dev/tools
* Integrate dev/tools testing to flutter CI
* Restructure dev/tools folder for testing
* Fix license headers
* Relicense Shrine demo to match rest of repository
The Shrine demo was Apache-licensed. The code was mostly
Google-written, with contributions from:
- Michelle Dudley (@michdud)
- Abhijeeth Padarthi <rkinabhi@gmail.com> (@rkinabhi)
- @a14n
I contacted all three, and they confirmed their approval for this
change, as described below.
Abhijeeth Padarthi said by e-mail on Thu, Nov 21, 2019 at 5:48 PM:
> hi Ian,
>
> sure :)
>
> let me know if I need to do anything on my end..
Michelle Dudley wrote by e-mail on Sun, Nov 24, 2019 at 2:07 PM:
> Hi Ian,
>
> That would be ok with me.
>
> Thanks,
>
> Michelle
@a14n said on Discord's Flutter server in the #hackers channel at 10:44PM on Thursday, November 21, 2019:
> @Hixie no problem I agree with this relicensing
* Remove shrine loophole from license checker.
* 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
This fixes the sample code analysis to treat dartpad snippets in the same way as snippet snippets, which it wasn't until now (the snippet generator was treating them as "samples"), and some errors crept in. This PR also fixes those errors.
Also, added a --verbose option to the sample analyzer.