Add support for setup steps in flutter customer tests (#135726)

This PR adds support for adding `setup` steps that must be run before the `update` steps in Flutter customer tests.

```
setup=./generate_my_mocks.sh
update=.
test= ...
```

This PR also cleans up the `CustomerTest` class in the spirit of yak-shaving and making the code more robust.
This commit is contained in:
Kenzie Davisson
2023-10-03 14:31:54 -06:00
committed by GitHub
parent 6c4965e3d4
commit 54fa255432
3 changed files with 130 additions and 50 deletions

View File

@@ -16,6 +16,11 @@ void main() {
contact=abc@gmail.com
fetch=git clone https://github.com/flutter/cocoon.git tests
fetch=git -C tests checkout abc123
setup=flutter --version
setup.windows=flutter doctor
setup.posix=flutter -h
setup.linux=flutter analyze -h
setup.macos=flutter build -h
update=.
# Runs flutter analyze, flutter test, and builds web platform
test.posix=./test_utilities/bin/flutter_test_runner.sh app_flutter
@@ -30,7 +35,11 @@ test.windows=.\test_utilities\bin\flutter_test_runner.bat repo_dashboard
test.fetch,
containsAllInOrder(
<String>['git clone https://github.com/flutter/cocoon.git tests', 'git -C tests checkout abc123']));
expect(test.setup.first, 'flutter --version');
if (Platform.isLinux || Platform.isMacOS) {
expect(test.setup.length, 3);
expect(test.setup[1], 'flutter -h');
expect(test.setup[2], Platform.isLinux ? 'flutter analyze -h' : 'flutter build -h');
expect(
test.tests,
containsAllInOrder(<String>[
@@ -39,6 +48,8 @@ test.windows=.\test_utilities\bin\flutter_test_runner.bat repo_dashboard
]),
);
} else if (Platform.isWindows) {
expect(test.setup.length, 2);
expect(test.setup[1], 'flutter doctor');
expect(test.tests, containsAllInOrder(<String>['.\test_utilities\bin\flutter_test_runner.bat repo_dashboard']));
}
});