@@ -17,27 +17,19 @@ import Foundation
1717import XCTest
1818
1919extension FirebaseApp {
20- static let projectIDEnvVar = " PROJECT_ID "
21- static let appIDEnvVar = " APP_ID "
22- static let apiKeyEnvVar = " API_KEY "
23-
20+ // These snippets are not invoked in CI but may be run manually by placing a
21+ // GoogleService-Info.plist in the the FirebaseVertexAI/Tests/Unit/Resources folder.
2422 static func configureForSnippets( ) throws {
25- let environment = ProcessInfo . processInfo. environment
26- guard let projectID = environment [ projectIDEnvVar] else {
27- throw XCTSkip ( " No Firebase Project ID specified in environment variable \( projectIDEnvVar) . " )
28- }
29- guard let appID = environment [ appIDEnvVar] else {
30- throw XCTSkip ( " No Google App ID specified in environment variable \( appIDEnvVar) . " )
31- }
32- guard let apiKey = environment [ apiKeyEnvVar] else {
33- throw XCTSkip ( " No API key specified in environment variable \( apiKeyEnvVar) . " )
23+ guard let plistPath = Bundle . module. path (
24+ forResource: " GoogleService-Info " ,
25+ ofType: " plist "
26+ ) else {
27+ throw XCTSkip ( " No GoogleService-Info.plist found in FirebaseVertexAI/Tests/Unit/Resources. " )
3428 }
3529
36- let options = FirebaseOptions ( googleAppID: appID, gcmSenderID: " " )
37- options. projectID = projectID
38- options. apiKey = apiKey
39-
30+ let options = try XCTUnwrap ( FirebaseOptions ( contentsOfFile: plistPath) )
4031 FirebaseApp . configure ( options: options)
32+
4133 guard FirebaseApp . isDefaultAppConfigured ( ) else {
4234 XCTFail ( " Default Firebase app not configured. " )
4335 return
0 commit comments