Skip to content

[Firebase AI] Fix integration tests and re-enable Dev API configs #14792

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,11 @@ struct GenerateContentIntegrationTests {
}

@Test(arguments: [
InstanceConfig.vertexV1Beta,
// TODO(andrewheard): Configs temporarily disabled due to backend issue.
// InstanceConfig.developerV1Beta,
// InstanceConfig.developerV1BetaStaging
// TODO(andrewheard): Vertex AI configs temporarily disabled to due empty SafetyRatings bug.
// InstanceConfig.vertexV1,
// InstanceConfig.vertexV1Beta,
InstanceConfig.developerV1Beta,
InstanceConfig.developerV1BetaStaging,
InstanceConfig.developerV1BetaSpark,
])
func generateImage(_ config: InstanceConfig) async throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,12 @@ final class IntegrationTests: XCTestCase {
ModelContent(role: "function", parts: sumResponse),
])

XCTAssertEqual(response.totalTokens, 24)
XCTAssertGreaterThan(response.totalTokens, 0)
XCTAssertEqual(response.totalBillableCharacters, 71)
XCTAssertEqual(response.promptTokensDetails.count, 1)
let promptTokensDetails = try XCTUnwrap(response.promptTokensDetails.first)
XCTAssertEqual(promptTokensDetails.modality, .text)
XCTAssertEqual(promptTokensDetails.tokenCount, 24)
XCTAssertEqual(promptTokensDetails.tokenCount, response.totalTokens)
}

func testCountTokens_appCheckNotConfigured_shouldFail() async throws {
Expand Down
10 changes: 4 additions & 6 deletions FirebaseAI/Tests/TestApp/Tests/Utilities/InstanceConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ struct InstanceConfig {
vertexV1Staging,
vertexV1Beta,
vertexV1BetaStaging,
// TODO(andrewheard): Configs temporarily disabled due to backend issue:
// developerV1Beta,
// developerV1BetaStaging,
developerV1Beta,
developerV1BetaStaging,
developerV1Spark,
developerV1BetaSpark,
]
Expand All @@ -63,9 +62,8 @@ struct InstanceConfig {
vertexV1Staging,
vertexV1Beta,
vertexV1BetaStaging,
// TODO(andrewheard): Configs temporarily disabled due to backend issue:
// developerV1Beta,
// developerV1BetaStaging,
developerV1Beta,
developerV1BetaStaging,
developerV1BetaSpark,
]

Expand Down
Loading