Skip to content
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

test(fdc): add e2e and unit tests to fdc #13224

Merged
merged 137 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from 134 commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
84d7598
First pass at dataconnect
maneesht May 23, 2024
a960d33
Got mutations to work
maneesht May 28, 2024
257c90c
Finished WIP
maneesht Jun 25, 2024
2b0c7ab
Used generated SDK
maneesht Jul 11, 2024
b5c3611
Merge branch 'master' into mtewani/fdc
maneesht Jul 11, 2024
8e8e737
Removed unrelated chagnes
maneesht Jul 11, 2024
806989b
Cleanup
maneesht Jul 11, 2024
8978090
Updated deps
maneesht Jul 11, 2024
fa7829e
Addressed comments
maneesht Jul 16, 2024
d7bb86c
Removed prints
maneesht Jul 16, 2024
8983df1
Removed unnecessary protos
maneesht Jul 23, 2024
1297684
Removed user class
maneesht Jul 23, 2024
2774a0d
Removed unnecessary class
maneesht Jul 23, 2024
3058024
Removed unnecessary deps
maneesht Jul 29, 2024
f5b35ea
Added back config files
maneesht Jul 29, 2024
8df3922
Fixed formatting
maneesht Jul 29, 2024
c7868f6
added index.html
maneesht Jul 29, 2024
9149814
Added license files
maneesht Jul 29, 2024
34d53aa
Fixed formatting
maneesht Jul 29, 2024
8bc79ad
Fixed linting issues
maneesht Jul 30, 2024
fb97874
Fixed formatting
maneesht Jul 30, 2024
7b421c9
Added protobuf as dependency
maneesht Jul 30, 2024
37ab782
Added license
maneesht Jul 31, 2024
d5521e8
Ignored example dir for secret checking
maneesht Jul 31, 2024
bb54564
Added changelog and readme
maneesht Jul 31, 2024
16855c8
Updated package version
maneesht Jul 31, 2024
bf9f8b9
Implemented app check
maneesht Aug 7, 2024
6a643f1
Removed key
maneesht Aug 7, 2024
723b069
Revert "Removed key"
maneesht Aug 7, 2024
6a69cab
Removed key again
maneesht Aug 7, 2024
afe32c2
Added error catching implementation (#13163)
maneesht Aug 7, 2024
fde352f
feat(dataconnect): Added error handling (#13175)
maneesht Aug 12, 2024
6d756f4
Miscellaneous cleanup
maneesht Aug 12, 2024
2e3d56e
Removed macros experiment
maneesht Aug 12, 2024
b053313
Removed .then statements
maneesht Aug 12, 2024
ec3a45d
Removed debug prints
maneesht Aug 12, 2024
2fec20e
Addressed first pass of comments
maneesht Aug 13, 2024
e3d19f0
Added movie_insert gql file
maneesht Aug 13, 2024
d5dc189
Added comments
maneesht Aug 13, 2024
b33ab6c
Renamed package
maneesht Aug 13, 2024
b0ceb73
Another package rename
maneesht Aug 13, 2024
422bd80
Removed common package
maneesht Aug 14, 2024
7d0826a
Added missing files
maneesht Aug 14, 2024
466fa23
Updated readme
maneesht Aug 14, 2024
359088a
Revert "Removed common package"
maneesht Aug 14, 2024
281c399
Various improvements
maneesht Aug 22, 2024
05ab14e
Merge branch 'mtewani/implement-app-check' into mtewani/fdc
maneesht Aug 22, 2024
31694c0
Made changes per api proposal
maneesht Aug 23, 2024
61562f3
Fixed initialization issues with generated SDK
maneesht Aug 23, 2024
945a9cf
Made changes according to api council review
maneesht Aug 28, 2024
6847801
Addressed Comments.
maneesht Sep 3, 2024
d7e933f
Merge remote-tracking branch 'origin/main' into mtewani/fdc
maneesht Sep 3, 2024
a6a5585
Added missing license header to files
maneesht Sep 3, 2024
f9ac9a4
/s/query/operation
maneesht Sep 3, 2024
46b7f73
API Council Changes
maneesht Sep 3, 2024
47f98bc
Included list movies changes
maneesht Sep 3, 2024
b3817a9
API council updates
maneesht Sep 5, 2024
bdd9535
Addressed comments
maneesht Sep 5, 2024
636f740
Removed print
maneesht Sep 5, 2024
89232c6
Added license header
maneesht Sep 5, 2024
74e40a9
Removed files that should be gitignored
maneesht Sep 5, 2024
abb4354
Removed requirement on firebase_options
maneesht Sep 6, 2024
d22ea34
Added missing line
maneesht Sep 6, 2024
6dde572
Removed windows and linux folders, updated changelog and gitignore
maneesht Sep 6, 2024
ce3caeb
Updated version of firebase_data_connect
maneesht Sep 7, 2024
b15d55e
test(fdc): add e2e tests to the FDC package
Lyokone Aug 26, 2024
55a2851
add e2e tests to CI
Lyokone Aug 27, 2024
496c512
test generated content
Lyokone Aug 27, 2024
4e1fd13
update
Lyokone Aug 27, 2024
b2e11ce
test
Lyokone Aug 27, 2024
275f6fb
add postgres
Lyokone Aug 27, 2024
3fc4a86
more generation tests
Lyokone Sep 2, 2024
71d90fa
update podfile
Lyokone Sep 9, 2024
ee189d7
fix analyze
Lyokone Sep 9, 2024
9f5edd5
regenerate with latest version
Lyokone Sep 9, 2024
37b1b6d
add more queries
Lyokone Sep 9, 2024
77e11a9
add more queries?
Lyokone Sep 9, 2024
dce8c58
removing not generated commands
Lyokone Sep 9, 2024
6608fb5
more unit tests
Lyokone Sep 9, 2024
242d15a
timestamp
Lyokone Sep 9, 2024
c853881
licence
Lyokone Sep 9, 2024
8e496f6
analyze
Lyokone Sep 9, 2024
b7395c8
add dev dep
Lyokone Sep 10, 2024
65a1d88
update generated
Lyokone Sep 10, 2024
cd378bf
ignore generated for licence
Lyokone Sep 10, 2024
171ea49
add .firebaserc for dataconnect setup
Lyokone Sep 10, 2024
5661bd3
fix ci
Lyokone Sep 10, 2024
aa4b089
fix setup
Lyokone Sep 10, 2024
f7a1d26
test
Lyokone Sep 10, 2024
5183afb
more testing
Lyokone Sep 10, 2024
68074a1
improve
Lyokone Sep 10, 2024
3381b60
unset PGSERVICE
Lyokone Sep 10, 2024
f67b14e
mote testing
Lyokone Sep 10, 2024
2e10838
okay?
Lyokone Sep 10, 2024
f63ad1b
maybe this?
Lyokone Sep 10, 2024
bc8387d
update pubignore
Lyokone Sep 10, 2024
898ace5
update
Lyokone Sep 10, 2024
29f2e8b
??
Lyokone Sep 10, 2024
cd95385
hop
Lyokone Sep 10, 2024
f6ddc61
more
Lyokone Sep 10, 2024
b95f6cf
hophophop
Lyokone Sep 10, 2024
df2cbc7
more
Lyokone Sep 10, 2024
e0b6aff
web
Lyokone Sep 10, 2024
ac8d712
tests
Lyokone Sep 10, 2024
28ee06a
test
Lyokone Sep 10, 2024
e6a624c
merge clean
Lyokone Sep 11, 2024
d6dd4c4
merge clean
Lyokone Sep 11, 2024
6f688c8
regenerate
Lyokone Sep 11, 2024
99d24f0
fix
Lyokone Sep 11, 2024
c188539
fix
Lyokone Sep 11, 2024
1212800
Merge branch 'main' into tests/fdc
Lyokone Sep 11, 2024
4326a8b
more tests
Lyokone Sep 11, 2024
4e2a5be
remove GoogleInfo Plist
Lyokone Sep 11, 2024
bc4f6e8
fix options
Lyokone Sep 11, 2024
b12b02e
Merge branch 'dataconnect' into tests/fdc
Lyokone Sep 11, 2024
2e02f0e
test
Lyokone Sep 11, 2024
d23cc79
fix emulator
Lyokone Sep 11, 2024
0965dac
clear text
Lyokone Sep 11, 2024
9716032
wut?
Lyokone Sep 11, 2024
b39ac28
fix generated code
Lyokone Sep 11, 2024
d98d1db
public level
Lyokone Sep 11, 2024
8697221
fix
Lyokone Sep 11, 2024
40f5059
fix generated
Lyokone Sep 11, 2024
4514df9
test
Lyokone Sep 11, 2024
094596e
maybe
Lyokone Sep 11, 2024
a997c8b
alors peut etre
Lyokone Sep 11, 2024
931c706
tests done
Lyokone Sep 11, 2024
fbde378
update caching
Lyokone Sep 11, 2024
8ab5265
e2e tests
Lyokone Sep 11, 2024
6678cf2
tests done
Lyokone Sep 11, 2024
7d42395
fix
Lyokone Sep 11, 2024
4bae0ad
fix concurrency
Lyokone Sep 11, 2024
e1e9c8e
fixes
Lyokone Sep 12, 2024
c04e585
fix
Lyokone Sep 12, 2024
318e930
again
Lyokone Sep 12, 2024
723e870
tests update
Lyokone Sep 12, 2024
e826865
test
Lyokone Sep 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
230 changes: 230 additions & 0 deletions .github/workflows/e2e_tests_fdc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,230 @@
name: e2e-fdc

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/**'
- '**.md'

jobs:
android:
runs-on: ubuntu-latest
timeout-minutes: 45
strategy:
fail-fast: false
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-fdc-${{ runner.os }}
russellwheatley marked this conversation as resolved.
Show resolved Hide resolved
restore-keys: firebase-emulators-v3
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
with:
channel: 'stable'
cache: true
- name: Setup PostgreSQL for Linux/macOS/Windows
uses: ikalnytskyi/action-setup-postgres@v6
- uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388
with:
run-bootstrap: false
melos-version: '5.3.0'
- name: 'Bootstrap package'
run: melos bootstrap --scope "firebase_data_connect*"
- name: 'Install Tools'
run: |
sudo npm i -g firebase-tools
- name: Start Firebase Emulator
run: |
cd ./packages/firebase_data_connect/firebase_data_connect/example
unset PGSERVICEFILE
firebase experiments:enable dataconnect
./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-${{ runner.os }}
- 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: 'packages/firebase_data_connect/firebase_data_connect/example'
script: |
flutter test integration_test/e2e_test.dart --dart-define=CI=true -d emulator-5554

ios:
runs-on: macos-14
timeout-minutes: 45
strategy:
fail-fast: false
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: Setup PostgreSQL for Linux/macOS/Windows
uses: ikalnytskyi/action-setup-postgres@v6
- uses: hendrikmuhs/ccache-action@c92f40bee50034e84c763e33b317c77adaa81c92
name: Xcode Compile Cache
with:
key: xcode-cache-${{ runner.os }}
max-size: 700M
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
name: Pods Cache
id: pods-cache
with:
path: tests/ios/Pods
key: ${{ runner.os }}-fdc-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-fdc-${{ runner.os }}
restore-keys: firebase-emulators-v3
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
with:
channel: 'stable'
cache: true
- uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388
with:
run-bootstrap: false
melos-version: '5.3.0'
- name: 'Bootstrap package'
run: melos bootstrap --scope "firebase_data_connect*"
- name: 'Install Tools'
run: |
sudo npm i -g firebase-tools
- name: 'Build Application'
working-directory: 'packages/firebase_data_connect/firebase_data_connect/example'
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 ./packages/firebase_data_connect/firebase_data_connect/example
unset PGSERVICEFILE
firebase experiments:enable dataconnect
./start-firebase-emulator.sh
- name: 'E2E Tests'
working-directory: 'packages/firebase_data_connect/firebase_data_connect/example'
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

web:
runs-on: macos-latest
timeout-minutes: 15
strategy:
fail-fast: false
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: Setup PostgreSQL for Linux/macOS/Windows
uses: ikalnytskyi/action-setup-postgres@v6
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
with:
channel: 'stable'
cache: true
- uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388
with:
run-bootstrap: false
melos-version: '5.3.0'
- name: 'Bootstrap package'
run: melos bootstrap --scope "firebase_data_connect*"
- 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-fdc-${{ runner.os }}
restore-keys: firebase-emulators-v3
- name: Start Firebase Emulator
run: |
sudo chown -R 501:20 "/Users/runner/.npm"
cd ./packages/firebase_data_connect/firebase_data_connect/example
unset PGSERVICEFILE
firebase experiments:enable dataconnect
./start-firebase-emulator.sh
- name: 'E2E Tests'
working-directory: 'packages/firebase_data_connect/firebase_data_connect/example'
# 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

10 changes: 5 additions & 5 deletions .github/workflows/scripts/firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
},
"emulators": {
"firestore": {
"port": "8080"
"port": 8080
},
"auth": {
"port": "9099"
"port": 9099
},
"storage": {
"port": "9199"
"port": 9199
},
"database": {
"port": "9000"
"port": 9000
},
"ui": {
"enabled": true,
Expand All @@ -31,4 +31,4 @@
"storage": {
"rules": "storage.rules"
}
}
}
2 changes: 2 additions & 0 deletions melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ scripts:
--ignore "**/FlutterMultiDexApplication.java" \
--ignore "**/GeneratedPluginRegistrant.swift" \
--ignore "**/Pods/**" \
--ignore "**/generated/**" \
--ignore "**/flutter/generated_plugin_registrant.h" \
--ignore "**/flutter/generated_plugin_registrant.cc" \
.
Expand Down Expand Up @@ -317,6 +318,7 @@ scripts:
--ignore "**/FlutterMultiDexApplication.java" \
--ignore "**/GeneratedPluginRegistrant.swift" \
--ignore "**/Pods/**" \
--ignore "**/generated/**" \
--ignore "**/flutter/generated_plugin_registrant.h" \
--ignore "**/flutter/generated_plugin_registrant.cc" \
.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"projects": {
"default": "flutterfire-e2e-tests"
},
"targets": {},
"etags": {},
"dataconnectEmulatorConfig": {
"postgres": {
"localConnectionString": "postgresql://postgres:postgres@localhost:5432/postgres?sslmode=disable"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ app.*.map.json
/android/app/release
/android/app/google-services.json
/ios/firebase_app_id_file.json
/lib/firebase_options.dart
/macos/firebase_app_id_file.json

ios/Runner/GoogleService-Info.plist
.firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.firebaserc
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
plugins {
id "com.android.application"
// START: FlutterFire Configuration
id 'com.google.gms.google-services'
// END: FlutterFire Configuration
id "kotlin-android"
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id "dev.flutter.flutter-gradle-plugin"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<application
android:label="example"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
android:icon="@mipmap/ic_launcher"
android:usesCleartextTraffic="true">
<activity
android:name=".MainActivity"
android:exported="true"
Expand All @@ -17,12 +18,12 @@
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
Expand All @@ -38,8 +39,8 @@
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
<queries>
<intent>
<action android:name="android.intent.action.PROCESS_TEXT"/>
<data android:mimeType="text/plain"/>
<action android:name="android.intent.action.PROCESS_TEXT" />
<data android:mimeType="text/plain" />
</intent>
</queries>
</manifest>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ pluginManagement {
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
// START: FlutterFire Configuration
id "com.google.gms.google-services" version "4.3.15" apply false
// END: FlutterFire Configuration
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ input DirectedBy_ListFilter {
input DirectedBy_Order {
movieId: OrderDirection
directedbyId: OrderDirection
directedby: Person_Order
movie: Movie_Order
}
input Movie_Data {
id: UUID
Expand Down
Loading
Loading