Skip to content

Commit 6472606

Browse files
committed
Merge branch 'main' into bugfix/app-cmake-exceptions-private
2 parents c926d5b + 423b5f5 commit 6472606

File tree

44 files changed

+1641
-782
lines changed

Some content is hidden

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

44 files changed

+1641
-782
lines changed

.github/workflows/checks.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ jobs:
5454
with:
5555
python-version: 3.7
5656
- name: Install prerequisites
57-
run: python scripts/gha/install_prereqs_desktop.py
57+
run: |
58+
python scripts/gha/install_prereqs_desktop.py
59+
python -m pip install unidiff
5860
- name: Generate headers
5961
run: |
6062
mkdir build
@@ -73,7 +75,9 @@ jobs:
7375
run: |
7476
if grep -Eq "error:|warning:" doxygen_errors.txt; then
7577
# Grep for warnings and print them out (replacing \n with %0A for github log)
76-
grep -E "error:|warning:|^ parameter" doxygen_errors.txt | sed ':a;N;$!ba;s/\n/%0A/g' | sed 's/^/::error ::DOXYGEN ERRORS: %0A/'
78+
grep -E "error:|warning:|^ parameter" doxygen_errors.txt > doxygen_errors_filtered.txt
79+
cat doxygen_errors_filtered.txt | sed ':a;N;$!ba;s/\n/%0A/g' | sed 's/^/::error ::DOXYGEN ERRORS: %0A/'
80+
python scripts/gha/pr_file_commenter.py -t ${{ github.token }} -p ${{ github.event.pull_request.number }} -T hidden-doxygen-comment-tag -P '📝 __Documentation issue:__ ' -S '' -f 10 < doxygen_errors_filtered.txt || true
7781
exit 1
7882
fi
7983

.github/workflows/cpp-packaging.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ jobs:
693693
with:
694694
python-version: '3.7'
695695
- name: Use expanded matrix
696-
if: github.event.inputs.use_expanded_matrix == '1'
696+
if: github.event_name == 'schedule' || github.event.inputs.use_expanded_matrix == '1'
697697
run: |
698698
echo "USE_EXPANDED_MATRIX=1" >> $GITHUB_ENV
699699
- name: Generate token for GitHub API

.github/workflows/integration_tests.yml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,25 +158,37 @@ jobs:
158158
fetch-depth: 0
159159
submodules: false
160160
- name: Use expanded matrix
161-
if: github.event.inputs.use_expanded_matrix == '1' || needs.check_trigger.outputs.requested_tests == 'full'
161+
if: github.event_name == 'schedule' || github.event.inputs.use_expanded_matrix == '1' || needs.check_trigger.outputs.requested_tests == 'full'
162162
run: |
163163
echo "EXPANDED_MATRIX_PARAM=-e=1" >> $GITHUB_ENV
164+
echo "::warning ::Running on the expanded matrix"
164165
- name: Set auto-diff option if specified.
165166
if: needs.check_trigger.outputs.requested_tests == 'auto'
166167
run: |
167168
echo "Autodetecting which tests to run."
168169
if [[ -n "${{github.event.inputs.test_pull_request}}" ]]; then
169-
# If running this manually, diff against main.
170-
echo "AUTO_DIFF_PARAM=--auto_diff main" >> $GITHUB_ENV
170+
# If running this manually, diff against our common ancestor with main.
171+
MERGE_BASE=$(git merge-base HEAD origin/main)
172+
echo "::warning ::Auto-diff HEAD..${MERGE_BASE}"
173+
git diff --name-only HEAD..${MERGE_BASE}
174+
echo "AUTO_DIFF_PARAM=--auto_diff HEAD..${MERGE_BASE}" >> $GITHUB_ENV
171175
else
172176
# If running in a PR, diff against the PR's base.
173-
echo "AUTO_DIFF_PARAM=--auto_diff ${{github.event.pull_request.base.sha}}" >> $GITHUB_ENV
177+
# "git merge-base main branch_name" will give the common ancestor of both branches.
178+
MERGE_BASE=$(git merge-base origin/${{github.event.pull_request.head.ref}} origin/${{github.event.pull_request.base.ref}} || true)
179+
# If origin/<branch> is no longer valid, then just run all tests.
180+
if [[ -n "${MERGE_BASE}" ]]; then
181+
echo "::warning ::Auto-diff origin/${{github.event.pull_request.head.ref}}..${MERGE_BASE}"
182+
git diff --name-only origin/${{github.event.pull_request.head.ref}}..${MERGE_BASE}
183+
echo "AUTO_DIFF_PARAM=--auto_diff origin/${{github.event.pull_request.head.ref}}..${MERGE_BASE}" >> $GITHUB_ENV
184+
fi
174185
fi
175186
- id: export-result
176187
# e.g. 'ubuntu-latest,macos-latest' -> '["ubuntu-latest","macos-latest"]'
177188
run: |
178-
echo "::set-output name=apis::$( python scripts/gha/print_matrix_configuration.py -c -w integration_tests -k apis -o "${{github.event.inputs.apis}}" ${AUTO_DIFF_PARAM})"
179-
echo "::set-output name=matrix_platform::$( python scripts/gha/print_matrix_configuration.py -w integration_tests ${EXPANDED_MATRIX_PARAM} -k platform -o "${{github.event.inputs.platforms}}" ${AUTO_DIFF_PARAM})"
189+
apis=$( python scripts/gha/print_matrix_configuration.py -c -w integration_tests -k apis -o "${{github.event.inputs.apis}}" ${AUTO_DIFF_PARAM})
190+
echo "::set-output name=apis::${apis}"
191+
echo "::set-output name=matrix_platform::$( python scripts/gha/print_matrix_configuration.py -w integration_tests ${EXPANDED_MATRIX_PARAM} -k platform -o "${{github.event.inputs.platforms}}" --apis ${apis} ${AUTO_DIFF_PARAM})"
180192
echo "::set-output name=matrix_os::$( python scripts/gha/print_matrix_configuration.py -w integration_tests ${EXPANDED_MATRIX_PARAM} -k os -o "${{github.event.inputs.operating_systems}}" ${AUTO_DIFF_PARAM})"
181193
# If building against a packaged SDK, only use boringssl.
182194
if [[ -n "${{ github.event.inputs.test_packaged_sdk }}" ]]; then
@@ -814,6 +826,7 @@ jobs:
814826
run: |
815827
echo "::set-output name=device_type::$( python scripts/gha/print_matrix_configuration.py -d -k ${{ matrix.android_device }} )"
816828
- name: Run Android integration tests on Emulator locally
829+
timeout-minutes: 60
817830
if: steps.get-device-type.outputs.device_type == 'virtual'
818831
run: |
819832
python scripts/gha/test_simulator.py --testapp_dir testapps \
@@ -898,6 +911,7 @@ jobs:
898911
run: |
899912
echo "::set-output name=device_type::$( python scripts/gha/print_matrix_configuration.py -d -k ${{ matrix.ios_device }} )"
900913
- name: Run iOS integration tests on Simulator locally
914+
timeout-minutes: 60
901915
if: steps.get-device-type.outputs.device_type == 'virtual'
902916
run: |
903917
python scripts/gha/test_simulator.py --testapp_dir testapps \
@@ -979,6 +993,7 @@ jobs:
979993
- name: Install python deps
980994
run: pip install -r scripts/gha/requirements.txt
981995
- name: Run tvOS integration tests on Simulator locally
996+
timeout-minutes: 60
982997
run: |
983998
python scripts/gha/test_simulator.py --testapp_dir testapps \
984999
--tvos_device "${{ matrix.tvos_device }}" \

analytics/integration_test/src/integration_test.cc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,12 @@ TEST_F(FirebaseAnalyticsTest, TestLogEventWithMultipleParameters) {
130130
sizeof(kLevelUpParameters) / sizeof(kLevelUpParameters[0]));
131131
}
132132

133-
#if !(TARGET_OS_IPHONE)
134-
// Test is flakey on iPhone due to a known issue in iOS. See b/143656277.
135133
TEST_F(FirebaseAnalyticsTest, TestResettingGivesNewInstanceId) {
134+
// Test is flaky on iPhone due to a known issue in iOS. See b/143656277.
135+
#if TARGET_OS_IPHONE
136+
FLAKY_TEST_SECTION_BEGIN();
137+
#endif // TARGET_OS_IPHONE
138+
136139
firebase::Future<std::string> future =
137140
firebase::analytics::GetAnalyticsInstanceId();
138141
WaitForCompletion(future, "GetAnalyticsInstanceId");
@@ -146,7 +149,10 @@ TEST_F(FirebaseAnalyticsTest, TestResettingGivesNewInstanceId) {
146149
std::string new_instance_id = *future.result();
147150
EXPECT_FALSE(future.result()->empty());
148151
EXPECT_NE(instance_id, new_instance_id);
152+
153+
#if TARGET_OS_IPHONE
154+
FLAKY_TEST_SECTION_END();
155+
#endif // TARGET_OS_IPHONE
149156
}
150-
#endif // !(TARGET_OS_IPHONE)
151157

152158
} // namespace firebase_testapp_automated

auth/integration_test/src/integration_test.cc

Lines changed: 75 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -719,34 +719,40 @@ TEST_F(FirebaseAuthTest, TestWithCustomEmailAndPassword) {
719719
EXPECT_NE(auth_->current_user(), nullptr);
720720
}
721721

722-
#if !defined(__linux__)
723-
// Test is disabled on linux due to the need to unlock the keystore.
724722
TEST_F(FirebaseAuthTest, TestAuthPersistenceWithAnonymousSignin) {
723+
// Automated test is disabled on linux due to the need to unlock the keystore.
724+
SKIP_TEST_ON_LINUX;
725+
726+
FLAKY_TEST_SECTION_BEGIN();
727+
725728
WaitForCompletion(auth_->SignInAnonymously(), "SignInAnonymously");
726-
ASSERT_NE(auth_->current_user(), nullptr);
729+
EXPECT_NE(auth_->current_user(), nullptr);
727730
EXPECT_TRUE(auth_->current_user()->is_anonymous());
728731
Terminate();
729732
ProcessEvents(2000);
730733
Initialize();
731734
EXPECT_NE(auth_, nullptr);
732-
ASSERT_NE(auth_->current_user(), nullptr);
735+
EXPECT_NE(auth_->current_user(), nullptr);
733736
EXPECT_TRUE(auth_->current_user()->is_anonymous());
734737
DeleteUser();
735-
}
736-
#endif // ! defined(__linux__)
737738

738-
#if !defined(__linux__)
739-
// Test is disabled on linux due to the need to unlock the keychain.
739+
FLAKY_TEST_SECTION_END();
740+
}
740741
TEST_F(FirebaseAuthTest, TestAuthPersistenceWithEmailSignin) {
742+
// Automated test is disabled on linux due to the need to unlock the keystore.
743+
SKIP_TEST_ON_LINUX;
744+
745+
FLAKY_TEST_SECTION_BEGIN();
746+
741747
std::string email = GenerateEmailAddress();
742748
WaitForCompletion(
743749
auth_->CreateUserWithEmailAndPassword(email.c_str(), kTestPassword),
744750
"CreateUserWithEmailAndPassword");
745-
ASSERT_NE(auth_->current_user(), nullptr);
751+
EXPECT_NE(auth_->current_user(), nullptr);
746752
EXPECT_FALSE(auth_->current_user()->is_anonymous());
747753
std::string prev_provider_id = auth_->current_user()->provider_id();
748-
// Save the old provider ID list so we can make sure it's the same once it's
749-
// loaded again.
754+
// Save the old provider ID list so we can make sure it's the same once
755+
// it's loaded again.
750756
std::vector<std::string> prev_provider_data_ids;
751757
for (int i = 0; i < auth_->current_user()->provider_data().size(); i++) {
752758
prev_provider_data_ids.push_back(
@@ -756,7 +762,7 @@ TEST_F(FirebaseAuthTest, TestAuthPersistenceWithEmailSignin) {
756762
ProcessEvents(2000);
757763
Initialize();
758764
EXPECT_NE(auth_, nullptr);
759-
ASSERT_NE(auth_->current_user(), nullptr);
765+
EXPECT_NE(auth_->current_user(), nullptr);
760766
EXPECT_FALSE(auth_->current_user()->is_anonymous());
761767
// Make sure the provider IDs are the same as they were before.
762768
EXPECT_EQ(auth_->current_user()->provider_id(), prev_provider_id);
@@ -765,16 +771,17 @@ TEST_F(FirebaseAuthTest, TestAuthPersistenceWithEmailSignin) {
765771
loaded_provider_data_ids.push_back(
766772
auth_->current_user()->provider_data()[i]->provider_id());
767773
}
768-
EXPECT_EQ(loaded_provider_data_ids, prev_provider_data_ids);
774+
EXPECT_TRUE(loaded_provider_data_ids == prev_provider_data_ids);
769775

770776
// Cleanup, ensure we are signed in as the user so we can delete it.
771777
WaitForCompletion(
772778
auth_->SignInWithEmailAndPassword(email.c_str(), kTestPassword),
773779
"SignInWithEmailAndPassword");
774780
EXPECT_NE(auth_->current_user(), nullptr);
775781
DeleteUser();
782+
783+
FLAKY_TEST_SECTION_END();
776784
}
777-
#endif // ! defined(__linux__)
778785

779786
class PhoneListener : public firebase::auth::PhoneAuthProvider::Listener {
780787
public:
@@ -860,57 +867,63 @@ TEST_F(FirebaseAuthTest, TestPhoneAuth) {
860867
// Note: This test requires interactivity on iOS, as it displays a CAPTCHA.
861868
TEST_REQUIRES_USER_INTERACTION;
862869
#endif // TARGET_OS_IPHONE
863-
{
864-
firebase::auth::PhoneAuthProvider& phone_provider =
865-
firebase::auth::PhoneAuthProvider::GetInstance(auth_);
866-
LogDebug("Creating listener.");
867-
PhoneListener listener;
868-
LogDebug("Calling VerifyPhoneNumber.");
869-
// Randomly choose one of the phone numbers to avoid collisions.
870-
const int random_phone_number =
871-
app_framework::GetCurrentTimeInMicroseconds() %
872-
kPhoneAuthTestNumPhoneNumbers;
873-
phone_provider.VerifyPhoneNumber(
874-
kPhoneAuthTestPhoneNumbers[random_phone_number], kPhoneAuthTimeoutMs,
875-
nullptr, &listener);
876-
// Wait for OnCodeSent() callback.
877-
int wait_ms = 0;
878-
LogDebug("Waiting for code send.");
879-
while (listener.waiting_to_send_code()) {
880-
if (wait_ms > kPhoneAuthCodeSendWaitMs) break;
881-
ProcessEvents(kWaitIntervalMs);
882-
wait_ms += kWaitIntervalMs;
883-
}
884-
EXPECT_EQ(listener.on_verification_failed_count(), 0);
885-
LogDebug("Waiting for verification ID.");
886-
// Wait for the listener to have a verification ID.
887-
wait_ms = 0;
888-
while (listener.waiting_for_verification_id()) {
889-
if (wait_ms > kPhoneAuthCompletionWaitMs) break;
890-
ProcessEvents(kWaitIntervalMs);
891-
wait_ms += kWaitIntervalMs;
892-
}
893-
if (listener.on_verification_complete_count() > 0) {
894-
LogDebug("Signing in with automatic verification code.");
895-
WaitForCompletion(auth_->SignInWithCredential(listener.credential()),
896-
"SignInWithCredential(PhoneCredential) automatic");
897-
} else if (listener.on_verification_failed_count() > 0) {
898-
FAIL() << "Automatic verification failed.";
899-
} else {
900-
// Did not automatically verify, submit verification code manually.
901-
EXPECT_GT(listener.on_code_auto_retrieval_time_out_count(), 0);
902-
EXPECT_NE(listener.verification_id(), "");
903-
LogDebug("Signing in with verification code.");
904-
const firebase::auth::Credential phone_credential =
905-
phone_provider.GetCredential(listener.verification_id().c_str(),
906-
kPhoneAuthTestVerificationCode);
907-
908-
WaitForCompletion(auth_->SignInWithCredential(phone_credential),
909-
"SignInWithCredential(PhoneCredential)");
910-
}
870+
871+
FLAKY_TEST_SECTION_BEGIN();
872+
873+
firebase::auth::PhoneAuthProvider& phone_provider =
874+
firebase::auth::PhoneAuthProvider::GetInstance(auth_);
875+
LogDebug("Creating listener.");
876+
PhoneListener listener;
877+
LogDebug("Calling VerifyPhoneNumber.");
878+
// Randomly choose one of the phone numbers to avoid collisions.
879+
const int random_phone_number =
880+
app_framework::GetCurrentTimeInMicroseconds() %
881+
kPhoneAuthTestNumPhoneNumbers;
882+
phone_provider.VerifyPhoneNumber(
883+
kPhoneAuthTestPhoneNumbers[random_phone_number], kPhoneAuthTimeoutMs,
884+
nullptr, &listener);
885+
886+
// Wait for OnCodeSent() callback.
887+
int wait_ms = 0;
888+
LogDebug("Waiting for code send.");
889+
while (listener.waiting_to_send_code()) {
890+
if (wait_ms > kPhoneAuthCodeSendWaitMs) break;
891+
ProcessEvents(kWaitIntervalMs);
892+
wait_ms += kWaitIntervalMs;
893+
}
894+
EXPECT_EQ(listener.on_verification_failed_count(), 0);
895+
896+
LogDebug("Waiting for verification ID.");
897+
// Wait for the listener to have a verification ID.
898+
wait_ms = 0;
899+
while (listener.waiting_for_verification_id()) {
900+
if (wait_ms > kPhoneAuthCompletionWaitMs) break;
901+
ProcessEvents(kWaitIntervalMs);
902+
wait_ms += kWaitIntervalMs;
911903
}
904+
if (listener.on_verification_complete_count() > 0) {
905+
LogDebug("Signing in with automatic verification code.");
906+
WaitForCompletion(auth_->SignInWithCredential(listener.credential()),
907+
"SignInWithCredential(PhoneCredential) automatic");
908+
} else if (listener.on_verification_failed_count() > 0) {
909+
FAIL() << "Automatic verification failed.";
910+
} else {
911+
// Did not automatically verify, submit verification code manually.
912+
EXPECT_GT(listener.on_code_auto_retrieval_time_out_count(), 0);
913+
EXPECT_NE(listener.verification_id(), "");
914+
LogDebug("Signing in with verification code.");
915+
const firebase::auth::Credential phone_credential =
916+
phone_provider.GetCredential(listener.verification_id().c_str(),
917+
kPhoneAuthTestVerificationCode);
918+
919+
WaitForCompletion(auth_->SignInWithCredential(phone_credential),
920+
"SignInWithCredential(PhoneCredential)");
921+
}
922+
912923
ProcessEvents(1000);
913924
DeleteUser();
925+
926+
FLAKY_TEST_SECTION_END();
914927
}
915928

916929
#if defined(ENABLE_OAUTH_TESTS)

docs/Doxyfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ WARN_IF_DOC_ERROR = YES
3131
# WARN_IF_INCOMPLETE_DOC = YES
3232

3333

34-
# Filter all header files to remove everything between <SWIG> and </SWIG> tags.
35-
# This is in lieu of performing a full header scrub.
34+
# Filter all header files to blank out all lines between <SWIG> and </SWIG>
35+
# tags, inclusively. This is in lieu of performing a full header scrub.
3636
FILTER_SOURCE_FILES = YES
37-
INPUT_FILTER = "sed '/<SWIG>/,/<\/SWIG>/d'"
37+
INPUT_FILTER = "sed '/<SWIG>/,/<\/SWIG>/ s/.*//'"
3838

3939
# Space-separated list of input files.
4040
# This is commented out because the Doxygen script will append the correct list of headers here.

external/vcpkg

Submodule vcpkg updated 5537 files

firestore/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ set(common_SRCS
3232
src/common/field_path.cc
3333
src/common/field_value.cc
3434
src/common/firestore.cc
35+
src/common/firestore_exceptions_common.h
3536
src/common/futures.cc
3637
src/common/futures.h
3738
src/common/hard_assert_common.cc
3839
src/common/hard_assert_common.h
3940
src/common/listener_registration.cc
4041
src/common/load_bundle_task_progress.cc
4142
src/common/macros.h
42-
src/common/main_for_testing_build.cc
4343
src/common/query.cc
4444
src/common/query_snapshot.cc
4545
src/common/set_options.cc
@@ -342,6 +342,8 @@ add_custom_target(
342342
COMMENT "Copying internal Firestore headers"
343343
)
344344

345+
# This is needed due to Firestore's dependence on some firebase::app APIs that
346+
# are guarded by this flag, such as GetUserAgent and function_registry.
345347
set(FIREBASE_FIRESTORE_CPP_DEFINES -DINTERNAL_EXPERIMENTAL=1)
346348

347349
if (WIN32 AND NOT ANDROID AND NOT IOS)

0 commit comments

Comments
 (0)