Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(java): include integration tests for native image testing #720

Merged
merged 1 commit into from Jan 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -221,7 +221,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludedGroups>com.google.cloud.spanner.IntegrationTest</excludedGroups>
<exclude>com.google.cloud.spanner.IntegrationTest</exclude>
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

@suztomo suztomo Jan 18, 2022

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?

Copy link
Contributor Author

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.

Copy link
Member

Choose a reason for hiding this comment

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

Thank you for confirmation.

<reportNameSuffix>sponge_log</reportNameSuffix>
</configuration>
</plugin>
Expand Down