GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(java): include integration tests for native image testing by mpeddada1 · Pull Request #720 · googleapis/java-spanner-jdbc

This repository was archived by the owner on Sep 30, 2026. It is now read-only.

Conversation

@mpeddada1

@mpeddada1 mpeddada1 commented Jan 13, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Some background:
We want to run integration tests and unit tests (ending in *ClientTest) with the native profile. For this purpose, we want to ignore any exclusions that take place in other maven-surefire-plugin configurations within the java-shared-config pom or other child poms so that we can explicitly include these tests. However, using excludedGroups in java-spanner-jdbc causes the overriding of the exclusion to be ignored. This results in integration tests being skipped in native mode which leads to native-image testing to fail with the message: Test configuration file wasn't found. Make sure that test execution wasn't skipped.

This change replaces the use of excludedGroups with exclude, which allows the the maven-surefire-plugin configuration for the native profile to take precedence when mvn test -P native is called. Manual testing with mvn test results in only unit tests being run, therefore showing no change in current behavior for standard Java.

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #719 ☕️

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mpeddada1
mpeddada1 requested review from a team January 13, 2022 23:11
@product-auto-label product-auto-label Bot added the api: spanner Issues related to the googleapis/java-spanner-jdbc API. label Jan 13, 2022
@mpeddada1
fix(java): replace excludedGroup with exclude
f2548f8
@mpeddada1
mpeddada1 force-pushed the native-run-it branch from 7fe2b0e to f2548f8 Compare January 13, 2022 23:18
@mpeddada1
mpeddada1 requested review from dzou, meltsufin and suztomo January 13, 2022 23:20
suztomo
suztomo reviewed Jan 18, 2022
View reviewed changes
Comment thread pom.xml
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludedGroups>com.google.cloud.spanner.IntegrationTest</excludedGroups>
<exclude>com.google.cloud.spanner.IntegrationTest</exclude>

@suztomo suztomo Jan 18, 2022

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#excludedGroups

(TestNG/JUnit47 provider with JUnit4.8+ only and JUnit5+ provider since 2.22.0) Excluded groups/categories/tags. Any methods/classes/etc with one of the groups/categories/tags specified in this list will specifically not be run.

Was that wrong usage of excludedGroups before this PR?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mpeddada1 mpeddada1 Jan 18, 2022

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, we want to run integration tests and unit tests (ending in *ClientTest) with the native profile. For this purpose, we tend to ignore any exclusions that take place in other maven-surefire-plugin configurations within the java-shared-config pom or other child poms: https://github.com/googleapis/java-shared-config/blob/ac44ba11d2da2f649670867c520f90253a8a41ff/pom.xml#L807, so that we can explicitly include these tests. However, with the use of excludedGroups in java-spanner-jdbc, this overriding of the exclusions gets ignored, therefore causing no integration tests to run in native mode. Changing this to exclude fixes this issue.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@suztomo suztomo Jan 18, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was that wrong usage of excludedGroups before this PR?

it seems correct usage to skip the integration test marked with @Category(ParallelIntegrationTest.class) in this repository.

Screen Shot 2022-01-18 at 2 47 28 PM

@mpeddada1 With this change in this PR, does mvn test skip the tests marked with @Category(ParallelIntegrationTest.class), such as ITJdbcSimpleStatementsTest and ITJdbcReadOnlyTest?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@mpeddada1 mpeddada1 Jan 18, 2022

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. Just ran mvn test with this change and can confirm that tests annotated with @Category(ParallelIntegrationTest.class) are skipped. Only unit tests are executed.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@suztomo suztomo Jan 19, 2022

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for confirmation.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Neenu1995
Neenu1995 approved these changes Jan 18, 2022
View reviewed changes
suztomo
suztomo approved these changes Jan 19, 2022
View reviewed changes
@mpeddada1

mpeddada1 commented Jan 19, 2022

Copy link
Copy Markdown
Contributor Author

Thank you for the review @Neenu1995 and @suztomo!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mpeddada1
mpeddada1 merged commit 7f13c88 into main Jan 19, 2022
@mpeddada1
mpeddada1 deleted the native-run-it branch January 19, 2022 18:00
@release-please release-please Bot mentioned this pull request Jan 19, 2022
chore(main): release 2.5.9 #721
Merged
gcf-merge-on-green Bot pushed a commit that referenced this pull request Feb 3, 2022
@release-please
chore(main): release 2.5.9 (#721)
7fa8f3b
🤖 I have created a release *beep* *boop*
---


### [2.5.9](v2.5.8...v2.5.9) (2022-02-03)


### Bug Fixes

* **java:** replace excludedGroup with exclude ([#720](#720)) ([7f13c88](7f13c88))


### Dependencies

* **java:** update actions/github-script action to v5 ([#1339](#1339)) ([#725](#725)) ([4f96ec1](4f96ec1))
* update actions/github-script action to v5 ([#724](#724)) ([5c1d6ff](5c1d6ff))
* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.7.0 ([#728](#728)) ([b0a32d8](b0a32d8))
* update opencensus.version to v0.31.0 ([#727](#727)) ([fce0770](fce0770))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
suztomo pushed a commit to suztomo/google-cloud-java that referenced this pull request Mar 23, 2026
@release-please
chore(main): release 2.5.9 (googleapis#721)
7dfbd4e
🤖 I have created a release *beep* *boop*
---


### [2.5.9](googleapis/java-spanner-jdbc@v2.5.8...v2.5.9) (2022-02-03)


### Bug Fixes

* **java:** replace excludedGroup with exclude ([googleapis#720](googleapis/java-spanner-jdbc#720)) ([02e4731](googleapis/java-spanner-jdbc@02e4731))


### Dependencies

* **java:** update actions/github-script action to v5 ([googleapis#1339](googleapis/java-spanner-jdbc#1339)) ([googleapis#725](googleapis/java-spanner-jdbc#725)) ([e4f4a6e](googleapis/java-spanner-jdbc@e4f4a6e))
* update actions/github-script action to v5 ([googleapis#724](googleapis/java-spanner-jdbc#724)) ([14c11a8](googleapis/java-spanner-jdbc@14c11a8))
* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.7.0 ([googleapis#728](googleapis/java-spanner-jdbc#728)) ([d3611b1](googleapis/java-spanner-jdbc@d3611b1))
* update opencensus.version to v0.31.0 ([googleapis#727](googleapis/java-spanner-jdbc#727)) ([727ac41](googleapis/java-spanner-jdbc@727ac41))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@meltsufin meltsufin Awaiting requested review from meltsufin
@dzou dzou Awaiting requested review from dzou
2 more reviewers
@suztomo suztomo suztomo approved these changes
@Neenu1995 Neenu1995 Neenu1995 approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

api: spanner Issues related to the googleapis/java-spanner-jdbc API.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Integration tests not running for native image testing

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@mpeddada1 @suztomo @Neenu1995
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.