This repository was archived by the owner on Apr 7, 2026. It is now read-only.
fix(java): exclude tests that use Mockito from native image testing#1753
Closed
fix(java): exclude tests that use Mockito from native image testing#1753
Conversation
meltsufin
approved these changes
Mar 17, 2022
Contributor
Author
|
Hi @ansh0l could we get a review on this PR? |
ansh0l
approved these changes
Mar 25, 2022
Contributor
ansh0l
left a comment
There was a problem hiding this comment.
LGTM. @mpeddada1 Please wait on merging this one, I think we should batch all PRs for native image testing to have a single release. We're planning a release for cross region backups in next few days.
Contributor
|
@mpeddada1 : I've added a do not merge label - feel free to remove and merge with other PRs when they are ready. |
Contributor
|
Closing since native image changes have been released with #1878 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mockito dynamically loads classes at run-time and is currently incompatible with native image testing. Therefore, tests that use Mockito are resulting in the following error when they are executed with native image testing:
DdlClientTest:
SessionClientTest:
Some background on how native image tests are opted in: The logic to opt libraries into native image testing lives in java-shared-config (see https://github.com/googleapis/java-shared-config/blob/1015b908c5aaa6f0b6c77759d86557ca26504868/pom.xml#L811) Currently tests with the IT* and *ClientTest pattern are opted in. The reason for this is to include integration tests in all libraries and unit tests in only generated libraries for native image testing (see this logic for the naming pattern the Gapic generator uses to generate unit tests).
This PR excludes
SessionClientTestandDdlClientTestfrom native image testing by renaming them toSessionClientTestsandDdlClientTests.cc @ansh0l @meltsufin