Skip to content

Commit 564f3e9

Browse files
committed
improve
1 parent ae3670f commit 564f3e9

2 files changed

Lines changed: 14 additions & 17 deletions

File tree

.github/workflows/web.yaml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,16 +147,21 @@ jobs:
147147
# Web devices are not supported for the `flutter test` command yet. As a
148148
# workaround we can use the `flutter drive` command. Tracking issue:
149149
# https://github.com/flutter/flutter/issues/66264
150+
# Chrome debug service can fail with AppConnectionException. Retry once.
150151
run: |
151152
chromedriver --port=4444 --trace-buffer-size=100000 &
152-
flutter drive --target=./integration_test/e2e_test.dart --driver=./test_driver/integration_test.dart -d chrome --dart-define=CI=true --dart-define=APP_CHECK_E2E=true | tee output.log
153-
# We have to check the output for failed tests matching the string "[E]"
154-
output=$(<output.log)
155-
if [[ "$output" =~ \[E\] ]]; then
156-
# You will see "All tests passed." in the logs even when tests failed.
157-
echo "All tests did not pass. Please check the logs for more information."
158-
exit 1
159-
fi
153+
run_tests() {
154+
flutter drive --target=./integration_test/e2e_test.dart --driver=./test_driver/integration_test.dart -d chrome --dart-define=CI=true --dart-define=APP_CHECK_E2E=true | tee output.log
155+
output=$(<output.log)
156+
if [[ "$output" =~ \[E\] ]]; then
157+
echo "All tests did not pass. Please check the logs for more information."
158+
return 1
159+
fi
160+
}
161+
run_tests || {
162+
echo "First attempt failed. Retrying..."
163+
run_tests
164+
}
160165
shell: bash
161166
- name: Save Firestore Emulator Cache
162167
# Branches can read main cache but main cannot read branch cache. Avoid LRU eviction with main-only cache.

.github/workflows/windows.yaml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,7 @@ jobs:
5656
- name: "Build Windows (Release)"
5757
run: cd tests && flutter build windows --release
5858
- name: Start Firebase Emulator and run tests
59-
shell: bash
60-
run: |
61-
cd ./.github/workflows/scripts && firebase emulators:exec --project flutterfire-e2e-tests "
62-
cd ../../../tests
63-
flutter test ./integration_test/e2e_test.dart -d windows --verbose || {
64-
echo 'First attempt failed. Retrying...'
65-
flutter test ./integration_test/e2e_test.dart -d windows --verbose
66-
}
67-
"
59+
run: cd ./.github/workflows/scripts && firebase emulators:exec --project flutterfire-e2e-tests "cd ../../../tests && flutter test .\integration_test\e2e_test.dart -d windows --verbose"
6860

6961
# We cannot run the tests but we can still try to build the app because of https://github.com/flutter/flutter/issues/79213
7062
windows-firestore:

0 commit comments

Comments
 (0)