Repository navigation
Conversation
Add IntegrationTesting/HostedTests/HostedTests.xcodeproj, a project for SDK test suites that need an app process (keychain, UIApplication, a main bundle), which Swift Package Manager test bundles don't have. It has a blank iOS/tvOS host app, FirebaseTestHost, that links no Firebase code, and a local package reference to the repo's Package.swift. The HostSmokeTests target checks what the host provides: a keychain round-trip, the host's app delegate, a GoogleService-Info.plist copied into the test bundle by a build phase, and FirebaseCore linked into the test bundle rather than the host. Add generic `HostedTests-<scheme>` cases to scripts/build.sh, the infra.hosted_tests workflow that runs HostSmokeTests on iOS and tvOS, and a README with the steps for adding an SDK's tests.
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a hosted testing framework under IntegrationTesting/HostedTests to run SDK test suites requiring an app process, including a blank host app FirebaseTestHost, a smoke test suite HostSmokeTests, and updates to scripts/build.sh to support these schemes. The review feedback recommends dynamically handling the test-without-building action in scripts/build.sh to support standard CI/CD workflows, and correcting the API reference in the README from UIApplication.sharedApplication to UIApplication.shared.
Add a HostedTests-*-test-without-building case to scripts/build.sh so CI can split build-for-testing and test-without-building, and use UIApplication.shared in the README.
Discussion
Some SDK tests need an app process: keychain access,
UIApplication.sharedApplicationwith a delegate, or a main bundle. Swift Package Manager test bundles don't have these, so these tests run today only through CocoaPods test specs orpod genworkspaces. This PR adds one shared Xcode project for them, so each SDK doesn't need its own host app. It has no SDK tests yet; the Installations integration tests from #17114 are planned as the first.IntegrationTesting/HostedTests/HostedTests.xcodeprojhas a blank iOS/tvOS host app,FirebaseTestHost(scene-basedmain.m, links no Firebase code), and anXCLocalSwiftPackageReferenceto../... Source folders are synchronized folders, so adding test files doesn't changeproject.pbxproj.HostSmokeTeststarget and shared scheme check what the host provides: aSecItemAdd/SecItemCopyMatching/SecItemDeleteround-trip with a unique service name,UIApplication.shared.delegatebeing the host'sFIRTestHostAppDelegate, aGoogleService-Info.plist(fake values) copied into the test bundle by a run script phase and readable withFirebaseOptions(contentsOfFile:)whileBundle.mainhas none, andFirebaseCorelinked into the test bundle (Bundle(for: FirebaseApp.self)is the test bundle).TestConfig/$(TARGET_NAME)/GoogleService-Info.plistinto the test bundle and removes a stale copy when the file is missing (the approach from test(installations): run the integration tests in an SPM test app #17114), so SDK targets can reuse it unchanged..gitignoreignores decrypted plists underTestConfig, except the smoke test's fake one.scripts/build.shgets genericHostedTests-<scheme>cases (testby default, plusbuild,build-for-testing, andtest-without-building), so SDK schemes need no new cases. Example:scripts/build.sh HostedTests-HostSmokeTests tvOS.infra.hosted_tests.ymlrunsHostSmokeTestson iOS and tvOS onmacos-26with Xcode 26.4, for PRs that changeIntegrationTesting/HostedTests/**,scripts/build.sh, or the workflow, plus nightly. It's a standalone job instead of_build.yml, because_build.ymlinstalls Ruby and Bundler for this method and doesn't upload xcresult bundles.IntegrationTesting/HostedTests/README.mdexplains how an SDK adds a<SDK>HostedTeststarget and scheme, secrets, CI path filters, keychain hygiene, when to add another host target, and to try tests without a host first.Not changed / known limitations
scripts/repo.sh teststill runsFirebase<SDK>Integrationcases; the README usesscripts/repo.sh decryptfollowed byscripts/build.shfor hosted schemes.scripts/build.shchanges trigger other workflows' path filters, includingsdk.ai.yml's live-backend jobs.Testing
xcodebuild test -project IntegrationTesting/HostedTests/HostedTests.xcodeproj -scheme HostSmokeTestspassed 4 of 4 tests on iPhone 17 (iOS 27.2) and on Apple TV 4K (4th generation) (tvOS 27.2) simulators.TEST_HOST=on iOS 27.2),testKeychainRoundTripfailed with-34018(errSecMissingEntitlement) andtestSharedApplicationHasHostDelegatefound no delegate, so these checks detect a missing host.main.morHostSmokeTests.swiftin the four test runs. The project's own targets build with warnings as errors; Firebase package targets don't.scripts/style.shreports the changed files as clean (clang-format 23.1.0, swiftformat 0.55.5).zizmorreports no findings for the new workflow.scripts/build.sh HostedTests-HostSmokeTests iOSwasn't run to completion locally: the localFirebase-iPhone-15-Prosimulator has iOS 27.0, which Xcode 27.2 doesn't match for this destination.DRY_RUN=1shows the expectedxcodebuildcommands fortest,build,build-for-testing, andtest-without-building. The new workflow runs it on CI.API Changes
None.
#no-changelog
This PR was prepared with AI assistance.