Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
76 changes: 75 additions & 1 deletion .github/workflows/firestore_ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,85 @@ jobs:
retention-days: 7
if-no-files-found: ignore

firestore_emulator_integ_tests:
name: "System Tests Against Emulator"
runs-on: ubuntu-latest
needs:
- determine_changed
# only run on post submit or PRs not originating from forks.
if: ((github.repository == 'Firebase/firebase-android-sdk' && github.event_name == 'push') || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)) && contains(fromJSON(needs.determine_changed.outputs.modules), ':firebase-firestore')
strategy:
fail-fast: false

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 2
submodules: true

- 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: Add google-services.json
env:
INTEG_TESTS_GOOGLE_SERVICES: ${{ secrets.INTEG_TESTS_GOOGLE_SERVICES }}
run: |
echo $INTEG_TESTS_GOOGLE_SERVICES | base64 -d > firebase-firestore/google-services.json

- name: Set up JDK 21
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
with:
java-version: 21
distribution: temurin
cache: gradle

- uses: google-github-actions/setup-gcloud@77e7a554d41e2ee56fc945c52dfd3f33d12def9a # v2.1.4

- name: Start Emulator
env:
EXPERIMENTAL_MODE: true
run: |
gcloud emulators firestore start --host-port=127.0.0.1:8080 --quiet &

- name: Set up JDK 17
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
with:
java-version: 17
distribution: temurin
cache: gradle

- name: Firestore Emulator Integ Tests
uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d #v2.33.0
env:
FIREBASE_CI: 1
FTL_RESULTS_BUCKET: android-ci
FTL_RESULTS_DIR: ${{ github.event_name == 'pull_request' && format('pr-logs/pull/{0}/{1}/{2}/{3}_{4}/artifacts/', github.repository, github.event.pull_request.number, github.job, github.run_id, github.run_attempt) || format('logs/{0}/{1}_{2}/artifacts/', github.workflow, github.run_id, github.run_attempt)}}
FIREBASE_APP_CHECK_DEBUG_SECRET: ${{ secrets.FIREBASE_APP_CHECK_DEBUG_SECRET }}
with:
api-level: 31
arch: x86_64
ram-size: 4096M
heap-size: 4096M
script: |
adb logcat -v time > logcat.txt &
./gradlew firebase-firestore:connectedCheck withErrorProne -PtargetBackend="emulator"
- name: Upload logs
if: failure()
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
with:
name: emulator-logcat.txt
path: logcat.txt
retention-days: 7
if-no-files-found: ignore

check-required-tests:
runs-on: ubuntu-latest
if: always()
name: Check all required Firestore tests results
needs: [integ_tests, named_integ_tests]
needs: [firestore_emulator_integ_tests]
steps:
- name: Check test matrix
if: needs.integ_tests.result == 'failure' || needs.named_integ_tests.result == 'failure'
Expand Down
1,740 changes: 897 additions & 843 deletions firebase-firestore/api.txt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.google.firebase.database.collection.ImmutableSortedSet;
import com.google.firebase.firestore.core.DocumentViewChange;
import com.google.firebase.firestore.core.DocumentViewChange.Type;
import com.google.firebase.firestore.core.QueryOrPipeline;
import com.google.firebase.firestore.core.ViewSnapshot;
import com.google.firebase.firestore.model.Document;
import com.google.firebase.firestore.model.DocumentKey;
Expand Down Expand Up @@ -98,7 +99,8 @@ public static QuerySnapshot querySnapshot(
}
ViewSnapshot viewSnapshot =
new ViewSnapshot(
com.google.firebase.firestore.testutil.TestUtil.query(path),
new QueryOrPipeline.QueryWrapper(
com.google.firebase.firestore.testutil.TestUtil.query(path)),
newDocuments,
oldDocuments,
documentChanges,
Expand Down
Loading
Loading