-
Notifications
You must be signed in to change notification settings - Fork 127
Add Firestore internal tests to build_testapps, and add iOS and Android support. #343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
on various platforms for various reasons. b/183294303 tracks re-enabling them.
(Mark the ones that don't work as skipped.)
Make sure the internal integration test includes the external one.
DellaBitta
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nits.
| IMPORTANT: This file is used by both the regular and the internal Firestore | ||
| integration tests, and needs to be present and identical in both. | ||
| Please sure that any changes to this file are reflected in both of its locations: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: "ensure"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
| # Firestore's internal integration test requires absl on Android, | ||
| # so download it now. | ||
| set(ABSEIL_CPP_ROOT ${CMAKE_CURRENT_LIST_DIR}/external/abseil-cpp/src/abseil-cpp) | ||
| if (NOT EXISTS ${ABSEIL_CPP_ROOT}/absl/base/attributes.h) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be done on just a directory so that it's less fragile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
|
||
| constexpr char kClassName[] = | ||
| PROGUARD_KEEP_CLASS "com/google/android/gms/tasks/CancellationTokenSource"; | ||
| "com/google/android/gms/tasks/CancellationTokenSource"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving this note for your review to ensure this change was intended and proguard isn't required anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, PROGUARD_KEEP_CLASS is only Proguarding classes referenced by our SDK, not by the testapp itself. I moved those to the proguard.pro in the testapp.
| #include "firebase/firestore/firestore_errors.h" | ||
| #include "app_framework.h" | ||
| #include "firebase_test_framework.h" | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: shouldn't these includes be alphabetized?
| #include "android/firestore_integration_test_android.h" | ||
| #include "gmock/gmock.h" | ||
| #include "gtest/gtest.h" | ||
| #include "firebase_test_framework.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: and alphabetize here.
Edit: Oh, are these additions we're making or changes we're inheriting from the Firestore repo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
firebase_test_framework and app_framework are additions (so that we can run their tests in our own test framework). All other includes are inherited. I'll hold off on alphabetizing these files until we can set up code formatting and alphabetize all.
| @entitlement_path = entitlement_path | ||
| end | ||
| opts.on('-i', '--XCodeCPP.include [include_path]', | ||
| 'Path to additional header search files (optional)') do |include_path| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: this is confusing. Should it be like above, "Path to additional include files (optional)" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
❌ Integration test FAILEDRequested by @jonsimantov on commit 2015cd6
|
Overview
This PR adds the Firestore internal integration tests to the "Integration Tests" workflow when building against source. Additionally, it adds iOS and Android support for those tests. (A number of tests were modified or skipped due to issues; these will be fixed in a future PR.)
Removes tests from the old location in firestore/src/tests. If any of these integration tests can actually just be run as unit tests (e.g. they don't talk to the actual Firestore backend), they can be moved back into firestore/src/tests at some point in the future.
Increased test timeout from 5 minutes to 15 minutes across the board, since Firestore tests take much longer.
build_testapps.py
Now will build the internal integration test instead of the regular one, if there is one available and we are building against the source SDK. (The packaged SDK cannot test the internal APIs, so will only test the regular test.)
Because we build and run the internal test INSTEAD of the regular test, the internal test duplicates the regular test's main source file in addition to the bevy of additional tests it runs. This ensures that those tests still pass even when testing against source.
Android support
Built + tested on Android device. Several tests have issues, probably due to JNI and threads (the tests now run in a background thread). Those tests have been marked as skipped.
On Android, because we don't compile the Firestore core library, we bring in absl manually, as the tests themselves require absl.
iOS support
Built + tested on iOS device. Several tests (notably transaction_extra_test) time out on iOS and have been skipped.
A few changes are required to build these tests, in particular the XCode project tool needs to add the SDK directory to the header search paths so that the tests can include internal SDK headers.
Windows
A number of fixes for paths being too long and preprocessor issues.