File tree Expand file tree Collapse file tree 3 files changed +27
-16
lines changed
FirebaseVertexAI/Tests/TestApp/Tests/Integration Expand file tree Collapse file tree 3 files changed +27
-16
lines changed Original file line number Diff line number Diff line change @@ -43,12 +43,15 @@ struct GenerateContentIntegrationTests {
4343 let userID1 : String
4444
4545 init ( ) async throws {
46- let authResult = try await Auth . auth ( ) . signIn (
47- withEmail: Credentials . emailAddress1,
48- password: Credentials . emailPassword1
49- )
50- userID1 = authResult. user. uid
51-
46+ if let user = Auth . auth ( ) . currentUser {
47+ userID1 = user. uid
48+ } else {
49+ let authResult = try await Auth . auth ( ) . signIn (
50+ withEmail: Credentials . emailAddress1,
51+ password: Credentials . emailPassword1
52+ )
53+ userID1 = authResult. user. uid
54+ }
5255 storage = Storage . storage ( )
5356 }
5457
Original file line number Diff line number Diff line change @@ -39,11 +39,15 @@ struct ImagenIntegrationTests {
3939 var userID1 : String
4040
4141 init ( ) async throws {
42- let authResult = try await Auth . auth ( ) . signIn (
43- withEmail: Credentials . emailAddress1,
44- password: Credentials . emailPassword1
45- )
46- userID1 = authResult. user. uid
42+ if let user = Auth . auth ( ) . currentUser {
43+ userID1 = user. uid
44+ } else {
45+ let authResult = try await Auth . auth ( ) . signIn (
46+ withEmail: Credentials . emailAddress1,
47+ password: Credentials . emailPassword1
48+ )
49+ userID1 = authResult. user. uid
50+ }
4751
4852 vertex = VertexAI . vertexAI ( )
4953 storage = Storage . storage ( )
Original file line number Diff line number Diff line change @@ -48,11 +48,15 @@ final class IntegrationTests: XCTestCase {
4848 var userID1 = " "
4949
5050 override func setUp( ) async throws {
51- let authResult = try await Auth . auth ( ) . signIn (
52- withEmail: Credentials . emailAddress1,
53- password: Credentials . emailPassword1
54- )
55- userID1 = authResult. user. uid
51+ if let user = Auth . auth ( ) . currentUser {
52+ userID1 = user. uid
53+ } else {
54+ let authResult = try await Auth . auth ( ) . signIn (
55+ withEmail: Credentials . emailAddress1,
56+ password: Credentials . emailPassword1
57+ )
58+ userID1 = authResult. user. uid
59+ }
5660
5761 vertex = VertexAI . vertexAI ( )
5862 model = vertex. generativeModel (
You can’t perform that action at this time.
0 commit comments