Skip to content

Commit 24e9c93

Browse files
authored
[Firebase AI] Fix integration tests and re-enable Dev API configs (#14792)
1 parent 04e3bfc commit 24e9c93

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

FirebaseAI/Tests/TestApp/Tests/Integration/GenerateContentIntegrationTests.swift

+5-4
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,11 @@ struct GenerateContentIntegrationTests {
115115
}
116116

117117
@Test(arguments: [
118-
InstanceConfig.vertexV1Beta,
119-
// TODO(andrewheard): Configs temporarily disabled due to backend issue.
120-
// InstanceConfig.developerV1Beta,
121-
// InstanceConfig.developerV1BetaStaging
118+
// TODO(andrewheard): Vertex AI configs temporarily disabled to due empty SafetyRatings bug.
119+
// InstanceConfig.vertexV1,
120+
// InstanceConfig.vertexV1Beta,
121+
InstanceConfig.developerV1Beta,
122+
InstanceConfig.developerV1BetaStaging,
122123
InstanceConfig.developerV1BetaSpark,
123124
])
124125
func generateImage(_ config: InstanceConfig) async throws {

FirebaseAI/Tests/TestApp/Tests/Integration/IntegrationTests.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,12 @@ final class IntegrationTests: XCTestCase {
190190
ModelContent(role: "function", parts: sumResponse),
191191
])
192192

193-
XCTAssertEqual(response.totalTokens, 24)
193+
XCTAssertGreaterThan(response.totalTokens, 0)
194194
XCTAssertEqual(response.totalBillableCharacters, 71)
195195
XCTAssertEqual(response.promptTokensDetails.count, 1)
196196
let promptTokensDetails = try XCTUnwrap(response.promptTokensDetails.first)
197197
XCTAssertEqual(promptTokensDetails.modality, .text)
198-
XCTAssertEqual(promptTokensDetails.tokenCount, 24)
198+
XCTAssertEqual(promptTokensDetails.tokenCount, response.totalTokens)
199199
}
200200

201201
func testCountTokens_appCheckNotConfigured_shouldFail() async throws {

FirebaseAI/Tests/TestApp/Tests/Utilities/InstanceConfig.swift

+4-6
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,8 @@ struct InstanceConfig {
5151
vertexV1Staging,
5252
vertexV1Beta,
5353
vertexV1BetaStaging,
54-
// TODO(andrewheard): Configs temporarily disabled due to backend issue:
55-
// developerV1Beta,
56-
// developerV1BetaStaging,
54+
developerV1Beta,
55+
developerV1BetaStaging,
5756
developerV1Spark,
5857
developerV1BetaSpark,
5958
]
@@ -63,9 +62,8 @@ struct InstanceConfig {
6362
vertexV1Staging,
6463
vertexV1Beta,
6564
vertexV1BetaStaging,
66-
// TODO(andrewheard): Configs temporarily disabled due to backend issue:
67-
// developerV1Beta,
68-
// developerV1BetaStaging,
65+
developerV1Beta,
66+
developerV1BetaStaging,
6967
developerV1BetaSpark,
7068
]
7169

0 commit comments

Comments
 (0)