New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hot Reload for tests #25973

Open
passsy opened this Issue Jan 2, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@passsy
Copy link
Contributor

passsy commented Jan 2, 2019

Hot Reload is one of the biggest selling points of Flutter. It makes development fast. At least when writing user interfaces. Unit tests don't support Hot Reload. With Dart2, spawning a new Isolate for each test file, tests became rather slow (multiple seconds until seeing first results).

It would be great when Hot Reload would also work for tests, making not only UI development fast but also TDD fun.

Related dart-lang/sdk#32953

@zoechi

This comment has been minimized.

Copy link
Contributor

zoechi commented Jan 2, 2019

If it's actually isolate startup time, does flutter test -j1 ... not help?

@passsy

This comment has been minimized.

Copy link
Contributor

passsy commented Jan 2, 2019

Good idea but it doesn't help. Here's an example with 12 basic unit tests in 4 files

> time flutter test
00:02 +12: All tests passed!
flutter test  5.22s user 1.04s system 157% cpu 3.983 total

> time flutter test -j1
00:03 +12: All tests passed!
flutter test -j1  5.23s user 1.04s system 146% cpu 4.280 total

The execution time of all tests is 100ms (Shown in IntelliJ). But the whole startup procedure, required for each test run, add an overhead of 5s.
I wish there would be something like pub webdev serve but for tests, having a running Isolate daemon waiting for the next test execution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment