| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Summary of ChangesHello @AbgarSim, 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 undertakes a significant modernization effort by migrating the project's testing infrastructure from JUnit 4 to JUnit 5. This transition not only updates the core testing framework but also introduces parallel test execution, aiming to drastically improve the speed and efficiency of the test suite. The changes span across dependency management, test class annotations, and assertion method usage, ensuring full compatibility with the latest JUnit platform features. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe 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.
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
|
Sorry, something went wrong.
There was a problem hiding this comment.
This pull request does a great job migrating the project to JUnit 5 and enabling parallel test execution. The changes in pom.xml and the introduction of junit-platform.properties are correct.
However, the migration of the test source code is incomplete. Many test files still use assertions from JUnit 4 (org.junit.Assert), which can lead to a mixed test dependency setup. For a clean migration, it's best to consistently use JUnit 5's assertions from org.junit.jupiter.api.Assertions.
I've left a few specific comments to highlight this issue. A global search-and-replace for org.junit.Assert imports should help clean this up across the codebase.
Sorry, something went wrong.
| <version>4.13.2</version> | ||
| <groupId>org.junit.jupiter</groupId> | ||
| <artifactId>junit-jupiter</artifactId> | ||
| <version>5.11.4</version> |
There was a problem hiding this comment.
Our SDK actually manages a set of common dependencies upstream here: https://github.com/googleapis/sdk-platform-java/blob/b68791d074c02e02a5ccf2f937a5922749a14f56/gapic-generator-java-pom-parent/pom.xml#L40 (a bit of a convoluted process to get here).
You should be able to reference the ${junit.version} there so it's centrally managed.
Sorry, something went wrong.
There was a problem hiding this comment.
So I'm not quite sure how this repo is linked to gapic-generator-java-pom-parent and just using ${junit.version} fails locally.
However, following the trail of parents of this repo i was able to reach native-image-shared-config pom which has <junit-vintage-engine.version>5.11.4</junit-vintage-engine.version>
I used this placeholder instead, please advice if this is acceptable or how to reach ${junit.version}
Sorry, something went wrong.
|
Thanks again @AbgarSim, really appreciate the work going into migrating to JUnit 5! The tests generally look good. I added a few comments mostly about dependencies. For the the wildcard imports (import static org.junit.jupiter.api.Assertions.*;, can you break them down into the individual imports that are used? Additionally, we have the dependencies check reporting: Error: Used undeclared dependencies found: Error: org.junit.jupiter:junit-jupiter-api:jar:5.11.4:test Error: junit:junit:jar:4.13.2:test Error: Unused declared dependencies found: Error: org.junit.jupiter:junit-jupiter:jar:5.11.4:test |
Sorry, something went wrong.
|
Hi @lqiu96 thanks for the feedback! I've pushed the following adjustments:
|
Sorry, something went wrong.
Ah, I think I may have misremembered. I think you're right since the parent pom is shared-configs not shared-deps. In that case, I don't think you'll be able to use the property. I do see that junit v5 is already managed via shared-deps (we bring that in already). In that case, can you try and remove junit-jupiter from the BQ's parent-pom as it can be managed via shared-deps? Also, I see that we have two mockito deps. Can we try and use a mockito Bom in the parent pom? Perhaps see if we can use v5.21.0? I think this would different from the version in shared-deps so we can try and manage the version locally for now. I think those two should work and the rest LGTM. Besides that, thank you for all your work! :) I'll just ask that we wait until my colleague comes back next week to give this a second pair of eyes before merging. |
Sorry, something went wrong.
|
@lqiu96 Thanks again for the review and happy to help!
Done
Removed mockito deps and added mockito Bom v5.21.0 |
Sorry, something went wrong.
|
Thanks, I took a look at the CI and I think there are a few minor things
Error: Unused declared dependencies found: Error: org.junit.jupiter:junit-jupiter-engine:jar:5.11.4:test Is it possible to remove junit-jupiter-engine from the pom? I think that should satisfy the CI (it may also be a false flag)
Changes LGTM. I'll approve after these which I think should fix everything. Thanks again! |
Sorry, something went wrong.
This is done
|
Sorry, something went wrong.
|
/gcbrun |
Sorry, something went wrong.
|
Looks like Graalvm is complaining: [INFO] ------------------------------------------------------- [INFO] T E S T S [INFO] ------------------------------------------------------- [INFO] [INFO] Results: [INFO] [INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0 [INFO] [INFO] [INFO] --- native:0.10.6:test (test-native) @ google-cloud-bigquery --- [ERROR] Test configuration file wasn't found. Make sure that test execution wasn't skipped. Not sure why. Taking a look... |
Sorry, something went wrong.
Looking online it says that junit-jupiter-engine is required to run these tests. Though the dependencies check seems to complain that it's unused. |
Sorry, something went wrong.
|
Ok, I don't think we can get around this complaint from dependencies check. I'll look about trying to disable (or remove) the failOnWarning check so that this can get merged in. I think we will need junit-jupiter-engine to run the tests. Looking at the CI for the non-graalvm tests, I see this in the logs: [INFO] --- surefire:3.5.2:test (default-test) @ google-cloud-bigquery --- [INFO] Tests are skipped. |
Sorry, something went wrong.
|
@AbgarSim Apologies for the additional reverting work 😆. It seems like we will need the junit-jupiter-engine dep for the tests the run. Would you be able to add it back in and pull the latest changes (I also added in configs to ignore the failed dependencies checks earlier). |
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes googleapis/google-cloud-java#12142 ☕️
Before Optimisitation

After Optimisation

If you write sample code, please follow the samples format.