Skip to content

test(gax-grpc): run the full unit test suite in CI - #14573

Open
macastelaz wants to merge 3 commits into
googleapis:mainfrom
macastelaz:fix-gax-grpc-surefire-tests
Open

macastelaz wants to merge 3 commits into
googleapis:mainfrom
macastelaz:fix-gax-grpc-surefire-tests

Conversation

@macastelaz

Copy link
Copy Markdown
Contributor

Fixes #14572.

The Surefire <test> value in gax-grpc ended with an entry without a !. Surefire treats that as an inclusion pattern, so only InstantiatingGrpcChannelProviderTest#testLogDirectPathMisconfigWrongCredential ran in CI.

  • gax-grpc/pom.xml: drop the stray inclusion and keep both existing exclusions.
  • InstantiatingGrpcChannelProviderTest#testLogDirectPathMisconfigWrongCredential: set .setEnvProvider(name -> null), so the test no longer depends on the machine's GOOGLE_CLOUD_DISABLE_DIRECT_PATH. With it set to true, the test fails because the provider takes the "DirectPath disabled" branch. It passed on GitHub runners only because the variable isn't set there.

Testing: mvn test -pl gax-grpc now runs 209 tests, all passing, locally on JDK 21. Before, it ran 1.

The Surefire <test> value in gax-grpc ended with an entry without a "!",
which Surefire treats as an inclusion pattern, so only
InstantiatingGrpcChannelProviderTest#testLogDirectPathMisconfigWrongCredential
ran. Drop the stray inclusion and keep both existing exclusions.

Also make testLogDirectPathMisconfigWrongCredential independent of the
machine's GOOGLE_CLOUD_DISABLE_DIRECT_PATH by setting an empty env provider.

Fixes googleapis#14572
@macastelaz
macastelaz requested a review from a team as a code owner October 2, 2026 04:18

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

Copy link
Copy Markdown
Contributor

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 enables the testLogDirectPathMisconfigWrongCredential test to run by default in the Maven Surefire plugin configuration. To support this, the test setup in InstantiatingGrpcChannelProviderTest.java has been updated to mock the environment provider with .setEnvProvider(name -> null), removing its dependency on external environment variables. There are no review comments, so no additional feedback is provided.

Mockito can't subclass @NullMarked classes on JDK 8 because JSpecify's
@target includes ElementType.MODULE. The spy was never verified, so use a
plain instance. This test was previously skipped by the surefire config.
@macastelaz
macastelaz requested a review from lqiu96 October 2, 2026 14:15

This branch has not been deployed

No deployments
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.

gax-grpc: Surefire <test> pattern restricts the unit test run to a single test

2 participants