FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

test: verifying test, lint, clirr, and graalvm in checks by suztomo · Pull Request #456 · googleapis/java-shared-config · GitHub

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

test: verifying test, lint, clirr, and graalvm in checks - #456

Merged
suztomo merged 13 commits into
googleapis:mainfrom
suztomo:lint_downstream
Mar 29, 2022
Merged

test: verifying test, lint, clirr, and graalvm in checks#456
suztomo merged 13 commits into
googleapis:mainfrom
suztomo:lint_downstream

Conversation

suztomo commented Mar 28, 2022
edited
Loading

Copy link
Copy Markdown
Member

My attempt to run "test", "lint", and "clirr" in downstream tests. These checks ensure the maven-surefire-plugin, fmt-maven-plugin, and clirr-maven-plugin work as expected in the 2 client libraries (GAPIC and hand-written).

I don't intent to catch every failure cases in every downstream libraries, but I believe this setup will catch 90% of cases where plugin upgrades don't work in downstream repositories (and we would re-release the shared config again). Example: #452

CC: @Neenu1995

What if upgrading fmt-maven-plugin require adjusting Java code?

This PR changes the lint as a required check. This may introduce circular dependency.

For example, upgrading google-java-format to 1.15 requires code change in the downstream repository #452 (comment)
This require code change in the repository:

 /** Static utility methods for working with Errors returned from the service. */
 public class Errors {
-  private Errors() {};
+  private Errors() {}
+  ;

But we first would need to release the shared config before making the formatting change. How do we deal with it?

=> We can run mvn com.coveo:fmt-maven-plugin:format in the script to format the code before running com.coveo:fmt-maven-plugin:check:

suztomo requested a review from a team March 28, 2022 19:05

suztomo commented Mar 28, 2022

Copy link
Copy Markdown
Member Author

This detected the #452 in the check. Good:

suztomo commented Mar 28, 2022

Copy link
Copy Markdown
Member Author

We would need to update the required checks:

suztomo added 5 commits March 28, 2022 15:13
The following simple Python script can generate the list

for j in [8, 11]:
  for r in ["java-trace", "java-bigquery"]:
    for t in ["test", "lint", "clirr"]:
      print('    - "build (%s, %s, %s)"' % (j, r, t))

Copy link
Copy Markdown

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

  • .github/sync-repo-settings.yaml

suztomo requested a review from Neenu1995 March 28, 2022 19:53

suztomo commented Mar 28, 2022

Copy link
Copy Markdown
Member Author

We would need to update the required checks:

In this PR, I keep the existing required "dependencies" checks as they are, but this PR adds new checks as required.

suztomo commented Mar 29, 2022

Copy link
Copy Markdown
Member Author

The GraalVM test failed because it didn't run with GraalVM:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  16.201 s
[INFO] Finished at: 2022-03-29T16:45:43Z
[INFO] ------------------------------------------------------------------------
Error:  Failed to execute goal org.graalvm.buildtools:native-maven-plugin:0.9.11:test (test-native) on project google-cloud-orgpolicy: Execution test-native of goal org.graalvm.buildtools:native-maven-plugin:0.9.11:test failed: A required class was missing while executing org.graalvm.buildtools:native-maven-plugin:0.9.11:test: org/graalvm/nativeimage/hosted/Feature

Note: probably I do not go for this option. I could setup GraalVM
binary in GitHub Actions but this does not reflect what we would
have in downstream repositories.

suztomo commented Mar 29, 2022
edited
Loading

Copy link
Copy Markdown
Member Author

This ayltai/setup-graalvm is handy:

Note: probably I might not go for this option to install GraalVM. I could setup GraalVM binary in GitHub Actions like this, but this does not reflect what we would have in downstream repositories, which use testing-infra-docker.

How can we ensure the GraalVM version in testing-infra-docker and native-image-version from the shared config?

(Maybe manually synching the version still works)

suztomo added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 29, 2022
yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 29, 2022

suztomo commented Mar 29, 2022

Copy link
Copy Markdown
Member Author

Upgrade actions https://github.com/googleapis/java-eventarc/blob/main/.github/workflows/ci.yaml#L80

action/checkout to v3

setup-java to v3

- java-orgpolicy
steps:
- uses: actions/checkout@v2
- uses: stCarolas/setup-maven@v4

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Remove this

- uses: stCarolas/setup-maven@v4
with:
maven-version: 3.8.1
- uses: ayltai/setup-graalvm@v1

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@Neenu1995 @mpeddada1 Do we allow/ban this GitHub Actins?

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

As long as it doesn't access our secrets we are fine with using any action. But this one looks like it is not being actively developed anymore. So may not be a good long term solution.

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks. I'll use this then.

I see the owner maintains the repository. https://github.com/ayltai/setup-graalvm/commits/master
When we need alternative we can just use curl and unzip the content.

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

My bad. I saw the last release was in May 2021. Looks like it is being being actively developed.

suztomo commented Mar 29, 2022
edited
Loading

Copy link
Copy Markdown
Member Author

11 minutes to finish GraalVM test. Not too bad but I will revisit this long wait time by asking feedback among the devs here in few months.

suztomo commented Mar 29, 2022
edited
Loading

Copy link
Copy Markdown
Member Author

168cc88 should fail at the GraalVM test. As per @mpeddada1 , native-maven-plugin 0.9.11 and GraalVM 21.2.0 are incompatible. Let's see whether this new test can detect the incompatibility.

suztomo changed the title test: verifying test, lint, and clirr in checks test: verifying test, lint, clirr, and graalvm in checks Mar 29, 2022

Copy link
Copy Markdown
Contributor

Nice! It caught the incompatibility:

Failed to execute goal org.graalvm.buildtools:native-maven-plugin:0.9.11:test (test-native) on project google-cloud-orgpolicy: Execution of /opt/hostedtoolcache/GraalVM/java11-linux-amd64-21.2.0/x64/bin/native-image @/tmp/native-image1865512348312126488args org.graalvm.junit.platform.NativeImageJUnitLauncher returned non-zero result -> [Help 1]

Copy link
Copy Markdown
Contributor

@suztomo @Neenu1995 Is there any way we can keep this test consistent with the version in the testing-docker-infra?

suztomo commented Mar 29, 2022
edited
Loading

Copy link
Copy Markdown
Member Author

@mpeddada1 I don't think it's possible. I leave a comment in YAML file: https://github.com/googleapis/java-shared-config/pull/456/files#r837768926

If it's possible, then the question is which version of the container testing-docker-infra should this repository reference? Latest release, main, or certain versions.

Comment on lines +57 to +62
# When a new version of native-maven-plugin fails to run in a downstream
# library, it's likely to be an incompatibility with the GraalVM version.
# In that case, you need to upgrade the Docker container used in the
# tests in the downstream repositories (not just this value below).
# Example: https://github.com/googleapis/testing-infra-docker/pull/195
graalvm-version: 22.0.0.2

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Added an instruction on how to upgrade GraalVM version in testing-infra-docker.

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thank you!

suztomo added the automerge Merge the pull request once unit tests and other checks pass. label Mar 29, 2022

Copy link
Copy Markdown
Contributor

@mpeddada1 I don't think it's possible. I leave a comment in YAML file: https://github.com/googleapis/java-shared-config/pull/456/files#r837768926
If it's possible, then the question is which version of the container testing-docker-infra should this repository reference? Latest release, main, or certain versions.

The official page usually recommends being as specific as possible with the version tag. Yeah you're right, it might also be difficult to automate because there is a chance that the tag we specify won't be available on https://github.com/graalvm/container/pkgs/container/jdk. Manual upgrade sounds good for now! The comment will be helpful.

suztomo removed the automerge Merge the pull request once unit tests and other checks pass. label Mar 29, 2022

Copy link
Copy Markdown
Contributor

If we want to use the exact same image in test-infra-docker, then we will have to move the tests to kokoro. But I don't think that is a direction we want to take.

suztomo merged commit d5c45b8 into googleapis:main Mar 29, 2022
suztomo deleted the lint_downstream branch March 29, 2022 19:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL