Skip to content

Commit 9759f40

Browse files
committed
remove noises from last master merge
1 parent ad21169 commit 9759f40

File tree

31 files changed

+357
-50
lines changed

31 files changed

+357
-50
lines changed

.github/workflows/ci_tests.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,47 @@ jobs:
130130
run: |
131131
./gradlew ${{matrix.module}}:deviceCheck withErrorProne -PtargetBackend="prod"
132132
133+
firestore_custom_integ_tests:
134+
name: "Firestore Custom Instrumentation Tests Against Named DB"
135+
runs-on: ubuntu-22.04
136+
needs:
137+
- determine_changed
138+
# only run on post submit or PRs not originating from forks.
139+
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')
140+
strategy:
141+
fail-fast: false
142+
143+
steps:
144+
- uses: actions/[email protected]
145+
with:
146+
fetch-depth: 2
147+
submodules: true
148+
149+
- name: Set up JDK 11
150+
uses: actions/setup-java@v3
151+
with:
152+
java-version: 11
153+
distribution: temurin
154+
cache: gradle
155+
156+
- name: Add google-services.json
157+
env:
158+
INTEG_TESTS_GOOGLE_SERVICES: ${{ secrets.INTEG_TESTS_GOOGLE_SERVICES }}
159+
run: |
160+
echo $INTEG_TESTS_GOOGLE_SERVICES | base64 -d > google-services.json
161+
- uses: google-github-actions/auth@v0
162+
with:
163+
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT }}
164+
- uses: google-github-actions/setup-gcloud@v0
165+
- name: Firestore Named DB Integ Tests
166+
env:
167+
FIREBASE_CI: 1
168+
FTL_RESULTS_BUCKET: android-ci
169+
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)}}
170+
FIREBASE_APP_CHECK_DEBUG_SECRET: ${{ secrets.FIREBASE_APP_CHECK_DEBUG_SECRET }}
171+
run: |
172+
./gradlew firebase-firestore:deviceCheck withErrorProne -PtargetBackend="prod" -PtargetDatabaseId="test-db"
173+
133174
publish-test-results:
134175
name: "Publish Tests Results"
135176
needs:

firebase-appdistribution-api/CHANGELOG.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
# Unreleased
2+
3+
# 16.0.0-beta09
24
* [feature] Improved development mode to allow all API calls to be made without having to sign in.
35

6+
## Kotlin
7+
The Kotlin extensions library transitively includes the updated
8+
`firebase-appdistribution-api` library. The Kotlin extensions library has no
9+
additional updates.
10+
411
# 16.0.0-beta08
512
* [fixed] Fixed an issue where a crash happened whenever a feedback
613
notification was shown on devices running Android 4.4 and lower.
714

8-
915
## Kotlin
1016
The Kotlin extensions library transitively includes the updated
1117
`firebase-appdistribution-api` library. The Kotlin extensions library has no
@@ -15,7 +21,6 @@ additional updates.
1521
* [feature] Added support for testers to attach JPEG screenshots to their
1622
feedback.
1723

18-
1924
## Kotlin
2025
The Kotlin extensions library transitively includes the updated
2126
`firebase-appdistribution-api` library. The Kotlin extensions library has no

firebase-appdistribution-api/gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
version=16.0.0-beta09
16-
latestReleasedVersion=16.0.0-beta08
15+
version=16.0.0-beta10
16+
latestReleasedVersion=16.0.0-beta09

firebase-appdistribution/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Unreleased
2-
* [feature] Improved development mode to allow all API calls to be made without having to sign in.
32
* [fixed] Updated the third-party license file to include Dagger's license.
43

4+
# 16.0.0-beta09
5+
* [feature] Improved development mode to allow all API calls to be made without having to sign in.
6+
57
# 16.0.0-beta08
68
* [fixed] Fixed an issue where a crash happened whenever a feedback
79
notification was shown on devices running Android 4.4 and lower.

firebase-appdistribution/gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
version=16.0.0-beta09
16-
latestReleasedVersion=16.0.0-beta08
15+
version=16.0.0-beta10
16+
latestReleasedVersion=16.0.0-beta09

firebase-config/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Unreleased
2+
3+
# 21.4.1
24
* [changed] Internal improvements to support Remote Config real-time updates.
35

46

firebase-config/gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# limitations under the License.
1515
#
1616

17-
version=21.4.1
18-
latestReleasedVersion=21.4.0
17+
version=21.4.2
18+
latestReleasedVersion=21.4.1
1919
android.enableUnitTestBinaryResources=true
2020

firebase-crashlytics-ndk/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Unreleased
22

3+
# 18.4.0
4+
* [changed] Updated `firebase-crashlytics` dependency to v18.4.0
5+
*
36
# 18.3.7
47
* [changed] Updated `firebase-crashlytics` dependency to v18.3.7
58

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version=18.4.0
2-
latestReleasedVersion=18.3.7
1+
version=18.4.1
2+
latestReleasedVersion=18.4.0

firebase-crashlytics/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
# Unreleased
2+
3+
# 18.4.0
24
* [feature] Integrated with Firebase sessions library to enable upcoming features related to
35
session-based crash metrics.
46

7+
## Kotlin
8+
The Kotlin extensions library transitively includes the updated
9+
`firebase-crashlytics` library. The Kotlin extensions library has no additional
10+
updates.
11+
512
# 18.3.7
613
* [feature] Added collection of version control information generated by the
714
Android Gradle plugin (AGP).
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version=18.4.0
2-
latestReleasedVersion=18.3.7
1+
version=18.4.1
2+
latestReleasedVersion=18.4.0

firebase-firestore/CHANGELOG.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
# Unreleased
2+
* [fixed] Implement equals method on Filter class. [#5210](//github.com/firebase/firebase-android-sdk/issues/5210)
3+
4+
# 24.7.0
25
* [feature] Expose MultiDb support in API. [#4015](//github.com/firebase/firebase-android-sdk/issues/4015)
36
* [fixed] Fixed a thread interference issue that may lead to a ConcurrentModificationException.
4-
(GitHub [#5091](//github.com/firebase/firebase-android-sdk/issues/5091){: .external})
5-
* [feature] Added support for multiple inequality in compound queries.
7+
(GitHub [#5091](//github.com/firebase/firebase-android-sdk/issues/5091){: .external})
8+
9+
10+
## Kotlin
11+
The Kotlin extensions library transitively includes the updated
12+
`firebase-firestore` library. The Kotlin extensions library has no additional
13+
updates.
614

715
# 24.6.1
816
* [feature] Implemented an optimization in the local cache synchronization logic that reduces the number of billed document reads when documents were deleted on the server while the client was not actively listening to the query (e.g. while the client was offline). (GitHub [#4982](//github.com/firebase/firebase-android-sdk/pull/4982){: .external})

firebase-firestore/firebase-firestore.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ android {
7070
def targetBackend = findProperty("targetBackend") ?: "emulator"
7171
buildConfigField("String", "TARGET_BACKEND", "\"$targetBackend\"")
7272

73+
def targetDatabaseId = findProperty('targetDatabaseId') ?: "(default)"
74+
buildConfigField("String", "TARGET_DATABASE_ID", "\"$targetDatabaseId\"")
75+
7376
def localProps = new Properties()
7477

7578
try {
@@ -154,7 +157,7 @@ dependencies {
154157
testImplementation 'com.google.guava:guava-testlib:12.0-rc2'
155158

156159
androidTestImplementation 'junit:junit:4.13.2'
157-
androidTestImplementation("com.google.truth:truth:$googleTruthVersion"){
160+
androidTestImplementation("com.google.truth:truth:$googleTruthVersion") {
158161
exclude group: "org.codehaus.mojo", module: "animal-sniffer-annotations"
159162
}
160163
androidTestImplementation 'org.mockito:mockito-core:2.25.0'

firebase-firestore/gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version=24.7.0
2-
latestReleasedVersion=24.6.1
1+
version=24.7.1
2+
latestReleasedVersion=24.7.0

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
package com.google.firebase.firestore;
1616

17+
import static com.google.common.truth.Truth.assertThat;
1718
import static com.google.firebase.firestore.testutil.IntegrationTestUtil.querySnapshotToValues;
1819
import static com.google.firebase.firestore.testutil.IntegrationTestUtil.testFirestore;
1920
import static com.google.firebase.firestore.testutil.TestUtil.map;
@@ -198,7 +199,7 @@ public void testLoadedDocumentsShouldNotBeGarbageCollectedRightAway() throws Exc
198199
public void testLoadWithDocumentsFromOtherProjectFails() throws Exception {
199200
List<LoadBundleTaskProgress> progressEvents = new ArrayList<>();
200201

201-
byte[] bundle = createBundle("other-project");
202+
byte[] bundle = createBundle("other-project", db.getDatabaseId().getDatabaseId());
202203
LoadBundleTask bundleTask = db.loadBundle(bundle);
203204

204205
bundleTask.addOnProgressListener(progressEvents::add);
@@ -207,10 +208,9 @@ public void testLoadWithDocumentsFromOtherProjectFails() throws Exception {
207208
awaitCompletion(bundleTask);
208209
fail();
209210
} catch (RuntimeExecutionException e) {
210-
assertEquals(
211-
"Resource name is not valid for current instance: "
212-
+ "projects/other-project/databases/(default)/documents",
213-
e.getCause().getCause().getMessage());
211+
assertThat(e.getCause().getCause())
212+
.hasMessageThat()
213+
.contains("Resource name is not valid for current instance");
214214
}
215215

216216
assertEquals(2, progressEvents.size());
@@ -262,14 +262,16 @@ private int getUTF8ByteCount(String s) {
262262
* Returns a valid bundle by replacing project id in `BUNDLE_TEMPLATES` with the given db project
263263
* id (also recalculates length prefixes).
264264
*/
265-
private byte[] createBundle(String projectId) throws UnsupportedEncodingException {
265+
private byte[] createBundle(String projectId, String databaseId)
266+
throws UnsupportedEncodingException {
266267
StringBuilder bundle = new StringBuilder();
267268

268269
// Prepare non-metadata elements since we need the total length of these elements before
269270
// generating the metadata.
270271
for (int i = 1; i < BUNDLE_TEMPLATES.length; ++i) {
271272
// Extract elements from BUNDLE_TEMPLATE and replace the project ID.
272273
String element = BUNDLE_TEMPLATES[i].replaceAll("\\{projectId\\}", projectId);
274+
element = element.replaceAll("\\(default\\)", databaseId);
273275
bundle.append(getUTF8ByteCount(element));
274276
bundle.append(element);
275277
}
@@ -290,7 +292,7 @@ private byte[] createBundle(String projectId) throws UnsupportedEncodingExceptio
290292
* current test database.
291293
*/
292294
private byte[] createBundle() throws UnsupportedEncodingException {
293-
return createBundle(db.getDatabaseId().getProjectId());
295+
return createBundle(db.getDatabaseId().getProjectId(), db.getDatabaseId().getDatabaseId());
294296
}
295297

296298
private void verifySuccessProgress(LoadBundleTaskProgress progress) {

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
import androidx.test.ext.junit.runners.AndroidJUnit4;
3535
import com.google.android.gms.tasks.Task;
36+
import com.google.firebase.firestore.model.DatabaseId;
3637
import com.google.firebase.firestore.testutil.IntegrationTestUtil;
3738
import java.util.Collections;
3839
import org.junit.After;
@@ -276,6 +277,14 @@ public void testCountFailWithGoodMessageIfMissingIndex() {
276277

277278
Throwable cause = throwable.getCause();
278279
assertThat(cause).hasMessageThat().ignoringCase().contains("index");
279-
assertThat(cause).hasMessageThat().contains("https://console.firebase.google.com");
280+
if (collection
281+
.firestore
282+
.getDatabaseId()
283+
.getDatabaseId()
284+
.equals(DatabaseId.DEFAULT_DATABASE_ID)) {
285+
assertThat(cause).hasMessageThat().contains("https://console.firebase.google.com");
286+
} else {
287+
assertThat(cause).hasMessageThat().contains("Missing index configuration");
288+
}
280289
}
281290
}

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ public void firestoreGetInstanceWithNullAppFails() {
102102
}
103103

104104
@Test
105-
public void firestoreGetInstanceWithNullDbNamepFails() {
105+
public void firestoreGetInstanceWithNullDbNameFails() {
106+
FirebaseApp.initializeApp(ApplicationProvider.getApplicationContext());
106107
expectError(
107108
() -> FirebaseFirestore.getInstance((String) null),
108109
"Provided database name must not be null.");
@@ -250,9 +251,12 @@ public void writesMustNotContainReferencesToADifferentDatabase() {
250251
expectWriteError(
251252
data,
252253
String.format(
253-
"Invalid data. Document reference is for database %s/(default) but should be for "
254-
+ "database %s/(default) (found in field foo)",
255-
IntegrationTestUtil.BAD_PROJECT_ID, IntegrationTestUtil.provider().projectId()));
254+
"Invalid data. Document reference is for database %s/%s but should be for "
255+
+ "database %s/%s (found in field foo)",
256+
IntegrationTestUtil.BAD_PROJECT_ID,
257+
BuildConfig.TARGET_DATABASE_ID,
258+
IntegrationTestUtil.provider().projectId(),
259+
BuildConfig.TARGET_DATABASE_ID));
256260
}
257261

258262
@Test

firebase-firestore/src/androidTest/java/com/google/firebase/firestore/testutil/IntegrationTestUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ public static FirebaseFirestore testFirestore(
283283
FirebaseFirestoreSettings settings,
284284
String persistenceKey) {
285285
return testFirestore(
286-
DatabaseId.forDatabase(projectId, DatabaseId.DEFAULT_DATABASE_ID),
286+
DatabaseId.forDatabase(projectId, BuildConfig.TARGET_DATABASE_ID),
287287
logLevel,
288288
settings,
289289
persistenceKey);

0 commit comments

Comments
 (0)