Skip to content

Commit

Permalink
feat: firebase-ios-sdk 7.2.0 / firebase-android-sdk 26.1.1 (invertase…
Browse files Browse the repository at this point in the history
…#4648)

* feat(app, android): android bill of materials 26.1.1 + android dependencies

* chore(test): regenerate Podfile.lock

result of `yarn tests:ios:pod:install`

* feat(app, ios): bump firebase-ios-sdk to 7.2.0

* fix(admob, ci): workaround admob test device detection issues

* test(firestore, ci): +data fixture separation / +more tests

More test fixture differentiation is necessary for the test-reuse case,
because even though the emulator data is wiped, the app has it's own
firebase persistence and we are not cleaning that up, so future runs
get more and more data unless either the test app is uninstalled/reinstalled
or you just use deterministically separate fixtures like this commit

* test(messaging): fix test reuse case w/auto-init reset

* test(e2e): update podfile, de-integrate pre-compiled firestore

pre-compiled firestore sometimes gives me leveldb symbol collisions on
linking in my local environment. It may be possible to integrate it in
most cases but in some cases it fails, so de-integrating it for now

* test(database, e2e): disable some flaky database tests

* test(admob, e2e): disable rewarded ad loads on ios

they were failing in local testing for some reason

* test(firestore, e2e): add timeout to query snapshot callback test

* test(auth, e2e): let sign-ins rest before testing callbacks

on slower android devices this is necessary to avoid false-negative
test results
  • Loading branch information
mikehardy authored Dec 10, 2020
1 parent 572f6e1 commit fb87622
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 25 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ buildscript {
}

dependencies {
classpath("com.android.tools.build:gradle:4.1.0")
classpath("com.android.tools.build:gradle:4.1.1")
}
}
}
Expand Down
49 changes: 26 additions & 23 deletions e2e/Query/where.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
const COLLECTION = 'firestore';
const { wipe } = require('../helpers');
describe('firestore().collection().where()', () => {
before(() => wipe());
beforeEach(async () => await wipe());
it('throws if fieldPath is invalid', () => {
try {
firebase
Expand Down Expand Up @@ -339,9 +339,8 @@ describe('firestore().collection().where()', () => {
});
});

// FIXME flaky with semi-persistent data until emulator is working
xit('returns with in filter', async () => {
const colRef = firebase.firestore().collection(`${COLLECTION}/filter/in`);
it('returns with in filter', async () => {
const colRef = firebase.firestore().collection(`${COLLECTION}/filter/in${Date.now() + ''}`);

await Promise.all([
colRef.add({ status: 'Ordered' }),
Expand All @@ -359,9 +358,10 @@ describe('firestore().collection().where()', () => {
});
});

// FIXME flaky with semi-persistent data until emulator is working
xit('returns with array-contains-any filter', async () => {
const colRef = firebase.firestore().collection(`${COLLECTION}/filter/array-contains-any`);
it('returns with array-contains-any filter', async () => {
const colRef = firebase
.firestore()
.collection(`${COLLECTION}/filter/array-contains-any${Date.now() + ''}`);

await Promise.all([
colRef.add({ category: ['Appliances', 'Housewares', 'Cooking'] }),
Expand All @@ -375,9 +375,10 @@ describe('firestore().collection().where()', () => {
snapshot.size.should.eql(3); // 2nd record should only be returned once
});

// FIXME flaky with semi-persistent data until emulator is working
xit('returns with a FieldPath', async () => {
const colRef = firebase.firestore().collection(`${COLLECTION}/filter/where-fieldpath`);
it('returns with a FieldPath', async () => {
const colRef = firebase
.firestore()
.collection(`${COLLECTION}/filter/where-fieldpath${Date.now() + ''}`);
const fieldPath = new firebase.firestore.FieldPath('map', 'foo.bar@gmail.com');

await colRef.add({
Expand Down Expand Up @@ -412,9 +413,8 @@ describe('firestore().collection().where()', () => {
}
});

// FIXME flaky with semi-persistent data until emulator is working
xit('should correctly query integer values with in operator', async () => {
const ref = firebase.firestore().collection(COLLECTION);
it('should correctly query integer values with in operator', async () => {
const ref = firebase.firestore().collection(`${COLLECTION}/filter/int-in${Date.now() + ''}`);

await ref.add({ status: 1 });

Expand All @@ -427,9 +427,10 @@ describe('firestore().collection().where()', () => {
items.length.should.equal(1);
});

// FIXME flaky with semi-persistent data until emulator is working
xit('should correctly query integer values with array-contains operator', async () => {
const ref = firebase.firestore().collection(COLLECTION);
it('should correctly query integer values with array-contains operator', async () => {
const ref = firebase
.firestore()
.collection(`${COLLECTION}/filter/int-array-contains${Date.now() + ''}`);

await ref.add({ status: [1, 2, 3] });

Expand All @@ -442,9 +443,8 @@ describe('firestore().collection().where()', () => {
items.length.should.equal(1);
});

// FIXME flaky with semi-persistent data until emulator is working
xit("should correctly retrieve data when using 'not-in' operator", async () => {
const ref = firebase.firestore().collection(COLLECTION);
it("should correctly retrieve data when using 'not-in' operator", async () => {
const ref = firebase.firestore().collection(`${COLLECTION}/filter/not-in${Date.now() + ''}`);

await Promise.all([ref.add({ notIn: 'here' }), ref.add({ notIn: 'now' })]);

Expand Down Expand Up @@ -519,9 +519,10 @@ describe('firestore().collection().where()', () => {
}
});

// FIXME flaky with semi-persistent data until emulator is working
xit("should correctly retrieve data when using '!=' operator", async () => {
const ref = firebase.firestore().collection(COLLECTION);
it("should correctly retrieve data when using '!=' operator", async () => {
const ref = firebase
.firestore()
.collection(`${COLLECTION}/filter/bang-equals${Date.now() + ''}`);

await Promise.all([ref.add({ notEqual: 'here' }), ref.add({ notEqual: 'now' })]);

Expand Down Expand Up @@ -578,7 +579,9 @@ describe('firestore().collection().where()', () => {
});

it('should handle where clause after sort by', async () => {
const ref = firebase.firestore().collection(`${COLLECTION}/filter/sort-by-where`);
const ref = firebase
.firestore()
.collection(`${COLLECTION}/filter/sort-by-where${Date.now() + ''}`);

await ref.add({ status: 1 });
await ref.add({ status: 2 });
Expand Down
1 change: 1 addition & 0 deletions e2e/QuerySnapshot.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ describe('firestore.QuerySnapshot', () => {
snapshot.forEach.should.be.Function();
class Foo {}
snapshot.forEach(callback, Foo);
await Utils.spyToBeCalledOnceAsync(callback, 20000);
callback.should.be.calledOnce();
callback.firstCall.thisValue.should.eql(Foo);
});
Expand Down
7 changes: 6 additions & 1 deletion e2e/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ const http = require('http');
exports.wipe = async function wipe(debug = false) {
const deleteOptions = {
method: 'DELETE',
headers: {
// Undocumented, but necessary - from Emulator UI network requests
Authorization: 'Bearer owner',
},
port: 8080,
host: getE2eEmulatorHost(),
path: '/emulator/v1/projects/' + getE2eTestProject() + '/databases/(default)/documents',
Expand All @@ -31,7 +35,7 @@ exports.wipe = async function wipe(debug = false) {
if (debug) {
console.time('wipe');
}
await new Promise((resolve, reject) => {
return await new Promise((resolve, reject) => {
const req = http.request(deleteOptions);

req.on('error', error => reject(error));
Expand All @@ -45,5 +49,6 @@ exports.wipe = async function wipe(debug = false) {
});
} catch (e) {
console.error('Unable to wipe firestore:', e);
throw e;
}
};

0 comments on commit fb87622

Please sign in to comment.