Ver Fonte

Fix Remote Config Integration CI (#8774)

Paul Beusterien há 4 anos atrás
pai
commit
33692eb578

+ 4 - 3
.github/workflows/remoteconfig.yml

@@ -38,9 +38,10 @@ jobs:
       run: scripts/third_party/travis/retry.sh scripts/build.sh RemoteConfig ${{ matrix.target }} unit
     - name: Fake Console API Tests
       run: scripts/third_party/travis/retry.sh scripts/build.sh RemoteConfig iOS fakeconsole
-    - name: IntegrationTest
-      if: matrix.target == 'iOS'
-      run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/build.sh RemoteConfig iOS integration)
+    # TODO: Find Firebase project and restore IntegrationTest
+    # - name: IntegrationTest
+    #   if: matrix.target == 'iOS'
+    #   run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/build.sh RemoteConfig iOS integration)
 
   pod-lib-lint:
     # Don't run on private repo unless it is a PR.

+ 1 - 1
FirebaseDatabase/Tests/Unit/Swift/DatabaseAPITests.swift

@@ -14,7 +14,7 @@
 // limitations under the License.
 //
 
-// MARK: This file is used to evaluate the experience of using Firebase APIs in Swift.
+// MARK: This file is used to evaluate the experience of using the Firebase Database APIs in Swift.
 
 import Foundation
 

+ 0 - 3
FirebaseRemoteConfig.podspec

@@ -94,8 +94,6 @@ app update.
     swift_api.pod_target_xcconfig = {
       'SWIFT_OBJC_BRIDGING_HEADER' => '$(PODS_TARGET_SRCROOT)/FirebaseRemoteConfig/Tests/FakeUtils/Bridging-Header.h'
     }
-    swift_api.resources = 'FirebaseRemoteConfig/Tests/SwiftAPI/GoogleService-Info.plist',
-                          'FirebaseRemoteConfig/Tests/SwiftAPI/AccessToken.json'
     swift_api.dependency 'OCMock'
   end
 
@@ -115,7 +113,6 @@ app update.
     fake_console.pod_target_xcconfig = {
       'SWIFT_OBJC_BRIDGING_HEADER' => '$(PODS_TARGET_SRCROOT)/FirebaseRemoteConfig/Tests/FakeUtils/Bridging-Header.h'
     }
-    fake_console.resources = 'FirebaseRemoteConfig/Tests/FakeUtils/GoogleService-Info.plist'
     fake_console.dependency 'OCMock'
   end
 end

+ 1 - 1
FirebaseRemoteConfig/Tests/FakeUtils/GoogleService-Info.plist

@@ -3,7 +3,7 @@
 <plist version="1.0">
 <dict>
 	<key>API_KEY</key>
-	<string>correct_api_key</string>
+	<string>A23456789012345678901234567890123456789</string>
 	<key>TRACKING_ID</key>
 	<string>correct_tracking_id</string>
 	<key>CLIENT_ID</key>

+ 2 - 2
FirebaseRemoteConfig/Tests/SwiftAPI/APITestBase.swift

@@ -40,12 +40,12 @@ class APITestBase: XCTestCase {
     settings.minimumFetchInterval = 0
     config.configSettings = settings
     if APITests.useFakeConfig {
-      fakeConsole = FakeConsole()
-      config.configFetch.fetchSession = URLSessionMock(with: fakeConsole)
       if !APITests.mockedFetch {
         APITests.mockedFetch = true
         config.configFetch = FetchMocks.mockFetch(config.configFetch)
       }
+      fakeConsole = FakeConsole()
+      config.configFetch.fetchSession = URLSessionMock(with: fakeConsole)
     }
 
     // Uncomment for verbose debug logging.

+ 18 - 0
scripts/build.sh

@@ -479,6 +479,18 @@ case "$product-$platform-$method" in
 
   RemoteConfig-*-fakeconsole)
     pod_gen FirebaseRemoteConfig.podspec --platforms="${gen_platform}"
+
+    # Add GoogleService-Info.plist to generated Test Wrapper App.
+    ruby ./scripts/update_xcode_target.rb gen/FirebaseRemoteConfig/Pods/Pods.xcodeproj \
+      AppHost-FirebaseRemoteConfig-Unit-Tests \
+      ../../../FirebaseRemoteConfig/Tests/FakeUtils/GoogleService-Info.plist
+
+
+    # Add AccessToken to generated Test Wrapper App.
+    ruby ./scripts/update_xcode_target.rb gen/FirebaseRemoteConfig/Pods/Pods.xcodeproj \
+      AppHost-FirebaseRemoteConfig-Unit-Tests \
+      ../../../FirebaseRemoteConfig/Tests/SwiftAPI/AccessToken.json
+
     RunXcodebuild \
       -workspace 'gen/FirebaseRemoteConfig/FirebaseRemoteConfig.xcworkspace' \
       -scheme "FirebaseRemoteConfig-Unit-fake-console-tests" \
@@ -489,6 +501,12 @@ case "$product-$platform-$method" in
 
   RemoteConfig-*-integration)
     pod_gen FirebaseRemoteConfig.podspec --platforms="${gen_platform}"
+
+    # Add GoogleService-Info.plist to generated Test Wrapper App.
+    ruby ./scripts/update_xcode_target.rb gen/FirebaseRemoteConfig/Pods/Pods.xcodeproj \
+      AppHost-FirebaseRemoteConfig-Unit-Tests \
+      ../../../FirebaseRemoteConfig/Tests/SwiftAPI/GoogleService-Info.plist
+
     RunXcodebuild \
       -workspace 'gen/FirebaseRemoteConfig/FirebaseRemoteConfig.xcworkspace' \
       -scheme "FirebaseRemoteConfig-Unit-swift-api-tests" \