Skip to content

Commit fd8c75d

Browse files
committed
Attempt to have nested class for realtime pipeline
1 parent 545ac38 commit fd8c75d

File tree

11 files changed

+583
-476
lines changed

11 files changed

+583
-476
lines changed

.github/workflows/firestore_ci_tests.yml

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,85 @@ jobs:
250250
retention-days: 7
251251
if-no-files-found: ignore
252252

253+
firestore_emulator_integ_tests:
254+
name: "System Tests Against Emulator"
255+
runs-on: ubuntu-latest
256+
needs:
257+
- determine_changed
258+
# only run on post submit or PRs not originating from forks.
259+
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')
260+
strategy:
261+
fail-fast: false
262+
263+
steps:
264+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
265+
with:
266+
fetch-depth: 2
267+
submodules: true
268+
269+
- name: Enable KVM
270+
run: |
271+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
272+
sudo udevadm control --reload-rules
273+
sudo udevadm trigger --name-match=kvm
274+
275+
- name: Add google-services.json
276+
env:
277+
INTEG_TESTS_GOOGLE_SERVICES: ${{ secrets.INTEG_TESTS_GOOGLE_SERVICES }}
278+
run: |
279+
echo $INTEG_TESTS_GOOGLE_SERVICES | base64 -d > firebase-firestore/google-services.json
280+
281+
- name: Set up JDK 21
282+
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
283+
with:
284+
java-version: 21
285+
distribution: temurin
286+
cache: gradle
287+
288+
- uses: google-github-actions/setup-gcloud@77e7a554d41e2ee56fc945c52dfd3f33d12def9a # v2.1.4
289+
290+
- name: Start Emulator
291+
env:
292+
EXPERIMENTAL_MODE: true
293+
run: |
294+
gcloud emulators firestore start --host-port=127.0.0.1:8080 --quiet &
295+
296+
- name: Set up JDK 17
297+
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
298+
with:
299+
java-version: 17
300+
distribution: temurin
301+
cache: gradle
302+
303+
- name: Firestore Emulator Integ Tests
304+
uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d #v2.33.0
305+
env:
306+
FIREBASE_CI: 1
307+
FTL_RESULTS_BUCKET: android-ci
308+
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)}}
309+
FIREBASE_APP_CHECK_DEBUG_SECRET: ${{ secrets.FIREBASE_APP_CHECK_DEBUG_SECRET }}
310+
with:
311+
api-level: 31
312+
arch: x86_64
313+
ram-size: 4096M
314+
heap-size: 4096M
315+
script: |
316+
adb logcat -v time > logcat.txt &
317+
./gradlew firebase-firestore:connectedCheck withErrorProne -PtargetBackend="emulator"
318+
- name: Upload logs
319+
if: failure()
320+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
321+
with:
322+
name: emulator-logcat.txt
323+
path: logcat.txt
324+
retention-days: 7
325+
if-no-files-found: ignore
326+
253327
check-required-tests:
254328
runs-on: ubuntu-latest
255329
if: always()
256330
name: Check all required Firestore tests results
257-
needs: [integ_tests, named_integ_tests]
331+
needs: [firestore_emulator_integ_tests]
258332
steps:
259333
- name: Check test matrix
260334
if: needs.integ_tests.result == 'failure' || needs.named_integ_tests.result == 'failure'

firebase-firestore/api.txt

Lines changed: 124 additions & 105 deletions
Large diffs are not rendered by default.

firebase-firestore/ktx/src/test/java/com/google/firebase/firestore/TestUtil.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import com.google.firebase.database.collection.ImmutableSortedSet;
2323
import com.google.firebase.firestore.core.DocumentViewChange;
2424
import com.google.firebase.firestore.core.DocumentViewChange.Type;
25+
import com.google.firebase.firestore.core.QueryOrPipeline;
2526
import com.google.firebase.firestore.core.ViewSnapshot;
2627
import com.google.firebase.firestore.model.Document;
2728
import com.google.firebase.firestore.model.DocumentKey;
@@ -98,7 +99,8 @@ public static QuerySnapshot querySnapshot(
9899
}
99100
ViewSnapshot viewSnapshot =
100101
new ViewSnapshot(
101-
com.google.firebase.firestore.testutil.TestUtil.query(path),
102+
new QueryOrPipeline.QueryWrapper(
103+
com.google.firebase.firestore.testutil.TestUtil.query(path)),
102104
newDocuments,
103105
oldDocuments,
104106
documentChanges,

firebase-firestore/src/androidTest/java/com/google/firebase/firestore/PipelineTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1885,6 +1885,9 @@ public void testErrorHandling() {
18851885

18861886
@Test
18871887
public void testErrorExpression() {
1888+
assumeFalse(
1889+
"Certain options are not supported against the emulator yet.", isRunningAgainstEmulator());
1890+
18881891
Exception exception =
18891892
assertThrows(
18901893
Exception.class,

0 commit comments

Comments
 (0)