Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
6770e90
Enable Integration Tests in Git
aashishpatil-g Mar 4, 2025
0877c2d
Rearrange workflow step
aashishpatil-g Mar 4, 2025
c0194e1
Remove chmod and check
aashishpatil-g Mar 4, 2025
20524c9
Make script executable
aashishpatil-g Mar 4, 2025
375c466
Update run config for tests
aashishpatil-g Mar 4, 2025
8693cf8
Reinstate chmod for the downloaded emulator binary
aashishpatil-g Mar 4, 2025
d4263e9
Start emulator binary in background
aashishpatil-g Mar 4, 2025
221a839
match main sdk file
aashishpatil-g Mar 4, 2025
95bc074
Updated to match main SDK workflow files
aashishpatil-g Mar 4, 2025
bfa113d
reinstate previous run config
aashishpatil-g Mar 4, 2025
9ad6d8e
Test build script change
aashishpatil-g Mar 4, 2025
758b074
Test script use commit hash
aashishpatil-g Mar 4, 2025
55d5c4d
Test Reinstate main branch now that PR has merged
aashishpatil-g Mar 4, 2025
e91fd84
Removing tvOS tests temporarily.
aashishpatil-g Mar 4, 2025
c4d1c13
Setup spm tests
aashishpatil-g Mar 5, 2025
e7057d1
Install iOS platform
aashishpatil-g Mar 5, 2025
d8e91e8
Test on xcode 16 only
aashishpatil-g Mar 5, 2025
532a3ab
update to macos 15
aashishpatil-g Mar 5, 2025
30a6c9a
Update python version to 3.11
aashishpatil-g Mar 5, 2025
443fbc1
Print main sdk HEAD commit
aashishpatil-g Mar 5, 2025
651889c
[Infra] Bump clang-format to v20 (#44)
ncooke3 Mar 5, 2025
1328218
[Infra] Update check.yml
ncooke3 Mar 5, 2025
aa69f88
Revert setup_spm_tests step
aashishpatil-g Mar 5, 2025
9a41f38
Add check for app already configured
aashishpatil-g Mar 5, 2025
fb297e8
Convert app creation to lazy init
aashishpatil-g Mar 5, 2025
3c1d0c8
Add back tvOS tests
aashishpatil-g Mar 5, 2025
73fcdda
Update run unit name to indicate integration tests
aashishpatil-g Mar 5, 2025
2b9c080
Nick feedback
aashishpatil-g Mar 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.11'

- name: Cache Mint packages
uses: actions/cache@v4
Expand All @@ -32,11 +32,7 @@ jobs:
run: ./setup-scripts.sh

- name: Setup check
run: |
brew update
brew install clang-format@19
brew install mint
mint bootstrap
run: scripts/setup_check.sh

- name: Style
run: scripts/style.sh test-only
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/spm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ jobs:
env:
FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
FIREBASE_MAIN: 1
DISABLE_INTEGRATION_TESTS: 1
steps:
- uses: actions/checkout@v4
- name: Generate Swift Package.resolved
Expand All @@ -54,15 +53,14 @@ jobs:

strategy:
matrix:
os: [macos-14]
os: [macos-15]
# GitHub actions' runners do not include visionOS. https://github.com/actions/runner-images/issues/10559
target: [iOS, tvOS, macOS, catalyst]
xcode: [Xcode_15.2, Xcode_15.4, Xcode_16]
target: [iOS, macOS, tvOS, catalyst]
xcode: [Xcode_16.2]
runs-on: ${{ matrix.os }}
env:
FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
FIREBASE_MAIN: 1
DISABLE_INTEGRATION_TESTS: 1
steps:
- uses: actions/checkout@v4
- uses: actions/cache/restore@v4
Expand All @@ -73,5 +71,9 @@ jobs:
run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
- name: Setup Scripts Directory
run: ./setup-scripts.sh
- name: Unit Tests
run: scripts/third_party/travis/retry.sh scripts/build.sh FirebaseDataConnect ${{ matrix.target }} spm
- name: Install iOS Platform
run: xcodebuild -downloadPlatform iOS
- name: Integration Test Setup
run: Tests/Integration/Emulator/start-emulator.sh
- name: Unit and Integration Tests
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseDataConnect ${{ matrix.target }} spm
37 changes: 37 additions & 0 deletions Tests/Integration/Emulator/start-emulator.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env bash

# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Sets up Firebase Data Connect emulator to execute
# integration tests.

set -e

# Get the absolute path to the directory containing this script.
SCRIPT_DIR="$(cd $(dirname ${BASH_SOURCE[0]}) && pwd)"
TEMP_DIR="$(mktemp -d -t firebase-data-connect)"
echo "Starting Firebase Data Connect emulator in ${TEMP_DIR}"
cd "${TEMP_DIR}"

EMULATOR_VERSION="1.8.3"
EMULATOR_FILENAME="dataconnect-emulator-macos-v${EMULATOR_VERSION}"
EMULATOR_URL="https://storage.googleapis.com/firemat-preview-drop/emulator/${EMULATOR_FILENAME}"
echo "Downloading emulator from ${EMULATOR_URL}"

curl -o "${EMULATOR_FILENAME}" "${EMULATOR_URL}"

chmod 755 "${EMULATOR_FILENAME}"

./${EMULATOR_FILENAME} --logtostderr dev --listen="127.0.0.1:3628" &
6 changes: 4 additions & 2 deletions Tests/Integration/IntegrationTestBase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ class IntegrationTestBase: XCTestCase {
)

override class func setUp() {
FirebaseApp.configure(options: options)
defaultApp = FirebaseApp.app()
if defaultApp == nil {
FirebaseApp.configure(options: options)
defaultApp = FirebaseApp.app()
}
DataConnect.kitchenSinkConnector.useEmulator(port: 3628)
}
}
19 changes: 9 additions & 10 deletions Tests/Unit/InstanceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,15 @@ import XCTest

@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
class InstanceTests: XCTestCase {
static var defaultApp: FirebaseApp?
static var appTwo: FirebaseApp?
static var defaultApp: FirebaseApp? = {
FirebaseApp.configure(options: options)
return FirebaseApp.app()
}()

static var appTwo: FirebaseApp? = {
FirebaseApp.configure(name: "app-two", options: optionsTwo)
return FirebaseApp.app(name: "app-two")
}()

static var options: FirebaseOptions = {
let options = FirebaseOptions(googleAppID: "0:0000000000000:ios:0000000000000000",
Expand Down Expand Up @@ -51,14 +58,6 @@ class InstanceTests: XCTestCase {
connector: "blogs"
)

override class func setUp() {
FirebaseApp.configure(options: options)
defaultApp = FirebaseApp.app()

FirebaseApp.configure(name: "app-two", options: optionsTwo)
appTwo = FirebaseApp.app(name: "app-two")
}

// same connector config, same app, instance returned should be same
func testSameInstance() throws {
let dcOne = DataConnect.dataConnect(connectorConfig: fakeConnectorConfigOne)
Expand Down
Loading