diff --git a/.github/workflows/sdk.firestore.nightly.yml b/.github/workflows/sdk.firestore.nightly.yml deleted file mode 100644 index 2db1d2c81ba..00000000000 --- a/.github/workflows/sdk.firestore.nightly.yml +++ /dev/null @@ -1,95 +0,0 @@ -# Copyright 2023 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. - -name: sdk.firestore.nightly - -on: - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} - cancel-in-progress: true - -jobs: - check: - runs-on: macos-14 - steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - - - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 - with: - python-version: 3.11 - - - name: Setup check - run: scripts/setup_check.sh - - - name: Run check - run: scripts/check.sh --test-only - - cmake-prod-db: - needs: check - - strategy: - matrix: - os: [macos-14] - databaseId: [(default)] - - env: - plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }} - MINT_PATH: ${{ github.workspace }}/mint - TARGET_DATABASE_ID: ${{ matrix.databaseId }} - USE_LATEST_CMAKE: false - - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - - - name: Prepare ccache - uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 - with: - path: ${{ runner.temp }}/ccache - key: firestore-ccache-${{ matrix.databaseId }}-${{ runner.os }}-${{ github.sha }} - restore-keys: | - firestore-ccache-${{ matrix.databaseId }}-${{ runner.os }}- - - - name: Cache Mint packages - uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 - with: - path: ${{ env.MINT_PATH }} - key: ${{ runner.os }}-mint-${{ hashFiles('**/Mintfile') }} - restore-keys: ${{ runner.os }}-mint- - - - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 - with: - python-version: '3.11' - - - name: Install Secret GoogleService-Info.plist - run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/firestore-nightly.plist.gpg \ - Firestore/Example/App/GoogleService-Info.plist "$plist_secret" - - - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v2 - with: - cmake-version: '3.31.1' - - # Skipping terraform index creation because we are not allowed to download SA key json. - - - name: Setup build - run: scripts/install_prereqs.sh Firestore ${{ runner.os }} cmake - - - name: Build and test - run: | - export CCACHE_DIR=${{ runner.temp }}/ccache - export TARGET_BACKEND=nightly - scripts/third_party/travis/retry.sh scripts/build.sh Firestore ${{ runner.os }} cmake diff --git a/.github/workflows/sdk.firestore.yml b/.github/workflows/sdk.firestore.yml index 0e04ed5ee06..2b06009570a 100644 --- a/.github/workflows/sdk.firestore.yml +++ b/.github/workflows/sdk.firestore.yml @@ -160,8 +160,7 @@ jobs: export CCACHE_DIR=${{ runner.temp }}/ccache scripts/third_party/travis/retry.sh scripts/build.sh Firestore ${{ runner.os }} cmake - - cmake-prod-db: + sanitizers-mac: needs: check # Either a scheduled run from public repo, or a pull request with firestore changes. if: | @@ -171,15 +170,14 @@ jobs: strategy: matrix: os: [macos-14] - databaseId: [(default), test-db] + sanitizer: [asan, tsan] + + runs-on: ${{ matrix.os }} env: - plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }} - MINT_PATH: ${{ github.workspace }}/mint - TARGET_DATABASE_ID: ${{ matrix.databaseId }} + SANITIZERS: ${{ matrix.sanitizer }} USE_LATEST_CMAKE: false - runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 @@ -187,59 +185,14 @@ jobs: uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 with: path: ${{ runner.temp }}/ccache - key: firestore-ccache-${{ matrix.databaseId }}-${{ runner.os }}-${{ github.sha }} + key: ${{ matrix.sanitizer }}-firestore-ccache-${{ runner.os }}-${{ github.sha }} restore-keys: | - firestore-ccache-${{ matrix.databaseId }}-${{ runner.os }}- - - - name: Cache Mint packages - uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 - with: - path: ${{ env.MINT_PATH }} - key: ${{ runner.os }}-mint-${{ hashFiles('**/Mintfile') }} - restore-keys: ${{ runner.os }}-mint- + ${{ matrix.sanitizer }}-firestore-ccache-${{ runner.os }}- - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 with: python-version: '3.11' - - name: Install Secret GoogleService-Info.plist - run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/firestore.plist.gpg \ - Firestore/Example/App/GoogleService-Info.plist "$plist_secret" - - - name: Install Google Service Account key - run: | - scripts/decrypt_gha_secret.sh scripts/gha-encrypted/firestore-integration.json.gpg \ - google-service-account.json "$plist_secret" - - # create composite indexes with Terraform - - name: Set up Google Cloud SDK - uses: google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db # v3.0.1 - - name: Setup Terraform - uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2 - - name: Terraform Init - run: | - cd Firestore - terraform init - - name: Terraform Apply - run: | - cd Firestore - - # Define a temporary file, redirect both stdout and stderr to it - output_file=$(mktemp) - if ! terraform apply -var-file=../google-service-account.json -auto-approve > "$output_file" 2>&1 ; then - cat "$output_file" - if cat "$output_file" | grep -q "index already exists"; then - echo "===================================================================================" - echo "Terraform apply failed due to index already exists; We can safely ignore this error." - echo "===================================================================================" - fi - exit 1 - fi - rm -f "$output_file" - env: - GOOGLE_APPLICATION_CREDENTIALS: ../google-service-account.json - continue-on-error: true - - name: Setup cmake uses: jwlawson/actions-setup-cmake@802fa1a2c4e212495c05bf94dba2704a92a472be with: @@ -254,7 +207,7 @@ jobs: scripts/third_party/travis/retry.sh scripts/build.sh Firestore ${{ runner.os }} cmake - sanitizers-mac: + sanitizers-ubuntu: needs: check # Either a scheduled run from public repo, or a pull request with firestore changes. if: | @@ -263,13 +216,17 @@ jobs: strategy: matrix: - os: [macos-14] - sanitizer: [asan, tsan] + os: [ubuntu-latest] + # Excluding TSAN on ubuntu because of the warnings it generates around schedule.cc. + # This could be due to Apple Clang provide additional support for synchronization + # on Apple platforms, which is what we primarily care about. + sanitizer: [asan] runs-on: ${{ matrix.os }} env: SANITIZERS: ${{ matrix.sanitizer }} + ASAN_OPTIONS: detect_leaks=0 USE_LATEST_CMAKE: false steps: @@ -301,58 +258,62 @@ jobs: scripts/third_party/travis/retry.sh scripts/build.sh Firestore ${{ runner.os }} cmake - sanitizers-ubuntu: + xcodetest_prod: needs: check # Either a scheduled run from public repo, or a pull request with firestore changes. if: | (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || - (github.event_name == 'pull_request' && needs.changes.outputs.changed == 'true') + (github.event_name == 'pull_request') + runs-on: macos-15 strategy: matrix: - os: [ubuntu-latest] - # Excluding TSAN on ubuntu because of the warnings it generates around schedule.cc. - # This could be due to Apple Clang provide additional support for synchronization - # on Apple platforms, which is what we primarily care about. - sanitizer: [asan] - - runs-on: ${{ matrix.os }} + target: [iOS, macOS, tvOS] + scheme: [Firestore, FirestoreEnterprise] env: - SANITIZERS: ${{ matrix.sanitizer }} - ASAN_OPTIONS: detect_leaks=0 - USE_LATEST_CMAKE: false + plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }} steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - - name: Prepare ccache - uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 - with: - path: ${{ runner.temp }}/ccache - key: ${{ matrix.sanitizer }}-firestore-ccache-${{ runner.os }}-${{ github.sha }} - restore-keys: | - ${{ matrix.sanitizer }}-firestore-ccache-${{ runner.os }}- + - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1 - - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 - with: - python-version: '3.11' + - name: Install Secret GoogleService-Info.plist + run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/firestore.plist.gpg \ + Firestore/Example/App/GoogleService-Info.plist "$plist_secret" - - name: Setup cmake - uses: jwlawson/actions-setup-cmake@802fa1a2c4e212495c05bf94dba2704a92a472be - with: - cmake-version: '3.31.1' + - name: Select Xcode + run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer - - name: Setup build - run: scripts/install_prereqs.sh Firestore ${{ runner.os }} cmake + - name: Install simulators in case they are missing. + if: matrix.target != 'macOS' + uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3 + with: + timeout_minutes: 15 + max_attempts: 5 + retry_wait_seconds: 120 + command: sudo xcodebuild -downloadPlatform ${{ matrix.target }} - - name: Build and test - run: | - export CCACHE_DIR=${{ runner.temp }}/ccache - scripts/third_party/travis/retry.sh scripts/build.sh Firestore ${{ runner.os }} cmake + # 'FirestoreEnterprise' is used as product name for `build.sh` to select the enterprise build variant. `install_prereqs.sh` does not require this distinction, so 'Firestore' is used. + - name: Setup build + run: scripts/install_prereqs.sh Firestore ${{ matrix.target }} xcodebuild + - name: Build + uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3 + with: + timeout_minutes: 60 + command: scripts/build.sh ${{ matrix.scheme }} ${{ matrix.target }} xcodebuild + + - name: Test + uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3 + with: + timeout_minutes: 60 + max_attempts: 3 + retry_wait_seconds: 120 + command: scripts/build.sh ${{ matrix.scheme }} ${{ matrix.target }} xcodetest - xcodebuild: + xcodetest_emulator: needs: check # Either a scheduled run from public repo, or a pull request with firestore changes. if: | @@ -363,6 +324,8 @@ jobs: strategy: matrix: target: [iOS, macOS, tvOS] + # Skip the FirestoreEnterprise test against emulator since emulator is under development. + scheme: [Firestore] steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 @@ -372,12 +335,32 @@ jobs: - name: Select Xcode run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer + - name: Install simulators in case they are missing. + if: matrix.target != 'macOS' + uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3 + with: + timeout_minutes: 15 + max_attempts: 5 + retry_wait_seconds: 120 + command: sudo xcodebuild -downloadPlatform ${{ matrix.target }} + - name: Setup build + # 'FirestoreEnterprise' is used as product name for `build.sh` to select the enterprise build variant. `install_prereqs.sh` does not require this distinction, so 'Firestore' is used. run: scripts/install_prereqs.sh Firestore ${{ matrix.target }} xcodebuild - - name: Build and test - run: | - scripts/third_party/travis/retry.sh scripts/build.sh Firestore ${{ matrix.target }} xcodebuild + - name: Build + uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3 + with: + timeout_minutes: 120 + command: scripts/build.sh ${{ matrix.scheme }} ${{ matrix.target }} xcodebuild + + - name: Test + uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3 + with: + timeout_minutes: 120 + max_attempts: 3 + retry_wait_seconds: 120 + command: scripts/build.sh ${{ matrix.scheme }} ${{ matrix.target }} xcodetest pod_lib_lint: needs: check @@ -508,22 +491,21 @@ jobs: platforms: iOS buildonly_platforms: iOS - # TODO: Re-enable either in or after #11706. - # spm-source-cron: - # # Don't run on private repo. - # if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk' - # runs-on: macos-14 - # strategy: - # matrix: - # target: [tvOS, macOS, catalyst] - # env: - # FIREBASE_SOURCE_FIRESTORE: 1 - # steps: - # - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - # - name: Initialize xcodebuild - # run: scripts/setup_spm_tests.sh - # - name: Build Test - Binary - # run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestore ${{ matrix.target }} spmbuildonly + spm-source-cron: + # Don't run on private repo. + if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk' + runs-on: macos-14 + strategy: + matrix: + target: [tvOS, macOS, catalyst] + env: + FIREBASE_SOURCE_FIRESTORE: 1 + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - name: Initialize xcodebuild + run: scripts/setup_spm_tests.sh + - name: Build Test - Binary + run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestore ${{ matrix.target }} spmbuildonly spm-binary-cron: # Don't run on private repo. @@ -546,7 +528,15 @@ jobs: check-required-tests: runs-on: ubuntu-latest name: Check all required Firestore tests results - needs: [cmake, cmake-prod-db, xcodebuild, spm-source, spm-binary] + needs: + - cmake + - xcodetest_emulator + - xcodetest_prod + - spm-source + - spm-binary + - sanitizers-mac + - sanitizers-ubuntu + - pod_lib_lint steps: - name: Check test matrix if: needs.*.result == 'failure' diff --git a/Firestore/Example/Firestore.xcodeproj/xcshareddata/xcschemes/Firestore_IntegrationTests_Enterprise_iOS.xcscheme b/Firestore/Example/Firestore.xcodeproj/xcshareddata/xcschemes/Firestore_IntegrationTests_Enterprise_iOS.xcscheme new file mode 100644 index 00000000000..2204c0ccc65 --- /dev/null +++ b/Firestore/Example/Firestore.xcodeproj/xcshareddata/xcschemes/Firestore_IntegrationTests_Enterprise_iOS.xcscheme @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Firestore/Example/Firestore.xcodeproj/xcshareddata/xcschemes/Firestore_IntegrationTests_Enterprise_macOS.xcscheme b/Firestore/Example/Firestore.xcodeproj/xcshareddata/xcschemes/Firestore_IntegrationTests_Enterprise_macOS.xcscheme new file mode 100644 index 00000000000..41d441e5a80 --- /dev/null +++ b/Firestore/Example/Firestore.xcodeproj/xcshareddata/xcschemes/Firestore_IntegrationTests_Enterprise_macOS.xcscheme @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Firestore/Example/Firestore.xcodeproj/xcshareddata/xcschemes/Firestore_IntegrationTests_Enterprise_tvOS.xcscheme b/Firestore/Example/Firestore.xcodeproj/xcshareddata/xcschemes/Firestore_IntegrationTests_Enterprise_tvOS.xcscheme new file mode 100644 index 00000000000..2318375ff5e --- /dev/null +++ b/Firestore/Example/Firestore.xcodeproj/xcshareddata/xcschemes/Firestore_IntegrationTests_Enterprise_tvOS.xcscheme @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Firestore/Example/Tests/Integration/API/FIRAggregateTests.mm b/Firestore/Example/Tests/Integration/API/FIRAggregateTests.mm index 9899875e052..24664eb6510 100644 --- a/Firestore/Example/Tests/Integration/API/FIRAggregateTests.mm +++ b/Firestore/Example/Tests/Integration/API/FIRAggregateTests.mm @@ -680,9 +680,6 @@ - (void)testPerformsAggregationsOnNestedMapValues { } - (void)testPerformsSumThatOverflowsMaxLong { - XCTSkipIf([FSTIntegrationTestCase isRunningAgainstEmulator], - @"Skipping test because the emulator's behavior deviates from the expected outcome."); - FIRCollectionReference* testCollection = [self collectionRefWithDocuments:@{ @"a" : @{ @"author" : @"authorA", @@ -708,6 +705,10 @@ - (void)testPerformsSumThatOverflowsMaxLong { break; } case FSTBackendEditionEnterprise: { + XCTSkipIf( + [FSTIntegrationTestCase isRunningAgainstEmulator], + @"Skipping test because the emulator's behavior deviates from the expected outcome."); + XCTestExpectation* expectation = [self expectationWithDescription:NSStringFromSelector(_cmd)]; __block NSError* anError = nil; [query aggregationWithSource:FIRAggregateSourceServer @@ -748,9 +749,6 @@ - (void)testPerformsSumThatCanOverflowLongValuesDuringAccumulation { } - (void)testPerformsSumThatIsNegative { - XCTSkipIf([FSTIntegrationTestCase isRunningAgainstEmulator], - @"Skipping test because the emulator's behavior deviates from the expected outcome."); - FIRCollectionReference* testCollection = [self collectionRefWithDocuments:@{ @"a" : @{ @"author" : @"authorA", @@ -781,6 +779,10 @@ - (void)testPerformsSumThatIsNegative { break; } case FSTBackendEditionEnterprise: { + XCTSkipIf( + [FSTIntegrationTestCase isRunningAgainstEmulator], + @"Skipping test because the emulator's behavior deviates from the expected outcome."); + XCTestExpectation* expectation = [self expectationWithDescription:NSStringFromSelector(_cmd)]; __block NSError* anError = nil; [query aggregationWithSource:FIRAggregateSourceServer @@ -873,9 +875,6 @@ - (void)testPerformsSumThatIsValidButCouldOverflowDuringAggregation { } - (void)testPerformsSumOverResultSetOfZeroDocuments { - XCTSkipIf([FSTIntegrationTestCase isRunningAgainstEmulator], - @"Skipping test because the emulator's behavior deviates from the expected outcome."); - FIRCollectionReference* testCollection = [self collectionRefWithDocuments:@{ @"a" : @{ @"author" : @"authorA", @@ -910,6 +909,10 @@ - (void)testPerformsSumOverResultSetOfZeroDocuments { break; } case FSTBackendEditionEnterprise: { + XCTSkipIf( + [FSTIntegrationTestCase isRunningAgainstEmulator], + @"Skipping test because the emulator's behavior deviates from the expected outcome."); + XCTAssertEqual([snapshot valueForAggregateField:sumOfPages], [NSNull null]); break; } diff --git a/Firestore/Example/Tests/Integration/API/FIRQueryTests.mm b/Firestore/Example/Tests/Integration/API/FIRQueryTests.mm index b6393c8e6aa..8ee797f93e1 100644 --- a/Firestore/Example/Tests/Integration/API/FIRQueryTests.mm +++ b/Firestore/Example/Tests/Integration/API/FIRQueryTests.mm @@ -570,9 +570,6 @@ - (void)testSDKUsesNotEqualFiltersSameAsServer { } - (void)testQueriesCanUseArrayContainsFilters { - XCTSkipIf([FSTIntegrationTestCase isRunningAgainstEmulator], - @"Skipping test because the emulator's behavior deviates from the expected outcome."); - NSDictionary *testDocs = @{ @"a" : @{@"array" : @[ @42 ]}, @"b" : @{@"array" : @[ @"a", @42, @"c" ]}, @@ -615,9 +612,6 @@ - (void)testQueriesCanUseArrayContainsFilters { } - (void)testQueriesCanUseInFilters { - XCTSkipIf([FSTIntegrationTestCase isRunningAgainstEmulator], - @"Skipping test because the emulator's behavior deviates from the expected outcome."); - NSDictionary *testDocs = @{ @"a" : @{@"zip" : @98101}, @"b" : @{@"zip" : @91102}, diff --git a/Firestore/Swift/Tests/Integration/AggregationIntegrationTests.swift b/Firestore/Swift/Tests/Integration/AggregationIntegrationTests.swift index babee43e94d..080ea3be03e 100644 --- a/Firestore/Swift/Tests/Integration/AggregationIntegrationTests.swift +++ b/Firestore/Swift/Tests/Integration/AggregationIntegrationTests.swift @@ -295,11 +295,6 @@ class AggregationIntegrationTests: FSTIntegrationTestCase { } func testPerformsAggregateOverResultSetOfZeroDocuments() async throws { - try XCTSkipIf( - FSTIntegrationTestCase.isRunningAgainstEmulator(), - "Skipping test because the emulator's behavior deviates from the expected outcome." - ) - let collection = collectionRef() try await collection.addDocument(data: ["pages": 100]) try await collection.addDocument(data: ["pages": 50]) @@ -328,11 +323,6 @@ class AggregationIntegrationTests: FSTIntegrationTestCase { } func testPerformsAggregateOverResultSetOfZeroFields() async throws { - try XCTSkipIf( - FSTIntegrationTestCase.isRunningAgainstEmulator(), - "Skipping test because the emulator's behavior deviates from the expected outcome." - ) - let collection = collectionRef() try await collection.addDocument(data: ["pages": 100]) try await collection.addDocument(data: ["pages": 50]) diff --git a/Firestore/Swift/Tests/Integration/PipelineTests.swift b/Firestore/Swift/Tests/Integration/PipelineTests.swift index 0d80737ad73..15e64dff7dd 100644 --- a/Firestore/Swift/Tests/Integration/PipelineTests.swift +++ b/Firestore/Swift/Tests/Integration/PipelineTests.swift @@ -2068,11 +2068,6 @@ class PipelineIntegrationTests: FSTIntegrationTestCase { } func testLike() async throws { - try XCTSkipIf( - FSTIntegrationTestCase.isRunningAgainstEmulator(), - "Emulator does not support this function." - ) - let collRef = collectionRef(withDocuments: bookDocs) let db = collRef.firestore @@ -2091,11 +2086,6 @@ class PipelineIntegrationTests: FSTIntegrationTestCase { } func testRegexContains() async throws { - try XCTSkipIf( - FSTIntegrationTestCase.isRunningAgainstEmulator(), - "Emulator does not support this function." - ) - let collRef = collectionRef(withDocuments: bookDocs) let db = collRef.firestore @@ -2109,11 +2099,6 @@ class PipelineIntegrationTests: FSTIntegrationTestCase { } func testRegexMatches() async throws { - try XCTSkipIf( - FSTIntegrationTestCase.isRunningAgainstEmulator(), - "Emulator does not support this function." - ) - let collRef = collectionRef(withDocuments: bookDocs) let db = collRef.firestore @@ -2394,11 +2379,6 @@ class PipelineIntegrationTests: FSTIntegrationTestCase { } func testExpOverflow() async throws { - try XCTSkipIf( - FSTIntegrationTestCase.isRunningAgainstEmulator(), - "Skipping test because the emulator's behavior deviates from the expected outcome." - ) - let collRef = collectionRef(withDocuments: [ "doc1": ["value": 1000], ]) @@ -2504,11 +2484,6 @@ class PipelineIntegrationTests: FSTIntegrationTestCase { } func testChecks() async throws { - try XCTSkipIf( - FSTIntegrationTestCase.isRunningAgainstEmulator(), - "Skipping test because the emulator's behavior deviates from the expected outcome." - ) - let collRef = collectionRef(withDocuments: bookDocs) let db = collRef.firestore @@ -3249,11 +3224,6 @@ class PipelineIntegrationTests: FSTIntegrationTestCase { } func testTimestampTruncWorks() async throws { - try XCTSkipIf( - FSTIntegrationTestCase.isRunningAgainstEmulator(), - "Emulator does not support this function." - ) - let db = firestore() let randomCol = collectionRef() try await randomCol.document("dummyDoc").setData(["field": "value"]) @@ -3716,11 +3686,6 @@ class PipelineIntegrationTests: FSTIntegrationTestCase { } func testTypeWorks() async throws { - try XCTSkipIf( - FSTIntegrationTestCase.isRunningAgainstEmulator(), - "Skipping test because the emulator's behavior deviates from the expected outcome." - ) - let collRef = collectionRef(withDocuments: [ "doc1": [ "a": 1, diff --git a/Firestore/Swift/Tests/Integration/QueryToPipelineTests.swift b/Firestore/Swift/Tests/Integration/QueryToPipelineTests.swift index fd946669333..8b80080d144 100644 --- a/Firestore/Swift/Tests/Integration/QueryToPipelineTests.swift +++ b/Firestore/Swift/Tests/Integration/QueryToPipelineTests.swift @@ -550,11 +550,6 @@ class QueryToPipelineTests: FSTIntegrationTestCase { } func testSupportsEqNan() async throws { - try XCTSkipIf( - FSTIntegrationTestCase.isRunningAgainstEmulator(), - "Skipping test because the emulator's behavior deviates from the expected outcome." - ) - let collRef = collectionRef(withDocuments: [ "1": ["foo": 1, "bar": Double.nan], "2": ["foo": 2, "bar": 1], diff --git a/Firestore/core/src/api/realtime_pipeline.cc b/Firestore/core/src/api/realtime_pipeline.cc index 743c64aa2b1..21155a28ca1 100644 --- a/Firestore/core/src/api/realtime_pipeline.cc +++ b/Firestore/core/src/api/realtime_pipeline.cc @@ -52,6 +52,24 @@ RealtimePipeline& RealtimePipeline::operator=(const RealtimePipeline& other) { return *this; } +RealtimePipeline::RealtimePipeline(RealtimePipeline&& other) noexcept + : stages_(std::move(other.stages_)), + rewritten_stages_(std::move(other.rewritten_stages_)), + serializer_(std::move(other.serializer_)), + listen_options_(std::move(other.listen_options_)) { +} + +RealtimePipeline& RealtimePipeline::operator=( + RealtimePipeline&& other) noexcept { + if (this != &other) { + stages_ = std::move(other.stages_); + rewritten_stages_ = std::move(other.rewritten_stages_); + serializer_ = std::move(other.serializer_); + listen_options_ = std::move(other.listen_options_); + } + return *this; +} + RealtimePipeline RealtimePipeline::AddingStage( std::shared_ptr stage) { auto copy = std::vector>(this->stages_); diff --git a/Firestore/core/src/api/realtime_pipeline.h b/Firestore/core/src/api/realtime_pipeline.h index dab00a1c335..c74c395c075 100644 --- a/Firestore/core/src/api/realtime_pipeline.h +++ b/Firestore/core/src/api/realtime_pipeline.h @@ -41,6 +41,9 @@ class RealtimePipeline { RealtimePipeline(const RealtimePipeline& other); RealtimePipeline& operator=(const RealtimePipeline& other); + RealtimePipeline(RealtimePipeline&& other) noexcept; + RealtimePipeline& operator=(RealtimePipeline&& other) noexcept; + RealtimePipeline AddingStage(std::shared_ptr stage); const std::vector>& stages() const; diff --git a/scripts/build.sh b/scripts/build.sh index 171b15cb228..362050816e9 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -31,6 +31,7 @@ USAGE: $0 product [platform] [method] product can be one of: Firebase Firestore + FirestoreEnterprise CombineSwift InAppMessaging Messaging @@ -120,7 +121,13 @@ function RunXcodebuild() { local buildaction="${xcodebuild_args[$# - 1]}" # buildaction is the last arg local log_filename="xcodebuild-${buildaction}.log" - local xcbeautify_cmd=(xcbeautify --renderer github-actions --disable-logging) + local xcbeautify_cmd + if command -v xcbeautify &> /dev/null; then + xcbeautify_cmd=(xcbeautify --renderer github-actions --disable-logging) + else + echo "xcbeautify not found, using raw xcodebuild output." + xcbeautify_cmd=(cat) + fi local result=0 NSUnbufferedIO=YES xcodebuild "$@" 2>&1 | tee "$log_filename" | \ @@ -365,6 +372,50 @@ case "$product-$platform-$method" in test ;; + Firestore-*-xcodebuild) + "${firestore_emulator}" start + trap '"${firestore_emulator}" stop' ERR EXIT + + RunXcodebuild \ + -workspace 'Firestore/Example/Firestore.xcworkspace' \ + -scheme "Firestore_IntegrationTests_$platform" \ + "${xcb_flags[@]}" \ + # Memory intensive, so we limit jobs + -jobs 4 \ + build-for-testing + ;; + + Firestore-*-xcodetest) + RunXcodebuild \ + -workspace 'Firestore/Example/Firestore.xcworkspace' \ + -scheme "Firestore_IntegrationTests_$platform" \ + -enableCodeCoverage YES \ + "${xcb_flags[@]}" \ + test-without-building + ;; + + FirestoreEnterprise-*-xcodebuild) + "${firestore_emulator}" start + trap '"${firestore_emulator}" stop' ERR EXIT + + RunXcodebuild \ + -workspace 'Firestore/Example/Firestore.xcworkspace' \ + -scheme "Firestore_IntegrationTests_Enterprise_$platform" \ + "${xcb_flags[@]}" \ + # Memory intensive, so we limit jobs + -jobs 4 \ + build-for-testing + ;; + + FirestoreEnterprise-*-xcodetest) + RunXcodebuild \ + -workspace 'Firestore/Example/Firestore.xcworkspace' \ + -scheme "Firestore_IntegrationTests_Enterprise_$platform" \ + -enableCodeCoverage YES \ + "${xcb_flags[@]}" \ + test-without-building + ;; + Firestore-macOS-cmake | Firestore-Linux-cmake) "${firestore_emulator}" start trap '"${firestore_emulator}" stop' ERR EXIT