Skip to content

Commit 57cbb94

Browse files
committed
Add unit test against released java_tools_javac14
Closes bazelbuild#11017. This is the follow-up for PR: [1]. Because of the chicken and the egg problem, it has to be done in three steps: 1. add support for java toolchange JDK 14, done in: [1] 2. publish new java_tools_javac14, kicked off by the pipeline in java_tools repository, in context of: [2] 3. add unit test against released java_tools_javac14 published in step 2, this change Test Plan: $ bazel test //src/test/shell/bazel:bazel_coverage_java_jdk14toolchain_released_test [1] bazelbuild#11514 [2] bazelbuild/java_tools#28
1 parent 0d3378e commit 57cbb94

File tree

5 files changed

+66
-4
lines changed

5 files changed

+66
-4
lines changed

WORKSPACE

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -882,6 +882,39 @@ http_archive(
882882
],
883883
)
884884

885+
# This must be kept in sync with src/test/shell/bazel/testdata/jdk_http_archives.
886+
http_archive(
887+
name = "remote_java_tools_javac14_test_linux",
888+
patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE,
889+
patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN,
890+
sha256 = "196128eadc68a55fb42a1f990c84ee816f5b29320a72fe542fcfc4206ac3978a",
891+
urls = [
892+
"https://mirror.bazel.build/bazel_java_tools/releases/javac14/v1.0/java_tools_javac14_linux-v1.0.zip",
893+
],
894+
)
895+
896+
# This must be kept in sync with src/test/shell/bazel/testdata/jdk_http_archives.
897+
http_archive(
898+
name = "remote_java_tools_javac14_test_windows",
899+
patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE,
900+
patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN,
901+
sha256 = "a6c69fd89b87fccc4c75203be6b407a1ca22cbdb54cffbd445f874281a933149",
902+
urls = [
903+
"https://mirror.bazel.build/bazel_java_tools/releases/javac14/v1.0/java_tools_javac14_windows-v1.0.zip",
904+
],
905+
)
906+
907+
# This must be kept in sync with src/test/shell/bazel/testdata/jdk_http_archives.
908+
http_archive(
909+
name = "remote_java_tools_javac14_test_darwin",
910+
patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE,
911+
patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN,
912+
sha256 = "e20f002ceb3f3353d64c022e1f3400d8539ee56ffcfd4a6680d73d6a2cac938b",
913+
urls = [
914+
"https://mirror.bazel.build/bazel_java_tools/releases/javac14/v1.0/java_tools_javac14_darwin-v1.0.zip",
915+
],
916+
)
917+
885918
# This must be kept in sync with src/test/shell/bazel/testdata/jdk_http_archives.
886919
http_archive(
887920
name = "openjdk11_linux_archive",

src/BUILD

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,9 @@ filegroup(
760760
"@remote_java_tools_javac11_test_darwin//:WORKSPACE",
761761
"@remote_java_tools_javac11_test_linux//:WORKSPACE",
762762
"@remote_java_tools_javac11_test_windows//:WORKSPACE",
763+
"@remote_java_tools_javac14_test_darwin//:WORKSPACE",
764+
"@remote_java_tools_javac14_test_linux//:WORKSPACE",
765+
"@remote_java_tools_javac14_test_windows//:WORKSPACE",
763766
"@remote_java_tools_linux_for_testing//:WORKSPACE",
764767
"@remote_java_tools_windows_for_testing//:WORKSPACE",
765768
"@remotejdk11_linux_aarch64_for_testing//:WORKSPACE",

src/test/shell/bazel/BUILD

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,6 @@ sh_test(
222222

223223
JAVA_VERSIONS = ("11", "14")
224224

225-
# TODO(davido): Remove this once remote_java_tools_javac14 is released
226-
JAVA_TOOLS_VERSIONS = ("11",)
227-
228225
[
229226
sh_test(
230227
name = "bazel_java_test_jdk" + java_version + "_toolchain_head",
@@ -494,7 +491,7 @@ sh_test(
494491
"no_windows",
495492
],
496493
)
497-
for java_version in JAVA_TOOLS_VERSIONS
494+
for java_version in JAVA_VERSIONS
498495
]
499496

500497
# Test java coverage with the java_toolchain in the java_tools zip built at head.

src/test/shell/bazel/testdata/jdk_http_archives

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,32 @@ http_archive(
5050
urls = ["https://mirror.bazel.build/openjdk/azul-zulu11.37.17-ca-jdk11.0.6/zulu11.37.17-ca-jdk11.0.6-win_x64.zip"],
5151
)
5252

53+
################### Remote java_tools with embedded javac 14 ###################
54+
# This must be kept in sync with the top-level WORKSPACE file.
55+
http_archive(
56+
name = "remote_java_tools_javac14_test_linux",
57+
sha256 = "196128eadc68a55fb42a1f990c84ee816f5b29320a72fe542fcfc4206ac3978a",
58+
urls = [
59+
"https://mirror.bazel.build/bazel_java_tools/releases/javac14/v1.0/java_tools_javac14_linux-v1.0.zip",
60+
],
61+
)
62+
# This must be kept in sync with the top-level WORKSPACE file.
63+
http_archive(
64+
name = "remote_java_tools_javac14_test_windows",
65+
sha256 = "a6c69fd89b87fccc4c75203be6b407a1ca22cbdb54cffbd445f874281a933149",
66+
urls = [
67+
"https://mirror.bazel.build/bazel_java_tools/releases/javac14/v1.0/java_tools_javac14_windows-v1.0.zip",
68+
],
69+
)
70+
# This must be kept in sync with the top-level WORKSPACE file.
71+
http_archive(
72+
name = "remote_java_tools_javac14_test_darwin",
73+
sha256 = "e20f002ceb3f3353d64c022e1f3400d8539ee56ffcfd4a6680d73d6a2cac938b",
74+
urls = [
75+
"https://mirror.bazel.build/bazel_java_tools/releases/javac14/v1.0/java_tools_javac14_darwin-v1.0.zip",
76+
],
77+
)
78+
5379
#################################### JDK 14 ####################################
5480
# This must be kept in sync with the top-level WORKSPACE file.
5581
http_archive(

src/test/shell/testenv.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,9 @@ EOF
292292
"remote_java_tools_javac11_test_darwin"
293293
"remote_java_tools_javac11_test_linux"
294294
"remote_java_tools_javac11_test_windows"
295+
"remote_java_tools_javac14_test_darwin"
296+
"remote_java_tools_javac14_test_linux"
297+
"remote_java_tools_javac14_test_windows"
295298
"remote_java_tools_linux_for_testing"
296299
"remote_java_tools_windows_for_testing"
297300
"remotejdk11_linux_for_testing"

0 commit comments

Comments
 (0)