8000 Merge branch 'main' into swift · compnerd/firebase-cpp-sdk@745552e · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 745552e

Browse files
authored
Merge branch 'main' into swift
2 parents cf26dae + 9f5985a commit 745552e

File tree

57 files changed

+540
-327
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+540
-327
lines changed

.github/workflows/cpp-packaging.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -893,3 +893,34 @@ jobs:
893893
-s 10 \
894894
-A ${verbose_flag}
895895
fi
896+
897+
898+
attempt_retry:
899+
name: "attempt-retry"
900+
needs: [trigger_integration_tests]
901+
runs-on: ubuntu-20.04
902+
if: ${{ failure() && !cancelled() && github.event_name == 'schedule' }}
903+
steps:
904+
- name: Checkout repo
905+
uses: actions/checkout@v3
906+
- name: Setup python
907+
uses: actions/setup-python@v4
908+
with:
909+
python-version: 3.8
910+
- name: Install python deps
911+
run: pip install -r scripts/gha/python_requirements.txt
912+
# The default token can't run workflows, so get an alternate token.
913+
- name: Generate token for GitHub API
914+
uses: tibdex/github-app-token@v1
915+
id: generate-token
916+
with:
917+
app_id: ${{ secrets.WORKFLOW_TRIGGER_APP_ID }}
918+
private_key: ${{ secrets.WORKFLOW_TRIGGER_APP_PRIVATE_KEY }}
919+
- name: Retry failed tests
920+
run: |
921+
echo "::warning ::Attempting to retry failed jobs"
922+
python scripts/gha/trigger_workflow.py -t ${{ steps.generate-token.outputs.token }} \
923+
-w retry-test-failures.yml \
924+
-p run_id ${{ github.run_id }} \
925+
-s 10 \
926+
-A

.github/workflows/integration_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,7 @@ jobs:
10471047
- id: ftl_test
10481048
if: steps.device-info.outputs.device_type == 'ftl'
10491049
uses: FirebaseExtended/github-actions/firebase-test-lab@v1.4
1050-
timeout-minutes: 90
1050+
timeout-minutes: 120
10511051
with:
10521052
credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
10531053
testapp_dir: testapps

Android/firebase_dependencies.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def firebaseDependenciesMap = [
2020
'app_check' : ['com.google.firebase:firebase-appcheck',
2121
'com.google.firebase:firebase-appcheck-debug',
2222
'com.google.firebase:firebase-appcheck-playintegrity'],
23-
'play_services' : ['com.google.android.gms:play-services-base:18.2.0'],
23+
'play_services' : ['com.google.android.gms:play-services-base:18.3.0'],
2424
'analytics' : ['com.google.firebase:firebase-analytics'],
2525
'auth' : ['com.google.firebase:firebase-auth'],
2626
'database' : ['com.google.firebase:firebase-database'],
@@ -159,7 +159,7 @@ project.afterEvaluate {
159159

160160
// Add the bill-of-materials
161161
project.dependencies {
162-
implementation platform('com.google.firebase:firebase-bom:32.7.0')
162+
implementation platform('com.google.firebase:firebase-bom:32.7.1')
163163
}
164164
for (String lib : firebaseCpp.dependencies.libSet) {
165165
// Generate and include the proguard file

analytics/integration_test/Podfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ use_frameworks! :linkage => :static
55

66
target 'integration_test' do
77
platform :ios, '11.0'
8-
pod 'Firebase/Analytics', '10.19.0'
8+
pod 'Firebase/Analytics', '10.20.0'
99
end
1010

1111
target 'integration_test_tvos' do
1212
platform :tvos, '12.0'
13-
pod 'Firebase/Analytics', '10.19.0'
13+
pod 'Firebase/Analytics', '10.20.0'
1414
end
1515

1616
post_install do |installer|

analytics/integration_test/src/integration_test.cc

Lines changed: 95 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,30 @@ TEST_F(FirebaseAnalyticsTest, TestSetSessionTimeoutDuraction) {
100100
}
101101

102102
TEST_F(FirebaseAnalyticsTest, TestGetAnalyticsInstanceID) {
103+
// On Android, if SetConsent was tested, this test will fail, since the app
104+
// needs to be restarted after consent is denied or it won't generate a new
105+
// sessionID. To not break the tests, skip this test in that case.
106+
#if defined(__ANDROID__)
107+
// Log the Google Play services version for debugging in case this test fails.
108+
LogInfo("Google Play services version: %d", GetGooglePlayServicesVersion());
109+
if (did_test_setconsent_) {
110+
LogInfo(
111+
"Skipping %s after TestSetConsent, as the test may fail until the app "
112+
"is restarted.",
113+
::testing::UnitTest::GetInstance()->current_test_info()->name());
114+
GTEST_SKIP();
115+
return;
116+
}
117+
#endif
118+
119+
FLAKY_TEST_SECTION_BEGIN();
120+
103121
firebase::Future<std::string> future =
104122
firebase::analytics::GetAnalyticsInstanceId();
105123
WaitForCompletion(future, "GetAnalyticsInstanceId");
106124
EXPECT_FALSE(future.result()->empty());
125+
126+
FLAKY_TEST_SECTION_END();
107127
}
108128

109129
TEST_F(FirebaseAnalyticsTest, TestGetSessionID) {
@@ -120,11 +140,11 @@ TEST_F(FirebaseAnalyticsTest, TestGetSessionID) {
120140
#if defined(__ANDROID__)
121141
// Log the Google Play services version for debugging in case this test fails.
122142
LogInfo("Google Play services version: %d", GetGooglePlayServicesVersion());
123-
124143
if (did_test_setconsent_) {
125144
LogInfo(
126-
"Skipping TestGetSessionID after TestSetConsent, as GetSessionId() "
127-
"will fail until the app is restarted.");
145+
"Skipping %s after TestSetConsent, as the test may fail until the app "
146+
"is restarted.",
147+
::testing::UnitTest::GetInstance()->current_test_info()->name());
128148
GTEST_SKIP();
129149
return;
130150
}
@@ -154,39 +174,39 @@ TEST_F(FirebaseAnalyticsTest, TestGetSessionID) {
154174
}
155175
}
156176

157-
TEST_F(FirebaseAnalyticsTest, TestSetConsent) {
158-
// Can't confirm that these do anything but just run them all to ensure the
159-
// app doesn't crash.
160-
std::map<firebase::analytics::ConsentType, firebase::analytics::ConsentStatus>
161-
consent_settings_allow = {
162-
{firebase::analytics::kConsentTypeAnalyticsStorage,
163-
firebase::analytics::kConsentStatusGranted},
164-
{firebase::analytics::kConsentTypeAdStorage,
165-
firebase::analytics::kConsentStatusGranted},
166-
{firebase::analytics::kConsentTypeAdUserData,
167-
firebase::analytics::kConsentStatusGranted},
168-
{firebase::analytics::kConsentTypeAdPersonalization,
169-
firebase::analytics::kConsentStatusGranted}};
170-
std::map<firebase::analytics::ConsentType, firebase::analytics::ConsentStatus>
171-
consent_settings_deny = {
172-
{firebase::analytics::kConsentTyp 10000 eAnalyticsStorage,
173-
firebase::analytics::kConsentStatusDenied},
174-
{firebase::analytics::kConsentTypeAdStorage,
175-
firebase::analytics::kConsentStatusDenied},
176-
{firebase::analytics::kConsentTypeAdUserData,
177-
firebase::analytics::kConsentStatusDenied},
178-
{firebase::analytics::kConsentTypeAdPersonalization,
179-
firebase::analytics::kConsentStatusDenied}};
180-
std::map<firebase::analytics::ConsentType, firebase::analytics::ConsentStatus>
181-
consent_settings_empty;
182-
firebase::analytics::SetConsent(consent_settings_empty);
183-
ProcessEvents(1000);
184-
firebase::analytics::SetConsent(consent_settings_deny);
185-
ProcessEvents(1000);
186-
firebase::analytics::SetConsent(consent_settings_allow);
187-
ProcessEvents(1000);
177+
TEST_F(FirebaseAnalyticsTest, TestResettingGivesNewInstanceId) {
178+
// On Android, if SetConsent was tested, this test will fail, since the app
179+
// needs to be restarted after consent is denied or it won't generate a new
180+
// sessionID. To not break the tests, skip this test in that case.
181+
#if defined(__ANDROID__)
182+
// Log the Google Play services version for debugging in case this test fails.
183+
LogInfo("Google Play services version: %d", GetGooglePlayServicesVersion());
184+
if (did_test_setconsent_) {
185+
LogInfo(
186+
"Skipping %s after TestSetConsent, as the test may fail until the app "
187+
"is restarted.",
188+
::testing::UnitTest::GetInstance()->current_test_info()->name());
189+
GTEST_SKIP();
190+
return;
191+
}
192+
#endif
193+
FLAKY_TEST_SECTION_BEGIN();
188194

189-
did_test_setconsent_ = true;
195+
firebase::Future<std::string> future =
196+
firebase::analytics::GetAnalyticsInstanceId();
197+
WaitForCompletion(future, "GetAnalyticsInstanceId");
198+
EXPECT_FALSE(future.result()->empty());
199+
std::string instance_id = *future.result();
200+
201+
firebase::analytics::ResetAnalyticsData();
202+
203+
future = firebase::analytics::GetAnalyticsInstanceId();
204+
WaitForCompletion(future, "GetAnalyticsInstanceId after ResetAnalyticsData");
205+
std::string new_instance_id = *future.result();
206+
EXPECT_FALSE(future.result()->empty());
207+
EXPECT_NE(instance_id, new_instance_id);
208+
209+
FLAKY_TEST_SECTION_END();
190210
}
191211

192212
TEST_F(FirebaseAnalyticsTest, TestSetProperties) {
@@ -231,29 +251,48 @@ TEST_F(FirebaseAnalyticsTest, TestLogEventWithMultipleParameters) {
231251
sizeof(kLevelUpParameters) / sizeof(kLevelUpParameters[0]));
232252
}
233253

234-
TEST_F(FirebaseAnalyticsTest, TestResettingGivesNewInstanceId) {
235-
// Test is flaky on iPhone due to a known issue in iOS. See b/143656277.
236-
#if TARGET_OS_IPHONE
237-
FLAKY_TEST_SECTION_BEGIN();
238-
#endif // TARGET_OS_IPHONE
239-
240-
firebase::Future<std::string> future =
241-
firebase::analytics::GetAnalyticsInstanceId();
242-
WaitForCompletion(future, "GetAnalyticsInstanceId");
243-
EXPECT_FALSE(future.result()->empty());
244-
std::string instance_id = *future.result();
245-
246-
firebase::analytics::ResetAnalyticsData();
254+
TEST_F(FirebaseAnalyticsTest, TestSetConsent) {
255+
// On Android, this test must be performed at the end, after all the tests for
256+
// session ID and instance ID. This is because once you call SetConsent to
257+
// deny consent on Android, calling it again to grant consent may not take
258+
// effect until the app restarts, thus breaking any of those tests that are
259+
// run after this one.
260+
//
261+
// If this test does happen to run earlier (due to randomizing test order, for
262+
// example), the tests that could fail will be skipped (on Android).
247263

248-
future = firebase::analytics::GetAnalyticsInstanceId();
249-
WaitForCompletion(future, "GetAnalyticsInstanceId after ResetAnalyticsData");
250-
std::string new_instance_id = *future.result();
251-
EXPECT_FALSE(future.result()->empty());
252-
EXPECT_NE(instance_id, new_instance_id);
264+
// Can't confirm that these do anything but just run them all to ensure the
265+
// app doesn't crash.
266+
std::map<firebase::analytics::ConsentType, firebase::analytics::ConsentStatus>
267+
consent_settings_allow = {
268< 10000 code class="diff-text syntax-highlighted-line addition">+
{firebase::analytics::kConsentTypeAnalyticsStorage,
269+
firebase::analytics::kConsentStatusGranted},
270+
{firebase::analytics::kConsentTypeAdStorage,
271+
firebase::analytics::kConsentStatusGranted},
272+
{firebase::analytics::kConsentTypeAdUserData,
273+
firebase::analytics::kConsentStatusGranted},
274+
{firebase::analytics::kConsentTypeAdPersonalization,
275+
firebase::analytics::kConsentStatusGranted}};
276+
std::map<firebase::analytics::ConsentType, firebase::analytics::ConsentStatus>
277+
consent_settings_deny = {
278+
{firebase::analytics::kConsentTypeAnalyticsStorage,
279+
firebase::analytics::kConsentStatusDenied},
280+
{firebase::analytics::kConsentTypeAdStorage,
281+
firebase::analytics::kConsentStatusDenied},
282+
{firebase::analytics::kConsentTypeAdUserData,
283+
firebase::analytics::kConsentStatusDenied},
284+
{firebase::analytics::kConsentTypeAdPersonalization,
285+
firebase::analytics::kConsentStatusDenied}};
286+
std::map<firebase::analytics::ConsentType, firebase::analytics::ConsentStatus>
287+
consent_settings_empty;
288+
firebase::analytics::SetConsent(consent_settings_empty);
289+
ProcessEvents(1000);
290+
firebase::analytics::SetConsent(consent_settings_deny);
291+
ProcessEvents(1000);
292+
firebase::analytics::SetConsent(consent_settings_allow);
293+
ProcessEvents(1000);
253294

254-
#if TARGET_OS_IPHONE
255-
FLAKY_TEST_SECTION_END();
256-
#endif // TARGET_OS_IPHONE
295+
did_test_setconsent_ = true;
257296
}
258297

259298
} // namespace firebase_testapp_automated

analytics/ios_headers/FIREventNames.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// Copyright 2023 Google LLC
1+
// Copyright 2024 Google LLC
22

3-
// Copied from Firebase Analytics iOS SDK 10.19.0.
3+
// Copied from Firebase Analytics iOS SDK 10.20.0.
44

55
/// @file FIREventNames.h
66
///

analytics/ios_headers/FIRParameterNames.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// Copyright 2023 Google LLC
1+
// Copyright 2024 Google LLC
22

3-
// Copied from Firebase Analytics iOS SDK 10.19.0.
3+
// Copied from Firebase Analytics iOS SDK 10.20.0.
44

55
/// @file FIRParameterNames.h
66
///
@@ -11,8 +11,9 @@
1111
/// not limited to these. You may supply extra Params for suggested Events or custom Params for
1212
/// Custom events. Param names can be up to 40 characters long, may only contain alphanumeric
1313
/// characters and underscores ("_"), and must start with an alphabetic character. Param values can
14-
/// be up to 100 characters long. The "firebase_", "google_", and "ga_" prefixes are reserved and
15-
/// should not be used.
14+
/// be up to 100 characters long for standard Google Analytics properties and up to 500 characters
15+
/// long for Google Analytics 360 properties. The "firebase_", "google_", and "ga_" prefixes are
16+
/// reserved and should not be used.
1617

1718
#import <Foundation/Foundation.h>
1819

analytics/ios_headers/FIRUserPropertyNames.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// Copyright 2023 Google LLC
1+
// Copyright 2024 Google LLC
22

3-
// Copied from Firebase Analytics iOS SDK 10.19.0.
3+
// Copied from Firebase Analytics iOS SDK 10.20.0.
44

55
/// @file FIRUserPropertyNames.h
66
///

app/app_resources/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ android {
5050
}
5151

5252
dependencies {
53-
implementation platform('com.google.firebase:firebase-bom:32.7.0')
53+
implementation platform('com.google.firebase:firebase-bom:32.7.1')
5454
implementation 'com.google.firebase:firebase-analytics'
5555
}
5656

app/google_api_resources/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ android {
5353
}
5454

5555
dependencies {
56-
implementation platform('com.google.firebase:firebase-bom:32.7.0')
56+
implementation platform('com.google.firebase:firebase-bom:32.7.1')
5757
implementation 'com.google.firebase:firebase-analytics'
58-
implementation 'com.google.android.gms:play-services-base:18.2.0'
58+
implementation 'com.google.android.gms:play-services-base:18.3.0'
5959
implementation project(':app:app_resources')
6060
}
6161

app/integration_test/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ platform :ios, '11.0'
44
use_frameworks! :linkage => :static
55

66
target 'integration_test' do
7-
pod 'Firebase/Analytics', '10.19.0'
7+
pod 'Firebase/Analytics', '10.20.0'
88
end
99

1010
post_install do |installer|

app/invites_resources/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ android {
4949
}
5050

5151
dependencies {
52-
implementation platform('com.google.firebase:firebase-bom:32.7.0')
52+
implementation platform('com.google.firebase:firebase-bom:32.7.1')
5353
implementation 'com.google.firebase:firebase-analytics'
5454
implementation 'com.google.firebase:firebase-dynamic-links'
5555
implementation project(':app:app_resources')

app_check/app_check_resources/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ android {
4949
}
5050

5151
dependencies {
52-
implementation platform('com.google.firebase:firebase-bom:32.7.0')
52+
implementation platform('com.google.firebase:firebase-bom:32.7.1')
5353
implementation 'com.google.firebase:firebase-appcheck'
5454
}
5555

app_check/integration_test/Podfile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ use_frameworks! :linkage => :static
44

55
target 'integration_test' do
66
platform :ios, '11.0'
7-
pod 'Firebase/AppCheck', '10.19.0'
8-
pod 'Firebase/Database', '10.19.0'
9-
pod 'Firebase/Auth', '10.19.0'
10-
pod 'Firebase/Storage', '10.19.0'
11-
pod 'Firebase/Functions', '10.19.0'
7+
pod 'Firebase/AppCheck', '10.20.0'
8+
pod 'Firebase/Database', '10.20.0'
9+
pod 'Firebase/Auth', '10.20.0'
10+
pod 'Firebase/Storage', '10.20.0'
11+
pod 'Firebase/Functions', '10.20.0'
1212
end
1313

1414
target 'integration_test_tvos' do
1515
platform :tvos, '12.0'
16-
pod 'Firebase/AppCheck', '10.19.0'
17-
pod 'Firebase/Database', '10.19.0'
18-
pod 'Firebase/Auth', '10.19.0'
19-
pod 'Firebase/Storage', '10.19.0'
20-
pod 'Firebase/Functions', '10.19.0'
16+
pod 'Firebase/AppCheck', '10.20.0'
17+
pod 'Firebase/Database', '10.20.0'
18+
pod 'Firebase/Auth', '10.20.0'
19+
pod 'Firebase/Storage', '10.20.0'
20+
pod 'Firebase/Functions', '10.20.0'
2121
end
2222

2323
post_install do |installer|

auth/auth_resources/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ android {
4949
}
5050

5151
dependencies {
52-
implementation platform('com.google.firebase:firebase-bom:32.7.0')
52+
implementation platform('com.google.firebase:firebase-bom:32.7.1')
5353
implementation 'com.google.firebase:firebase-analytics'
5454
implementation 'com.google.firebase:firebase-auth'
5555
implementation project(':app:app_resources')

0 commit comments

Comments
 (0)
0