Skip to content

Conversation

@Eliassen-Steinar
Copy link
Contributor

BigQueryEmulator exposes two endpoints, for http and for gRPC, only the http was exposed by BigQueryEmulatorContainer.

The gRPC port needs to be exposed, as BigQueryWriteSettings needs this port to be configured correctly.

Included test case shows configuration setup and validates that it works as expected.

@Eliassen-Steinar Eliassen-Steinar requested a review from a team as a code owner September 9, 2025 17:15
@eddumelendez eddumelendez added this to the next milestone Sep 9, 2025
… that we can connect

a BigQueryWriteClient to the table.
Comment on lines 38 to 47
private BigQuery getBigQuery(BigQueryEmulatorContainer container) {
String url = container.getEmulatorHttpEndpoint();
return BigQueryOptions
.newBuilder()
.setProjectId(container.getProjectId())
.setHost(url)
.setLocation(url)
.setCredentials(NoCredentials.getInstance())
.build().getService();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this method to the end of the file

}

@Test
void testGrcpEndpoint() throws IOException {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please add an assertion to this test method?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Eliassen-Steinar can you add an assertion?

@eddumelendez eddumelendez changed the title Expose gRPC endpoint from BigQueryEmulator. Expose gRPC endpoint from BigQueryEmulator Sep 24, 2025
@eddumelendez eddumelendez merged commit 7209ff6 into testcontainers:main Sep 24, 2025
104 checks passed
@eddumelendez
Copy link
Member

Thanks for your contribution, @Eliassen-Steinar !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants