Skip to content

chore(jdbc): standalone jar to run driver-agnostic tests#4132

Draft
logachev wants to merge 11 commits intomainfrom
kirl/driver_agnostic_test
Draft

chore(jdbc): standalone jar to run driver-agnostic tests#4132
logachev wants to merge 11 commits intomainfrom
kirl/driver_agnostic_test

Conversation

@logachev
Copy link
Contributor

@logachev logachev commented Mar 6, 2026

Separate driver-independent tests in its own module so we can run tests continuous with released versions with too much of a code-duplication.

This PR is more of a POC to setup the pipeline, we can organize tests later (proxy/nightly etc tests)

@product-auto-label product-auto-label bot added size: xl Pull request size is extra large. api: bigquery Issues related to the googleapis/java-bigquery API. labels Mar 6, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request establishes the foundational infrastructure for running driver-independent tests in a standalone manner. By separating these tests into their own Maven module and providing build and run commands, it enables continuous testing against released driver versions, reducing code duplication and streamlining the testing pipeline. This initial setup serves as a proof-of-concept for future test organization.

Highlights

  • New Maven Module for Driver-Agnostic Tests: A new Maven module, google-cloud-bigquery-jdbc-it, was introduced to encapsulate driver-independent integration tests, allowing them to be run separately.
  • Standalone Test JAR Assembly: A Maven assembly descriptor (test-assembly.xml) was added to configure the creation of a standalone JAR containing all necessary integration tests and their dependencies.
  • Makefile Integration for Test Execution: New Makefile targets (build-standalone-tests and run-standalone-tests) were added to streamline the process of building the standalone test JAR and executing the driver-agnostic tests.
Changelog
  • google-cloud-bigquery-jdbc/Makefile
    • Added build-standalone-tests target to compile the new integration test module.
    • Added run-standalone-tests target to execute the standalone integration tests against a specified driver JAR.
  • google-cloud-bigquery-jdbc/pom-it.xml
    • Created a new Maven Project Object Model (POM) file for the google-cloud-bigquery-jdbc-it module.
    • Configured dependencies required for integration tests, including JUnit, Truth, and Mockito.
    • Included the maven-assembly-plugin to build a standalone test JAR.
  • google-cloud-bigquery-jdbc/src/assembly/test-assembly.xml
    • Defined an assembly descriptor for the maven-assembly-plugin.
    • Specified the creation of a standalone JAR containing test-scoped dependencies, excluding the main JDBC driver JAR and META-INF signature files.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

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

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 introduces a new module and Makefile targets to create a standalone JAR for running driver-agnostic tests. This is a good step towards improving the testing pipeline. My review focuses on improving maintainability by removing hardcoded versions and cleaning up the new Maven POM file (pom-it.xml). I've identified several areas where versions are hardcoded, which could lead to issues down the line. I've also found a redundant dependency and inconsistencies in the POM's parent configuration.

Comment on lines +4 to +9
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigquery-parent</artifactId>
<version>2.60.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The parent POM configuration has a couple of issues:

  1. The version 2.60.0 is different from the parent version in the main google-cloud-bigquery-jdbc/pom.xml (2.60.1-SNAPSHOT). These should be consistent to ensure dependencies are managed correctly.
  2. The relativePath is set to ../pom.xml. The main module's POM resolves its parent from a remote repository. This inconsistency in parent resolution can cause unexpected build behavior.

It's recommended to align the parent configuration with the main pom.xml by using the same version and removing the relativePath.

    <parent>
        <groupId>com.google.cloud</groupId>
        <artifactId>google-cloud-bigquery-parent</artifactId>
        <version>2.60.1-SNAPSHOT</version>
    </parent>


<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigquery-jdbc-it</artifactId>
<version>0.4.0</version>
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The version 0.4.0 is hardcoded and inconsistent with the main module's version (0.4.1-SNAPSHOT). To ensure consistency and ease maintenance, this module should have the same version as the google-cloud-bigquery-jdbc module.

    <version>0.4.1-SNAPSHOT</version>

Comment on lines +24 to +36
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigquery-jdbc</artifactId>
<version>0.4.0</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigquery-jdbc</artifactId>
<version>0.4.0</version>
<scope>test</scope>
</dependency>
Copy link
Contributor

Choose a reason for hiding this comment

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

high

There are a couple of issues with these dependencies:

  1. The dependency on google-cloud-bigquery-jdbc (lines 31-36) is redundant. The test-jar dependency is sufficient for packaging the test classes, and the main JAR is correctly excluded in test-assembly.xml.
  2. The version 0.4.0 is hardcoded. This should use ${project.version} to ensure the test classes from the currently built artifact are used.
        <dependency>
            <groupId>com.google.cloud</groupId>
            <artifactId>google-cloud-bigquery-jdbc</artifactId>
            <version>${project.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>

Comment on lines +133 to +134
DRIVER_JAR ?= target/google-cloud-bigquery-jdbc-0.4.0.jar
STANDALONE_JAR = target-it/google-cloud-bigquery-jdbc-it-0.4.0-standalone.jar
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The versions for DRIVER_JAR and STANDALONE_JAR are hardcoded. This will require manual updates whenever the project version changes, making it brittle. It would be more robust to determine these versions dynamically from the pom.xml files. You can use mvn help:evaluate for this, similar to how BUILD_DIR is determined elsewhere in this file.

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

Labels

api: bigquery Issues related to the googleapis/java-bigquery API. size: xl Pull request size is extra large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant