Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

test: simplifying Java 8 test via jvm property#2440

Merged
suztomo merged 9 commits intogoogleapis:mainfrom
suztomo:java8_build
May 19, 2023
Merged

test: simplifying Java 8 test via jvm property#2440
suztomo merged 9 commits intogoogleapis:mainfrom
suztomo:java8_build

Conversation

@suztomo
Copy link
Copy Markdown
Member

@suztomo suztomo commented May 18, 2023

I found we can simplify the Java 8 test via surefire's jvm property (document: https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jvm)

Changing the required checks to use "dependencies (17)" only. There's no point running the dependencies checks for different JDK versions.

Once approved, I will change the required checks in repository settings to merge this pull request.

@product-auto-label product-auto-label Bot added the size: m Pull request size is medium. label May 18, 2023
@generated-files-bot
Copy link
Copy Markdown

generated-files-bot Bot commented May 18, 2023

Warning: This pull request is touching the following templated files:

  • .github/workflows/ci.yaml

@product-auto-label product-auto-label Bot added the api: spanner Issues related to the googleapis/java-spanner API. label May 18, 2023
@suztomo suztomo added the owlbot:run Add this label to trigger the Owlbot post processor. label May 18, 2023
@gcf-owl-bot gcf-owl-bot Bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label May 18, 2023
@suztomo suztomo marked this pull request as ready for review May 19, 2023 01:10
@suztomo suztomo requested review from a team May 19, 2023 01:10
Comment on lines +188 to +189
// This is dummy statement to touch the Version class that is compiled for Java 11
System.out.println("org.graalvm.home.Version: " + org.graalvm.home.Version.parse("1.2.3"));
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Test to confirm the Java 8 test fails with Java 8-incompatible class.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The test successfully detected the incompatible class file in Java 8:

Error:  com.google.cloud.spanner.RetryOnInvalidatedSessionTest  Time elapsed: 0 s  <<< ERROR!
java.lang.UnsupportedClassVersionError: org/graalvm/home/Version has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

https://github.com/googleapis/java-spanner/actions/runs/5020165489/jobs/9001375691?pr=2440

This reverts commit 7752fa4.
@suztomo suztomo requested a review from rajatbhatta May 19, 2023 02:34
@suztomo suztomo added the owlbot:run Add this label to trigger the Owlbot post processor. label May 19, 2023
@gcf-owl-bot gcf-owl-bot Bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label May 19, 2023
@suztomo
Copy link
Copy Markdown
Member Author

suztomo commented May 19, 2023

@rajatbhatta Would you review this?

Copy link
Copy Markdown
Contributor

@rajatbhatta rajatbhatta left a comment

Choose a reason for hiding this comment

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

LGTM, apart from one comment.

requiresCodeOwnerReviews: true
requiresStrictStatusChecks: false
requiredStatusCheckContexts:
- dependencies (8)
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.

Shall we do this for other patterns too? 4.0.x and 5.2.x.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done.

@rajatbhatta
Copy link
Copy Markdown
Contributor

LGTM, apart from one comment.

Also, looks like the dependencies github checks are stuck.

Copy link
Copy Markdown
Member Author

@suztomo suztomo left a comment

Choose a reason for hiding this comment

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

I'll remove the dependencies checks from required checks. We only need one.

requiredStatusCheckContexts:
- dependencies (8)
- dependencies (11)
- dependencies (17)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Background: we don't need to repeatedly check the dependencies via different JDKs.

Comment thread .github/workflows/ci.yaml
Comment on lines -86 to -94
# For Java 8 tests, use JDK 11 to compile
- if: ${{matrix.java}} == '8'
uses: actions/setup-java@v3
with:
java-version: 11
distribution: zulu
- if: ${{matrix.java}} == '8'
run: echo "JAVA11_HOME=${JAVA_HOME}" >> $GITHUB_ENV
shell: bash
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This removal is the simplification

Comment thread .github/workflows/ci.yaml
Comment on lines -54 to -55
- run: echo "JAVA11_HOME=${JAVA_HOME}" >> $GITHUB_ENV
shell: bash
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This removal is the simplification

requiresCodeOwnerReviews: true
requiresStrictStatusChecks: false
requiredStatusCheckContexts:
- dependencies (8)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done.

@suztomo suztomo added the owlbot:run Add this label to trigger the Owlbot post processor. label May 19, 2023
@gcf-owl-bot gcf-owl-bot Bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label May 19, 2023
@suztomo suztomo added automerge Merge the pull request once unit tests and other checks pass. owlbot:run Add this label to trigger the Owlbot post processor. labels May 19, 2023
@gcf-owl-bot gcf-owl-bot Bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label May 19, 2023
@suztomo suztomo merged commit b756808 into googleapis:main May 19, 2023
@gcf-merge-on-green gcf-merge-on-green Bot removed the automerge Merge the pull request once unit tests and other checks pass. label May 19, 2023
@suztomo suztomo deleted the java8_build branch May 19, 2023 22:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: spanner Issues related to the googleapis/java-spanner API. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants