* Skip tests instead of expecting failure, because expected failure = timeout which is slow
Some of these tests are known to fail and were coded to expect it; however because the failure is a timeout it's just dragging out test runs (shortening timeouts will make the tests flakier).
* Make it easier to find skipped tests
* Change SKIP to TODO
Disallow calling stop() or cancel() multiple times. This means that
when you use startProgress you have to more carefully think about what
exactly is going on.
Properly cancel startProgress in non-ANSI situations, so that
back-to-back startProgress calls all render to the console.
Disallow calling stop() or cancel() multiple times. This means that
when you use startProgress you have to more carefully think about what
exactly is going on.
Properly cancel startProgress in non-ANSI situations, so that
back-to-back startProgress calls all render to the console.
* Skip integration tests that use flutter-tester on Windows
This is known to be broken. I will un-skip all of these once a fix for flutter-tester lands on Windows.
* Save with added import!
* Add tests to ensure flutter run does not quit at startup
These tests require https://github.com/dart-lang/vm_service_client/pull/38 to be merged and currently the third test (pause-on-exceptions) fails because of a bug.
* Remove TODO
Probably makes most sense this way for now.
* Address PR comments
* Add `--dry-run` option to `flutter format` sub command
* Add `--set-exit-if-changed` option to `format` sub command
* Add `--machine` option to `format` sub command
* Make variable names to be not shorthand: cmd -> command
Fix https://github.com/flutter/flutter/pull/18360#discussion_r199656120
* Extract some of startApp into a reusable method
* Get basic attach --machine working
* Attach --machine tweaks
Move validation to validate method and create daemon early so we get the startup event before trying to get a connection.
* Bump daemon version so we know whether it's valid to flutter attach
* Tweak output text
* Swap package imports for relative
* Review tweaks (naming, formatting, typedefs)
* Separate arguments from process spawning
This will make calling attach easier
* Add a basic test for flutter attach --machine
* Fix crash if port unforward modifies the list of forwarded ports
* Add a no-op port forwarder for flutter-tester
* Switch to using BasicProject instead of our own inline code
* Fix expectation in test now we have a portForwarder
* Remove stale TODO (this is done)
* Tweak formatting
* Change some Completers to void to fix Dart 2 issues
* Make cleanup of flutter processes in tests more reliable
* Fix quit signals
I confused SigInt&SigTerm for SigTerm&SigKill when I first did this. SigTerm can be blocked and doesn't guarantee the process will be terminated.
* Don't use deprecated constants
* Fix typo
* Add some additional info to debug buffer
* Fix return types on Futures
* Only printError on our simple messages
Any other type is a real error that should be a normal crash (to get a proper error log).
See #19453.
* Add toList() to convert Iterable<String> -> List<String>
This code previously throw in Dart-2 mode.
Fixes#19453.
* Move getSimulatorPath into Xcode
* Add a test that we tried to launch the simulator
* Remove unused import
This uses @kevmoo's completion package to do command line completion for flutter, and a new command "bash-completion" (with alias "zsh-completion") that will output the necessary shell script setup code, and adds the hidden command "completion" that does the actual completion.
Because it adds a dependency, I also had to do flutter update-packages --force-upgrade.
Fixes#18988.
* Allow a longer timeout for app launches
* Include timings in errors when waiting for events
* Extract a helper that adds a timeout and includes message logging
* Ensure all timeouts include messages
* Ensure logs are set up before we invoke actions
* Ensure all messages are logged during timeout periods
This adds a new stream _allMessages that collects all output (as routed through debugPrint) and updates _timeoutWithMessages to use that instead of stdin/out of only the flutter run process (since that was missing stdin - the sends, and both input/output to the VM service).
* Revert "Revert "Roll engine to fed2ea458ed49088d33eddabc546ba56d600c717 (includes dart roll) (#19044)" (#19276)"
This reverts commit cf932490b7 as it also
includes fix for type error that broke tests.
* Add type cast for dart2 type checks.
* Move up to latest goldens
* Make inDirectory() type-parameterized.
* Add typecasting to transitions_perf_test.dart and microbenchmarks.
* Add boolean flag initialization in save_catalog_screenshots.dart
* Add type conversion to gallery transition test
ios-deploy relies on LLDB.framework, which relies on /usr/bin/python and
the 'six' module that's installed on the system. However, it appears to
use the first version of Python on PATH, rather than explicitly
specifying the system install. If a user has a custom install of Python
(e.g., via Homebrew or MacPorts) ahead of the system Python on their
PATH, LLDB.framework will pick up that version instead. If the user
hasn't installed the 'six' module, ios-deploy will fail with a
relatively cryptic error message.
This patch pushes /usr/bin to the front of PATH for the duration of the
ios-deploy run to avoid this scenario.
This patch also removes checks for package six.
Neither Flutter nor any of its direct dependencies/tooling relies on
package six. ios-deploy depends on LLDB.framework (included with Xcode),
which relies on a Python script that imports this package but uses
whichever Python is at the front of the path. Flutter now invokes
ios-deploy with a PATH with /usr/bin forced to the front in order to
avoid this problem.
We could have retained the check out of paranoia, but this seems
unnecessary since it's entirely possible LLDB.framework may one day drop
this dependency, in which case I'd expect the base system install of
Python would likely drop it as well.
* Roll engine to rolled dart
Add connectionTimeout property to class that extends HttpOverrides.
Upgrade packages.
Add more type fixes.
Update goldens hash.
Add more type fixes.
Upgrade packages.
Fix tests.
Remove strong-mode from analysis options yaml file.
Increase dev/devicelab timeout from 2 to 10 seconds.
Added getVM to waitForViews. Fix type errors in compileExpression.
* Pick up engine revision with fix for microbenchmarks regression.
Increase default timeout from 20/30 to 60s.
* Rename util -> test_utils
* Rename flutter_test_driver -> test_driver
* Switch testWithContext -> test
* Remove unused import
* Move test project into a class to make it easier to have multiple of these
Each "TestProject" class can contain its files and things like named breakpoint locations.
* Split expression evaluation tests into own file
* Include last response in error messages
* Update expectations based on current bugs
* Fix async-ness in tests
* Fix incorrect expectation in test
* Fix incorrect evaluations
* Remove skips for tests that are now passing on master
* Expect pass on Linux
🤷♂️
* Call the code
* Skip expression evaluation tests on Windows
* Skip whole group, not just one test
* Remove duplicated method from merge
* Fix misplaced close of group
* Remove code that was duplicated from test we copied
Not sure how this ended up in here?
* Re-fix typo
* Adding a setup function for hot restart that can be overwritten to perform any necessary initialization before a restart is started.
* Adding a test for setupHotRestart
* Removing local pubspec change
* Fixing some type annotation errors
* Responding to comments
This test was designed to ensure flutter_tester keeps running (previously it would quit immediately). However it's turned out ot be rather flaky and we have new tests on the way that supersede this by actually testing real things (debug stepping, reloading, expression evaluation).
* Remove the 'app' domain from flutter daemon
By default the daemon won't register the "app" domain, you need to opt-in (which the 'run' command does, as well as the tests for the app functionality).
Fixes#6658.
* Tweak text
* Put restart/callServiceExtension/stop back into daemon mode
* Add a comment about removing discoverApps
After landing the un-skip this test failed with a timeout. It then passed on the next build (!). I think it's too flaky to leave running until we can better diagnose what's happening.
* Add --create option to flutter emulators
* Tweaks to error message
* Simplify emulator search logic
* Make name optional
* Add a note about this option being used with --create
* Tweaks to help information
* Switch to processManager for easier testing
* Don't crash on missing files or missing properties in Android Emulator
* Move name suffixing into emulator manager
This allows it to be tested in the EmulatorManager tests and also used by daemon later if desired.
* Pass the context's android SDK through so it can be mocked by tests
* Misc fixes
* Add tests around emulator creation
Process calls are mocked to avoid needing a real SDK (and to be fast). Full integration tests may be useful, but may require ensuring all build environments etc. are set up correctly.
* Simplify avdManagerPath
Previous changes were to emulatorPath!
* Fix lint errors
* Fix incorrect file exgtension for Windows
* Fix an issue where no system images would crash
reduce throws on an empty collection.
* Fix "null" appearing in error messages
The name we attempted to use will now always be returned, even in the case of failure.
* Add additional info to missing-system-image failure message
On Windows after installing Andriod Studio I didn't have any of these and got this message. Installing with sdkmanager fixed the issue.
* Fix thrown errors
runResult had a toString() but we moved to ProcessResult when switching to ProcessManager to this ended up throwing "Instance of ProcessResult".
* Fix package import
* Fix more package imports
* Move mock implementation into Mock class
There seemed to be issues using Lists in args with Mockito that I couldn't figure out (docs say to use typed() but I couldn't make this compile with these lists still)..
* Rename method that's ambigious now we have create
* Handle where there's no avd path
* Add another toList() :(
* Remove comment that was rewritten
* Fix forbidden import
* Make optional arg more obviously optional
* Reformat doc
* Note that we create a pixel device in help text
* Make this a named arg
* Improve update checking
This change emables pinging the server to check for updates regardless of whether the local version is "out of date". The server code already has a 7-day cache so the result is that we can now ping the server once every 7 days instead of waiting for the local install to be 4 weeks out of date before pinging.
The original 4 week period is still used for when we'll start warning the user they're out of date if we could not confirm with the server whether there's a new version.
* Improve message when we know there's a new version available
* Fix bnullable bool checks
* Switch nullable bool to enum
* Fix casing of enum values
* Remove stale comment
The names are now descriptive so doesn't need additional explanation.
* Improve name of function
* Remove note:
* Rename kPauseToLetUserReadTheMessage -> timeToPauseToLetUserReadTheMessage
* Change kVersionAgeConsideredUpToDate to 5 weeks from 4
* Inline the isNewerFrameworkVersionAvailable check
* Fix indenting (?)
* Fix more indenting
* Rename function to be clearer it's getting the commit date
* Formating tweaks
* Update stamp when connection failed, and reduce time before we'll try again
Previously we would hit the server on every command if we thought we might be out of date and we never successfully connected (eg. if you're offline). This makes the stamp update even when there's a conneciton failure so that this won't happen, but reduces the time till we check again from 7 days to 3 days to compensate a little in case it was a one-off.
https://github.com/flutter/flutter/pull/18193#issuecomment-399222269
* Fix comment
* Don't perform update checks if not on an official channel
This test is failing on mac_bot (but passing elsewhere) because flutter-tester is apparently quitting earlier than expected. Locally it fails with an even weirder error and almost all tests are failing with "Compilation failed" (this isn't happening on the builds, so something is bad on my MacBook). Marking as skip to fix build while investigating; there's no real impact of this test not running; it's testing a tool that its itself used for testing (and not currently in any way that should be affected by this failure).
fuchsia_tester.dart still assumes Dart 1. Previously, it ran tests directly
from source, flutter_platform.dart automatically runs a kernel compile when
operating in Dart 2 mode, but this assumes a functional Dart SDK is available
in the artifacts directly, and fuchsia_tester.dart mocks out the artifacts
directory with an empty temp dir.
Remaining work is:
1. Get the frontend server building as a dependency on Fuchsia.
2. Patch fuchsia_tester.dart to use a valid Dart SDK and frontend server.
This also reverts migration to Dart 2 typedef syntax.
This reverts commit 6c56bb2. (#18362)
This reverts commit 3daebd0. (#18316)
Now that Dart 1 is turned off, reapplying my change to turn on the prefer_generic_function_type_aliases analysis option, and fix all the typedefs to Dart 2 preferred syntax.
Also eliminated the unused analysis_options_repo.yaml file and turned on public_member_api_docs in analysys_options.yaml.
No logic changes, just changing the typedef syntax for all typedefs, and updating analysis options.
* It's time to #deleteDart1 (#18293)
Eliminates support for Dart 1 in flutter_tools, and drops our Dart 1
benchmarks. All commands now run in Dart 1 mode only.
Eliminates --preview-dart-2 / --no-preview-dart-2 support.
* Fix indentation, remove no longer necessary .toList()
* Only push udpated kernel if >0 invalidated srcs
Eliminates support for Dart 1 in flutter_tools, and drops our Dart 1
benchmarks. All commands now run in Dart 1 mode only.
Eliminates --preview-dart-2 / --no-preview-dart-2 support.
Now that we have thousands of tests, it doesn't make sense to display a separate line for each test. The result is just megabytes of logs that you have to scrub through to find error messages.
Uses the `version` property from the `pubspec.yaml` file to set the corresponding fields in the `local.properties` file respectively in the `Generated.xcconfig` file.
The `--build-name` and `--build-number` options have changed. Now they trump the `version` property from the `pubspec.yaml` file.
If the `version` property is not set and the `--build-name` and `--build-number` options are not provided, the build command will not change the `local.properties` / `Generated.xcconfig` file.
* Send an event at startup with the protocol version and pid
The pid will help with some of the issues of terminate the process when launched through a shell script and the version will allow clients to make decisions about supported features.
I've also bumped the protocol version number for two reasons:
1. This change
2. We didn't increase it when we added the previous emulator commands
When running with --local-engine, build single-architecture apps, rather
than what's declared in the Xcode project.
By default, Flutter creates Xcode projects that generate universal
binaries supporting both armv7 and arm64 processors. Since local engine builds
are all single-architecture, override the Xcode project's ARCHS setting
with the appropriate value for the specific engine.
NOTE: this assumes engine paths consistent with those used in the engine
repo: 32-bit iOS engine builds end in _arm, 64-bit builds do not.
Previously, Flutter did not support iOS devices with armv7 or armv7s
CPUs. We now support these devices. This eliminates the previous
hardcoded checks that prevented running on simulators of older devices.
We maintain the existing restriction on running on watchOS or tvOS
simulators.
Previously, in non-release (i.e. profile) AOT builds, we were setting
--no-checked and --conditional_directives flags. --no-checked is the
default, and we don't make use of conditional directives in Flutter.
Allows users of Fingerprinter to filter the set of paths collected from
the explicitly-specified paths and those collected from depfiles.
In some cases, depfiles are emitted with files that are not present on
the local disk (e.g. the frontend compiler currently emits buildbot
paths for the dart core libraries and dart:ui). These files will not
materially affect whether we need to re-run a build action for which
they are inputs, since they're not present in the filesystem and
therefore cannot change.
This replaces the --prefer-shared-library flag, which falls back to
regular (non-shared-lib) compile if the NDK is not found, with the
--build-shared-library flag, which exits with an error message if the
NDK is not found.
This simplifies the set of allowed code paths through AOT compile,
resulting in better testability and easier-to-follow logic. It also
results in more predictable behaviour for continuous integration and
other scenarios.
This change adds support for armv7, arm64, and universal iOS apps.
This change eliminates iOS target architecture hardcoding (previously
arm64 only) and uses the target architecture(s) specified in Xcode's
ARCHS setting ('Architectures' in Xcode Build Settings).
For universal binaries, set ARCHS to its default value, $(ARCHS_STANDARD).
Note that after changing the architecture in Xcode, developers should
run 'pod install' from the ios subdirectory of their project. A separate
change (that will land before this one) will add support for
automatically detecting project file and Podfile changes and re-running
pod install if necessary.
This change also adds an --ios-arch option to flutter build aot. In iOS
AOT builds (in profile and release mode), this dictates which
architectures are built into App.framework. This flag should generally
be unnecessary to set manually since flutter build aot is typically only
invoked internally by flutter itself.
If the developer changes their Xcode build settings and their project
has plugins, pod install is required, (e.g. to pick up changes to the
target architecture).
Similarly, manual edits to the Podfile should trigger a pod install.
Adds a Fingerprinter utility class that can be used to compute unique
fingerprints for a set of input paths and build options, compare to the
output of a previous run, and skip the build action if no inputs or
options have changed. The existing Fingerprint class still does all the
heavy lifting. Fingerprinter adds common operations such as
reading/writing/comparing fingerprints and parsing depfiles.
This migrates existing uses of Fingerprint over to Fingerprinter.
This also adds better fingerprinting to AOT snapshotting, which
previously failed to include several options in its fingerprint
(--preview-dart-2, --prefer-shared-library).
Previously, we were incorrectly passing --vm_snapshot_data and
--isolate_snapshot_data options to gen_snapshot in assembly AOT builds.
These only make sense in AOT blob snapshot mode (alongside
--vm_snapshot_instructions and --isolate_snapshot_instructions).
There's very little code-sharing between the two, and what little there
is is concentrated in the GenSnapshotClass and the fingerprint
reading/writing utility methods.
iOS debug builds always run in interpreted mode whether on device or on
simulator. In both cases, we can skip snapshotting and link against an
empty App.framework. Previously, we did this for iOS simulator builds.
This does the same for device builds.
Previously, debug iOS builds used gen_snapshot to generate a core
snapshot, then used 'xxd' to generate C files containing the snapshot
data in buffers named kDartVmSnapshotData and kDartIsolateSnapshotData,
which are then compiled/linked into App.framework. This is unnecessary
since the VM compiled into Flutter.framework already contains this data.
Bugfix: Moves AOT snapshot input verification past where the last input
is added to the inputs list.
Cleanup:
* Extracts _isValidAotPlatform method.
* Moves non-platform-specific logic to the top.
* Moves variable declaration closer to first use, and inlines to a
narrower scope where possible.
This relands #17136, which was reverted in #17142 due to breakage in
on-device iOS debug builds.
Bugfix: Moves AOT snapshot input verification past where the last input
is added to the inputs list.
Cleanup:
* Extracts _isValidAotPlatform method.
* Moves non-platform-specific logic to the top.
* Moves variable declaration closer to first use, and inlines to a
narrower scope where possible.
Moves the kernel compile step to the beginning of the AOT build in a
separate method. This is pre-factoring for iOS universal builds where
the kernel build happens once, but we then snapshot twice: once for
armv7 and once for arm64.
This also writes dependencies to build/kernel_compile.d rather than
build/aot/snapshot.d, since that is immediately overwritten by
gen_snapshot.
This is required for iOS debug builds, but unused otherwise. In theory,
Android debug builds could be run in this mode, but this is historically
untested and adds unnecessary complexity to the code. If ad-hoc testing
is required, it can be patched in when necessary.
This re-lands 8c4f0c0d21 with a fix to
xcode_backend.sh to eliminate the use of --interpreter.
This is required for iOS debug builds, but unused otherwise. In theory,
Android debug builds could be run in this mode, but this is historically
untested and adds unnecessary complexity to the code. If ad-hoc testing
is required, it can be patched in when necessary.
This simplifies tests by allowing the test author to express the outputs
they'd like the snapshotter to generate without creating a whole new
instance and context with the additional overrides.
Also sets the default set of outputs to none, setting them instead in
the setUp function for script snapshotting.
Wraps the compile function in a class injected via the global context,
which makes it easier to mock in unit tests -- specifically tests for
AOT snapshotting, which already require pretty significant amounts of
mock inputs.
This moves --vm_snapshot_data and --isolate_snapshot_data argument
hardcoding from GenSnapshot (a minimal wrapper around gen_snapshot
invocations) to Snapshotter.buildScriptSnapshot(). These arguments are
present in both AOT and script snapshots, but differ semantically: for
script snapshots they're inputs from the host engine artifacts
directory, for AOT snapshots they're outputs to the build directory.
* Handle error count reported by frontend.
Extend compilation result from single string to a structure(string filename and integer error count).
* Use ?.
* Include engine roll with dart sdk roll.
* parse(onError) -> tryParse
* Make '?? throw' more readable and avoid issue with analyzer
* Fix test so it mocks compiler output including errors count
* Revert "Revert "Move mockito to 3.0.0-alpha. (#15949)" (#15979)"
This reverts commit e59651f925.
* More thenReturn to thenAnswer when mocking Futures
* Revert "More thenReturn to thenAnswer when mocking Futures"
This reverts commit 194d2cf417 as we are reverting engine roll.
* Revert "Revert "More thenReturn to thenAnswer when mocking Futures""
This reverts commit 52c9e96b30.
* Add dependency override
* Fix issue
* Move mockito to 3.0.0-alpha.
This is needed so it matches mockito version used internally.
* Pick up +2 for the fixes
* Fix whenReturn in fuchsia_remote_debug_protocol
* more thenReturn becomes thenAnswer
* more thenReturn becomes thenAnswer
* more thenReturn becomes thenAnswer
* traverse dependencies and dev dependencies separately
* separate dev and reg deps
* update pubspecs
* add checksum string and update transitive dep string. Add additional verify command to check checksum
* cleanup comments
* add missing space, quote, run verify-onlu from bot script
* rerun tool with fixed string
* ensure correct working directory and bump versions
* flutter not flutterRoot
Some file I/O is piped from OS processes and never completes,
so without havign a timeout on the recording serialzation, we
end up waiting forever on that I/O to complete.