Skip to content

Commit 1ac5be0

Browse files
authored
chore: add jdk 24 to CI tests (#3803)
This is in order to support graalvm upgrade. SecurityManager was removed in JDK 24 so had to upgrade to bazel 7.x which no longer sets command line params to use it. In upgrading to bazel 7.x also had to replace transitive_deps to use transitive_compile_time_jars, as that deprecated method was dropped: bazelbuild/bazel@72058be
1 parent 6efe7e8 commit 1ac5be0

File tree

4 files changed

+39
-5
lines changed

4 files changed

+39
-5
lines changed

.bazeliskrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# See https://github.com/bazelbuild/bazelisk
2-
# As per b/302171264#comment5, 6.4.0 supports Java 21.
3-
USE_BAZEL_VERSION=6.4.0
2+
# Version required for Java 24 support (https://github.com/bazelbuild/bazel/commit/806a6e82320956b63f1351ebe2b0da8483f36f19).
3+
USE_BAZEL_VERSION=7.6.1

.github/workflows/ci.yaml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,40 @@ jobs:
9191
- name: Integration Tests
9292
run: |
9393
bazelisk --batch test //test/integration/...
94+
build-java-24:
95+
name: "build(24) except self-service clients"
96+
# Support for Java 24 is available for all use cases except self-service clients.
97+
runs-on: ubuntu-22.04
98+
steps:
99+
- uses: actions/checkout@v4
100+
- uses: actions/setup-java@v4
101+
with:
102+
java-version: 24
103+
distribution: temurin
104+
cache: maven
105+
- run: java -version
106+
- name: Unit Tests
107+
run: |
108+
mvn test --batch-mode --no-transfer-progress -Dcheckstyle.skip \
109+
-Dfmt.skip -DenableTestCoverage
110+
# The `envVarTest` profile runs tests that require an environment variable
111+
- name: Env Var Tests
112+
run: |
113+
mvn test --batch-mode --no-transfer-progress -Dcheckstyle.skip \
114+
-Dfmt.skip -DenableTestCoverage -PenvVarTest
115+
# Set the Env Var for this step only
116+
env:
117+
GOOGLE_CLOUD_UNIVERSE_DOMAIN: random.com
118+
GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS: true
119+
GOOGLE_SDK_JAVA_LOGGING: true
120+
- run: bazelisk version
121+
- name: Install Maven modules
122+
run: |
123+
mvn install -B -ntp -DskipTests -Dclirr.skip -Dcheckstyle.skip
124+
- name: Integration Tests
125+
# note need to set shouldInstallTestSecurityManager=false due to https://github.com/bazelbuild/bazel/issues/24354
126+
run: |
127+
bazelisk --batch test //test/integration/... --jvmopt=-Dcom.google.testing.junit.runner.shouldInstallTestSecurityManager=false
94128
build-java8-except-gapic-generator-java:
95129
name: "build(8) except for gapic-generator-java"
96130
runs-on: ubuntu-22.04
@@ -273,7 +307,7 @@ jobs:
273307
runs-on: ubuntu-22.04
274308
strategy:
275309
matrix:
276-
java: [ 11, 17, 21, 23 ]
310+
java: [ 11, 17, 21, 24 ]
277311
steps:
278312
- uses: actions/checkout@v4
279313
- uses: actions/setup-java@v4

hermetic_build/library_generation/owlbot/templates/java_library/.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
strategy:
2626
fail-fast: false
2727
matrix:
28-
java: [11, 17, 21]
28+
java: [11, 17, 21, 24]
2929
steps:
3030
- uses: actions/checkout@v4
3131
- uses: actions/setup-java@v4

rules_java_gapic/java_gapic_pkg.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def _construct_extra_deps(scope_to_deps, versions_map):
149149
if not extra_deps.get(key):
150150
extra_deps[key] = "%s project(':%s')" % (scope, pkg_dependency)
151151
elif _is_java_dependency(dep):
152-
for f in dep[JavaInfo].transitive_deps.to_list():
152+
for f in dep[JavaInfo].transitive_compile_time_jars.to_list():
153153
maven_artifact = label_name_to_maven_artifact.get(f.owner.name)
154154
if not maven_artifact:
155155
continue

0 commit comments

Comments
 (0)