☂️ Improved Test Ergonomics #843
Labels
enhancement
New feature or request
flutter-developer-ease-of-use
Features that should make Hydro-SDK easier to use for Flutter developers
scoping
Issue is in a draft state
web-developer-ease-of-use
Features that should make Hydro-SDK easier to use for web developers
Hydro-SDK's current testing workflow forces running widget tests for entire Hydro-SDK components at a time. There is no built in method to allow unit tests. There is no built in method to allow widget tests that are not conducted on an entire Hydro-SDK component.
Hydro-SDK needs a built in testing workflow that is analogous to the workflow enjoyed by users of
flutter test
/jest
.In general, for every file matching a given pattern;
dart:ui
(likeflutter_tester
)Code in Hydro-SDK is organized around projects and components. Each test file should be built as a unique synthetic component of the current project. This will allow existing build tooling to continue to safely assume that every component build is fully independent.
In Flutter, the
flutter_tester
executable is invoked with the path to akernel
file compiled from the file to be tested. For Hydro-SDK,flutter_tester
should be able to be copied and distributed (as opposed to building it from source). Hydro-SDK can distribute a test harnesskernel
file that will load and run a specified.ota
package from the filesystem. The test harness should provide a CFR withdart:*
,package:flutter
,package:flutter_test
andpackage:spec
APIs available.In general, there are two unique scenarios where a new test workflow will be consumed;
For downstream use, requiring the user to have a Dart and Flutter installation to use Hydro-SDK should be eliminated as a requirement. A new test workflow should come out of the box with everything needed to run unit, widget, and golden tests.
For hacking on Hydro-SDK, a creaky system of compiling and directly running bytecode chunks with a series of shell scripts and
flutter test
invocations has been employed until now. The same Dart code distributed as pre-compiledkernel
in the downstream use case should be able to be used upstream to test Hydro-SDK directly. This should allow for better debuggability of upstream tests. This same Dart code should also be made available as a library to downstream users who may wish to customize their test experience (like with custom namespaces or other configuration).Out of scope
kDebugMode
,kReleaseMode
and Dart's built inassert
, some of the work under "Recovering framework asserts" from ☂️ Component Preview #763 might have to be consideredOpen questions
flutter_tester
flutter_tester
kernel
hydroc
to support distributing platformkernel
files in addition to platform executablesThe text was updated successfully, but these errors were encountered: