Skip to content

fix(storage): add junit-vintage-engine to support native test discovery#13235

Open
nidhiii-27 wants to merge 5 commits into
mainfrom
native-test-failure
Open

fix(storage): add junit-vintage-engine to support native test discovery#13235
nidhiii-27 wants to merge 5 commits into
mainfrom
native-test-failure

Conversation

@nidhiii-27
Copy link
Copy Markdown
Contributor

@nidhiii-27 nidhiii-27 commented May 20, 2026

When running native presubmit checks or building with the native profile, the builds for gapic-google-cloud-storage-v2 and google-cloud-storage-control fail with a SurefireBooterForkException. The specific error indicates that the TestEngine with ID junit-vintage failed to discover tests.

[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

This failure occurs because:

  • The global native profile triggers the maven-surefire-plugin to perform test discovery using the modern JUnit 5 Platform Launcher
  • The unit tests in these modules (e.g., StorageClientTest.java) are standard JUnit 4 tests
  • The JUnit 5 launcher requires the junit-vintage-engine on the classpath to discover and execute these JUnit 4 tests

This PR fixes the discovery crash:

  • Adds the junit-vintage-engine as a test-scope dependency in both gapic-google-cloud-storage-v2/pom.xml and google-cloud-storage-control/pom.xml
  • Configures the maven-surefire-plugin within a local native profile to explicitly include the junit-vintage-engine dependency.

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.

@nidhiii-27 nidhiii-27 marked this pull request as ready for review May 21, 2026 09:16
@nidhiii-27 nidhiii-27 requested review from a team as code owners May 21, 2026 09:16
@nidhiii-27 nidhiii-27 changed the title fix(storage): skip unit tests under native profile in gapic-google-cloud-storage-v2 fix(storage): add junit-vintage-engine to support native test discovery May 21, 2026
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