Commit graph

24 commits

Author SHA1 Message Date
Jonah Williams 2c1d12d4f7
Revert "Add a detach command to detach without terminating" (#21464) 2018-09-05 18:03:43 -07:00
Danny Tuppeny eb9c975eb0
Add a detach command to detach without terminating (#21376)
* Add a detach command to detach without terminating

Fixes #21154.

* Bump protocol version for app.detach

* Tweak to detach/quit text

* Change logPrefix to named param
2018-09-05 19:31:21 +01:00
xster cda2c223f5
Turn on unawaited_futures in flutter_tools (#21048) 2018-08-30 20:57:44 -07:00
Danny Tuppeny 8b0227b4a3
Don't time out if process terminates when told to stop (#21103)
* Don't time out if process terminates when told to stop but response was not processed

While trying to reproduce #20822 I found a condition where the app may quit before the `app.stop` response is received but this code (which is called in integration test teardown) would sit around waiting and time out. With this change, the process exit is considered a valid response to the stop request.

* Add process exit to log for better errors in failures

This log can be turned on for debugging but is also dumped when a test fails (in certain conditions). With this in the log, it'll be clear if the timeout is because we're waiting for an event but the process quit.
2018-08-28 18:26:46 +01:00
Danny Tuppeny 363543fc19
Don't try to stop the same app twice in flutter_attach test (#20905)
This test is sometimes flaky (#20822) because the two processes try to stop the same app. This fix changes to just gracefully terminate the attach process without explicitly trying to stop and then uses the original spawning process to stop the app.

I can't repro the flake locally to be certain, but I've verified only one stop command is sent now so it *should* be good.
2018-08-22 17:13:34 +01:00
Danny Tuppeny 65985db142
Double all timeouts on flutter_tools integration tests (#20872)
Due to CPU contention we've seen these go really slow on Cirrus (see https://github.com/flutter/flutter/issues/19542#issuecomment-414265152), and there's also a chance our flakes are timeouts due to running slow rather than hanging.
2018-08-22 17:13:23 +01:00
Danny Tuppeny e870b1a20f
Provide better error messages in integration tests when apps don't launch successfully (#20813)
* Don't keep parsing results once we've had the event we expected

* Report errors if an app.stop event is received while waiting for another event

* Don't throw if we see app.stop event when we've just sent an app.stop request

* Improve debug print to include --start-paused if being used

* Improve wrapping
2018-08-21 20:39:35 +01:00
Ian Hickson 3dec6a6930
Clean up usage of temporary directories (#20682)
All temporary directory start with `flutter_` and have their random component separated from the name by a period, as in `flutter_test_bundle.YFYQMY`.

I've tried to find some of the places where we didn't cleanly delete temporary directories, too. This greatly reduces, though it does not entirely eliminate, the directories we leave behind when running tests, especially `flutter_tools` tests.

While I was at it I standardized on `tempDir` as the variable name for temporary directories, since it was the most common, removing occurrences of `temp` and `tmp`, among others.

Also I factored out some common code that used to catch exceptions that happen on Windows, and made more places use that pattern.
2018-08-17 13:17:23 -07:00
Alexandre Ardhuin eda03e2586
re-re-enable lint unnecessary_const (#20103) 2018-08-02 12:02:32 +02:00
Danny Tuppeny 12eff1d5da
Change from .first to .single to ensure this (#19981) 2018-07-31 08:05:24 +01:00
Todd Volkert 00aac68e2d
Revert flutter/flutter#19592 (#19861)
It was causing problems rolling Flutter into Fuchsia
2018-07-27 08:44:39 -07:00
Danny Tuppeny b3c319e4f1
Add integration tests to ensure flutter run does not quit at startup (#19473)
* 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
2018-07-25 17:29:35 +01:00
Alexandre Ardhuin 27018359d2
re-enable lint unnecessary_const (#19592)
* re-enable lint unnecessary_const

* remove trailling whitespaces

* remove unnecessary const (after merge)
2018-07-23 08:31:48 +02:00
Greg Spencer 1cc036519c
Removes trailing whitespace from source files. (#19329) 2018-07-19 23:03:58 -07:00
Danny Tuppeny ed9afbbc72
Add --machine support for flutter attach (#19077)
* 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
2018-07-19 13:38:29 +01:00
Danny Tuppeny 442fc3cf06
Make cleanup of flutter processes in tests more reliable (#19307)
* 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
2018-07-19 11:37:40 +01:00
Ian Hickson f630f90d6d
Revert "enable lint unnecessary_const (#19342)" (#19423)
This reverts commit cc1cf13eec.
2018-07-16 13:30:27 -07:00
Alexandre Ardhuin cc1cf13eec
enable lint unnecessary_const (#19342) 2018-07-16 21:43:48 +02:00
Danny Tuppeny 1363bd1795
Ensure timeouts in flutter_tools integration tests include all messages received (#19253)
* 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).
2018-07-12 18:17:33 +01:00
Alexander Aprelev cc122f1672
Revert "Roll engine to fed2ea458ed49088d33eddabc546ba56d600c717 (includes dart roll) again (#19277)" (#19295)
This reverts commit 700cb767c9 as it
breaks Windows tests.
2018-07-11 19:52:28 -07:00
Alexander Aprelev 700cb767c9
Roll engine to fed2ea458ed49088d33eddabc546ba56d600c717 (includes dart roll) again (#19277)
* 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
2018-07-11 19:26:33 -07:00
Alexander Aprelev cf932490b7
Revert "Roll engine to fed2ea458ed49088d33eddabc546ba56d600c717 (includes dart roll) (#19044)" (#19276)
This reverts commit f4a038da63 as it breaks microbenchmark tests.
2018-07-11 12:48:55 -07:00
Alexander Aprelev f4a038da63
Roll engine to fed2ea458ed49088d33eddabc546ba56d600c717 (includes dart roll) (#19044)
* 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.
2018-07-11 12:13:28 -07:00
Danny Tuppeny b931640c1d
Improve flutter tools integration tests (#18865)
* 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
2018-07-10 06:51:12 +01:00
Renamed from packages/flutter_tools/test/integration/flutter_test_driver.dart (Browse further)