Skip to content

fix(storage): skip unit tests under native profile in gapic-google-cloud-storage-v2#13235

Draft
nidhiii-27 wants to merge 2 commits into
mainfrom
native-test-failure
Draft

fix(storage): skip unit tests under native profile in gapic-google-cloud-storage-v2#13235
nidhiii-27 wants to merge 2 commits into
mainfrom
native-test-failure

Conversation

@nidhiii-27
Copy link
Copy Markdown
Contributor

When building the java-storage folder or running GCS native presubmit checks in CI, the build fails with the following error:

[ERROR] There was an error in the forked process
[ERROR] TestEngine with ID 'junit-vintage' failed to discover tests
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
[ERROR] TestEngine with ID 'junit-vintage' failed to discover tests
  1. The global parent profile native (defined in google-cloud-shared-config) triggers maven-surefire-plugin to perform test discovery on the JVM using the modern JUnit 5 Platform Launcher (JUnitPlatformProvider).
  2. The generated unit tests in gapic-google-cloud-storage-v2 (such as StorageClientTest.java) are standard JUnit 4 tests.
  3. For the JUnit 5 test launcher to discover and execute JUnit 4 tests, it requires junit-vintage-engine on the classpath. Since gapic-google-cloud-storage-v2 does not have this configured, the launcher throws a discovery crash.
  4. While some handwritten client modules have custom canary tests configured, the GCS generated GAPIC module lacked a local native profile to skip native test compilation.

Added a local native profile to gapic-google-cloud-storage-v2/pom.xml to skip unit tests when compiling and running under native profiles.
The generated classes in gapic-google-cloud-storage-v2 are already fully tested natively under the main google-cloud-storage module. The main module compiles and runs a comprehensive gRPC native image canary test (com.google.cloud.storage.it.StorageNativeCanary), which directly exercises and validates the generated GAPIC client pathways at runtime.

Copy link
Copy Markdown
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 adds a 'native' profile to the pom.xml file for the gapic-google-cloud-storage-v2 module. This profile is configured to skip tests, with a note indicating that native testing for this specific module is handled within the google-cloud-storage module. I have no feedback to provide as there were no review comments.

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.

1 participant