Skip to content

chore: update analyse issues surfaced from latest Flutter SDK #4826

chore: update analyse issues surfaced from latest Flutter SDK

chore: update analyse issues surfaced from latest Flutter SDK #4826

Workflow file for this run

name: e2e
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
paths-ignore:
- 'docs/**'
- 'website/**'
- '**/example/**'
- '**/flutterfire_ui/**'
- '**.md'
push:
branches:
- master
paths-ignore:
- 'docs/**'
- 'website/**'
- '**/example/**'
- '**/flutterfire_ui/**'
- '**.md'
jobs:
android:
runs-on: ubuntu-latest
timeout-minutes: 45
strategy:
matrix:
working_directory:
['tests', 'packages/cloud_firestore/cloud_firestore/example']
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
name: Install Node.js 20
with:
node-version: '20'
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9
with:
distribution: 'temurin'
java-version: '17'
- name: Firebase Emulator Cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
path: ~/.cache/firebase/emulators
key: firebase-emulators-v3-${{ github.run_id }}
restore-keys: firebase-emulators-v3
- uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225
with:
channel: 'stable'
cache: true
- uses: bluefireteam/melos-action@5a8367ec4b9942d712528c398ff3f996e03bc230
with:
run-bootstrap: false
melos-version: '5.3.0'
- name: 'Bootstrap package'
run: melos bootstrap --scope tests && melos bootstrap --scope "cloud_firestore*"
- name: 'Install Tools'
run: |
sudo npm i -g firebase-tools
- name: Start Firebase Emulator
run: cd ./.github/workflows/scripts && ./start-firebase-emulator.sh
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
- name: AVD cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-ubuntu
- name: Start AVD then run E2E tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 34
target: google_apis
arch: x86_64
working-directory: ${{ matrix.working_directory }}
script: |
flutter test integration_test/e2e_test.dart --dart-define=CI=true -d emulator-5554
ios:
runs-on: macos-14
timeout-minutes: 45
strategy:
matrix:
working_directory:
['tests', 'packages/cloud_firestore/cloud_firestore/example']
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
name: Install Node.js 20
with:
node-version: '20'
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9
with:
distribution: 'temurin'
java-version: '17'
- uses: hendrikmuhs/ccache-action@faf867a11c028c0b483fb2ae72b6fc8f7d842714
name: Xcode Compile Cache
with:
key: ${{ runner.os }}-ios-v3
max-size: 700M
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
name: Pods Cache
id: pods-cache
with:
path: tests/ios/Pods
key: ${{ runner.os }}-pods-v3-${{ hashFiles('tests/ios/Podfile.lock') }}
restore-keys: ${{ runner.os }}-ios-pods-v2
- name: Firebase Emulator Cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
path: ~/.cache/firebase/emulators
key: firebase-emulators-v3-${{ github.run_id }}
restore-keys: firebase-emulators-v3
- uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225
with:
channel: 'stable'
cache: true
- uses: bluefireteam/melos-action@5a8367ec4b9942d712528c398ff3f996e03bc230
with:
run-bootstrap: false
melos-version: '5.3.0'
- name: 'Bootstrap package'
run: melos bootstrap --scope tests && melos bootstrap --scope "cloud_firestore*"
- name: 'Install Tools'
run: |
sudo npm i -g firebase-tools
- name: 'Build Application'
working-directory: ${{ matrix.working_directory }}
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
export CCACHE_SLOPPINESS=clang_index_store,file_stat_matches,include_file_ctime,include_file_mtime,ivfsoverlay,pch_defines,modules,system_headers,time_macros
export CCACHE_FILECLONE=true
export CCACHE_DEPEND=true
export CCACHE_INODECACHE=true
ccache -s
flutter build ios --no-codesign --simulator --debug --target=./integration_test/e2e_test.dart --dart-define=CI=true
ccache -s
- name: Start Firebase Emulator
run: sudo chown -R 501:20 "/Users/runner/.npm" && cd ./.github/workflows/scripts && ./start-firebase-emulator.sh
- name: 'E2E Tests'
working-directory: ${{ matrix.working_directory }}
run: |
# Boot simulator and wait for System app to be ready.
# List of available simulators: https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md#installed-simulators
SIMULATOR="iPhone 15"
xcrun simctl bootstatus "$SIMULATOR" -b
xcrun simctl logverbose "$SIMULATOR" enable
# Sleep to allow simulator to settle.
sleep 15
# Uncomment following line to have simulator logs printed out for debugging purposes.
# xcrun simctl spawn booted log stream --predicate 'eventMessage contains "flutter"' &
flutter test integration_test/e2e_test.dart -d "$SIMULATOR" --dart-define=CI=true
macos:
runs-on: macos-14
timeout-minutes: 45
strategy:
matrix:
working_directory:
['tests', 'packages/cloud_firestore/cloud_firestore/example']
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
name: Install Node.js 20
with:
node-version: '20'
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9
with:
distribution: 'temurin'
java-version: '17'
- uses: hendrikmuhs/ccache-action@faf867a11c028c0b483fb2ae72b6fc8f7d842714
name: Xcode Compile Cache
with:
key: ${{ runner.os }}-macos-v2
max-size: 700M
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
name: Pods Cache
id: pods-cache
with:
path: tests/macos/Pods
key: ${{ runner.os }}-pods-v2-${{ hashFiles('tests/macos/Podfile.lock') }}
restore-keys: ${{ runner.os }}-macos-pods-v1
- name: Cache Firebase Emulator
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
path: ~/.cache/firebase/emulators
key: firebase-emulators-v3-${{ github.run_id }}
restore-keys: firebase-emulators-v3
- uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225
with:
channel: 'stable'
cache: true
- uses: bluefireteam/melos-action@5a8367ec4b9942d712528c398ff3f996e03bc230
with:
run-bootstrap: false
melos-version: '5.3.0'
- name: 'Bootstrap package'
run: melos bootstrap --scope tests && melos bootstrap --scope "cloud_firestore*"
- name: 'Install Tools'
run: |
sudo npm i -g firebase-tools
- name: 'Build Application'
working-directory: ${{ matrix.working_directory }}
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
export CCACHE_SLOPPINESS=clang_index_store,file_stat_matches,include_file_ctime,include_file_mtime,ivfsoverlay,pch_defines,modules,system_headers,time_macros
export CCACHE_FILECLONE=true
export CCACHE_DEPEND=true
export CCACHE_INODECACHE=true
ccache -s
flutter build macos --debug --target=./integration_test/e2e_test.dart --device-id=macos --dart-define=CI=true
ccache -s
- name: Start Firebase Emulator
# Chown the npm cache directory to the runner user to avoid permission issues
run: sudo chown -R 501:20 "/Users/runner/.npm" && cd ./.github/workflows/scripts && ./start-firebase-emulator.sh
- name: 'E2E Tests'
working-directory: ${{ matrix.working_directory }}
run: |
flutter test \
integration_test/e2e_test.dart \
-d macos \
--dart-define=CI=true
web:
runs-on: macos-latest
timeout-minutes: 15
strategy:
# Temp measure for testing web tests. Please remove as soon as e2e tests are stable.
fail-fast: false
matrix:
working_directory:
['tests', 'packages/cloud_firestore/cloud_firestore/example']
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
name: Install Node.js 20
with:
node-version: '20'
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9
with:
distribution: 'temurin'
java-version: '17'
- uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225
with:
channel: 'stable'
cache: true
- uses: bluefireteam/melos-action@5a8367ec4b9942d712528c398ff3f996e03bc230
with:
run-bootstrap: false
melos-version: '5.3.0'
- name: 'Bootstrap package'
run: melos bootstrap --scope tests && melos bootstrap --scope "cloud_firestore*"
- name: 'Install Tools'
run: sudo npm i -g firebase-tools
- name: Cache Firebase Emulator
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
path: ~/.cache/firebase/emulators
key: firebase-emulators-v3-${{ github.run_id }}
restore-keys: firebase-emulators-v3
- name: Start Firebase Emulator
run: sudo chown -R 501:20 "/Users/runner/.npm" && cd ./.github/workflows/scripts && ./start-firebase-emulator.sh
- name: 'E2E Tests'
working-directory: ${{ matrix.working_directory }}
# Web devices are not supported for the `flutter test` command yet. As a
# workaround we can use the `flutter drive` command. Tracking issue:
# https://github.com/flutter/flutter/issues/66264
run: |
chromedriver --port=4444 --trace-buffer-size=100000 &
flutter drive --target=./integration_test/e2e_test.dart --driver=./test_driver/integration_test.dart -d chrome --dart-define=CI=true | tee output.log
# We have to check the output for failed tests matching the string "[E]"
output=$(<output.log)
if [[ "$output" =~ \[E\] ]]; then
# You will see "All tests passed." in the logs even when tests failed.
echo "All tests did not pass. Please check the logs for more information."
exit 1
fi
shell: bash
web-wasm:
runs-on: macos-latest
timeout-minutes: 15
strategy:
# Temp measure for testing web tests. Please remove as soon as e2e tests are stable.
fail-fast: false
matrix:
working_directory:
['tests', 'packages/cloud_firestore/cloud_firestore/example']
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
name: Install Node.js 20
with:
node-version: '20'
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9
with:
distribution: 'temurin'
java-version: '17'
- uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225
with:
# TODO: Remove this once WASM is on stable.
channel: 'master'
cache: true
- uses: bluefireteam/melos-action@5a8367ec4b9942d712528c398ff3f996e03bc230
with:
run-bootstrap: false
melos-version: '5.3.0'
- name: 'Bootstrap package'
run: melos bootstrap --scope tests && melos bootstrap --scope "cloud_firestore*"
- name: 'Install Tools'
run: sudo npm i -g firebase-tools
- name: Cache Firebase Emulator
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
path: ~/.cache/firebase/emulators
key: firebase-emulators-v3-${{ github.run_id }}
restore-keys: firebase-emulators-v3
- name: Start Firebase Emulator
run: sudo chown -R 501:20 "/Users/runner/.npm" && cd ./.github/workflows/scripts && ./start-firebase-emulator.sh
- name: 'E2E Tests'
working-directory: ${{ matrix.working_directory }}
# Web devices are not supported for the `flutter test` command yet. As a
# workaround we can use the `flutter drive` command. Tracking issue:
# https://github.com/flutter/flutter/issues/66264
run: |
chromedriver --port=4444 --trace-buffer-size=100000 &
mv ./web/wasm_index.html ./web/index.html
flutter drive --target=./integration_test/e2e_test.dart --driver=./test_driver/integration_test.dart -d chrome --wasm --dart-define=CI=true | tee output.log
# We have to check the output for failed tests matching the string "[E]"
output=$(<output.log)
if [[ "$output" =~ \[E\] ]]; then
# You will see "All tests passed." in the logs even when tests failed.
echo "All tests did not pass. Please check the logs for more information."
exit 1
fi
shell: bash
windows:
runs-on: windows-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9
with:
distribution: 'temurin'
java-version: '17'
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
name: Install Node.js 20
with:
node-version: "20"
- uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225
with:
channel: 'stable'
cache: true
- uses: bluefireteam/melos-action@5a8367ec4b9942d712528c398ff3f996e03bc230
with:
run-bootstrap: false
melos-version: '3.0.0'
- name: "Bootstrap package"
run: melos bootstrap --scope tests && melos bootstrap --scope "cloud_firestore*"
- name: "Install Tools"
run: |
npm install -g firebase-tools
- name: Start Firebase Emulator and run tests
run: cd ./.github/workflows/scripts && firebase emulators:exec --project flutterfire-e2e-tests "cd ../../../tests && flutter test .\integration_test\e2e_test.dart -d windows"