Skip to content

chore(bigquery-jdbc): enable proxy tests#13617

Merged
logachev merged 6 commits into
mainfrom
kirl/proxy_tests
Jul 1, 2026
Merged

chore(bigquery-jdbc): enable proxy tests#13617
logachev merged 6 commits into
mainfrom
kirl/proxy_tests

Conversation

@logachev

@logachev logachev commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Replace all places where BigQuery client is instantiated with the one instantiated via the Driver. It allows to use the same connection properties and run tests in various environments without too much of duplication for default location, endpoint overrides, proxy, TPC etc.

I ran make docker-proxy-integration-test for Presubmit tests and all of them passed (except for KMS which I don't have local config for).

In the next PR I plan adding proxy tests runs to nightly tests & working on EU-location tests next.

@logachev
logachev requested review from a team as code owners July 1, 2026 06:29

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the integration tests to reuse a shared BigQuery client instance initialized from the JDBC connection, eliminating redundant instantiations of the BigQuery service across multiple test classes. Additionally, ITDriverTest is updated to extend ITBase to leverage shared connection configurations. Feedback is provided regarding a potential issue in ITStatementTest.java where a double semicolon is introduced in the connection URL string concatenation.

…c/it/ITStatementTest.java

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Connection connectionUS =
DriverManager.getConnection(
String.format(CONNECTION_URL, DEFAULT_CATALOG, OAUTH_TYPE, "us-east5"));
Connection connectionUS = DriverManager.getConnection(CONNECTION_URL);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: use try-with resource

Comment on lines +49 to +57
protected static BigQuery getBigQuery(String connectionUrl) {
try {
return DriverManager.getConnection(connectionUrl)
.unwrap(BigQueryConnection.class)
.getBigQuery();
} catch (SQLException e) {
throw new RuntimeException("Failed to initialize BigQuery client", e);
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Doubt: So here we are unwrapping the BigQuery client from the connection directly. Since we don't save a reference to the Connection itself, how will it get closed later in the tests? I'm just thinking about potential resource leaks or background threads staying open

@logachev
logachev merged commit affd9cc into main Jul 1, 2026
208 of 209 checks passed
@logachev
logachev deleted the kirl/proxy_tests branch July 1, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants