Skip to content

Commit

Permalink
Add unit test against released java_tools_javac14
Browse files Browse the repository at this point in the history
Closes #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] #11514
[2] bazelbuild/java_tools#28

Closes #11828.

PiperOrigin-RevId: 324358602
  • Loading branch information
davido authored and copybara-github committed Aug 1, 2020
1 parent 672f58c commit 693c88a
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 4 deletions.
33 changes: 33 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,39 @@ http_archive(
],
)

# This must be kept in sync with src/test/shell/bazel/testdata/jdk_http_archives.
http_archive(
name = "remote_java_tools_javac14_test_linux",
patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE,
patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN,
sha256 = "196128eadc68a55fb42a1f990c84ee816f5b29320a72fe542fcfc4206ac3978a",
urls = [
"https://mirror.bazel.build/bazel_java_tools/releases/javac14/v1.0/java_tools_javac14_linux-v1.0.zip",
],
)

# This must be kept in sync with src/test/shell/bazel/testdata/jdk_http_archives.
http_archive(
name = "remote_java_tools_javac14_test_windows",
patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE,
patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN,
sha256 = "a6c69fd89b87fccc4c75203be6b407a1ca22cbdb54cffbd445f874281a933149",
urls = [
"https://mirror.bazel.build/bazel_java_tools/releases/javac14/v1.0/java_tools_javac14_windows-v1.0.zip",
],
)

# This must be kept in sync with src/test/shell/bazel/testdata/jdk_http_archives.
http_archive(
name = "remote_java_tools_javac14_test_darwin",
patch_cmds = EXPORT_WORKSPACE_IN_BUILD_FILE,
patch_cmds_win = EXPORT_WORKSPACE_IN_BUILD_FILE_WIN,
sha256 = "e20f002ceb3f3353d64c022e1f3400d8539ee56ffcfd4a6680d73d6a2cac938b",
urls = [
"https://mirror.bazel.build/bazel_java_tools/releases/javac14/v1.0/java_tools_javac14_darwin-v1.0.zip",
],
)

# This must be kept in sync with src/test/shell/bazel/testdata/jdk_http_archives.
http_archive(
name = "openjdk11_linux_archive",
Expand Down
3 changes: 3 additions & 0 deletions src/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,9 @@ filegroup(
"@remote_java_tools_javac11_test_darwin//:WORKSPACE",
"@remote_java_tools_javac11_test_linux//:WORKSPACE",
"@remote_java_tools_javac11_test_windows//:WORKSPACE",
"@remote_java_tools_javac14_test_darwin//:WORKSPACE",
"@remote_java_tools_javac14_test_linux//:WORKSPACE",
"@remote_java_tools_javac14_test_windows//:WORKSPACE",
"@remote_java_tools_linux_for_testing//:WORKSPACE",
"@remote_java_tools_windows_for_testing//:WORKSPACE",
"@remotejdk11_linux_aarch64_for_testing//:WORKSPACE",
Expand Down
5 changes: 1 addition & 4 deletions src/test/shell/bazel/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,6 @@ sh_test(

JAVA_VERSIONS = ("11", "14")

# TODO(davido): Remove this once remote_java_tools_javac14 is released
JAVA_TOOLS_VERSIONS = ("11",)

[
sh_test(
name = "bazel_java_test_jdk" + java_version + "_toolchain_head",
Expand Down Expand Up @@ -494,7 +491,7 @@ sh_test(
"no_windows",
],
)
for java_version in JAVA_TOOLS_VERSIONS
for java_version in JAVA_VERSIONS
]

# Test java coverage with the java_toolchain in the java_tools zip built at head.
Expand Down
26 changes: 26 additions & 0 deletions src/test/shell/bazel/testdata/jdk_http_archives
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,32 @@ http_archive(
urls = ["https://mirror.bazel.build/openjdk/azul-zulu11.37.17-ca-jdk11.0.6/zulu11.37.17-ca-jdk11.0.6-win_x64.zip"],
)

################### Remote java_tools with embedded javac 14 ###################
# This must be kept in sync with the top-level WORKSPACE file.
http_archive(
name = "remote_java_tools_javac14_test_linux",
sha256 = "196128eadc68a55fb42a1f990c84ee816f5b29320a72fe542fcfc4206ac3978a",
urls = [
"https://mirror.bazel.build/bazel_java_tools/releases/javac14/v1.0/java_tools_javac14_linux-v1.0.zip",
],
)
# This must be kept in sync with the top-level WORKSPACE file.
http_archive(
name = "remote_java_tools_javac14_test_windows",
sha256 = "a6c69fd89b87fccc4c75203be6b407a1ca22cbdb54cffbd445f874281a933149",
urls = [
"https://mirror.bazel.build/bazel_java_tools/releases/javac14/v1.0/java_tools_javac14_windows-v1.0.zip",
],
)
# This must be kept in sync with the top-level WORKSPACE file.
http_archive(
name = "remote_java_tools_javac14_test_darwin",
sha256 = "e20f002ceb3f3353d64c022e1f3400d8539ee56ffcfd4a6680d73d6a2cac938b",
urls = [
"https://mirror.bazel.build/bazel_java_tools/releases/javac14/v1.0/java_tools_javac14_darwin-v1.0.zip",
],
)

#################################### JDK 14 ####################################
# This must be kept in sync with the top-level WORKSPACE file.
http_archive(
Expand Down
3 changes: 3 additions & 0 deletions src/test/shell/testenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,9 @@ EOF
"remote_java_tools_javac11_test_darwin"
"remote_java_tools_javac11_test_linux"
"remote_java_tools_javac11_test_windows"
"remote_java_tools_javac14_test_darwin"
"remote_java_tools_javac14_test_linux"
"remote_java_tools_javac14_test_windows"
"remote_java_tools_linux_for_testing"
"remote_java_tools_windows_for_testing"
"remotejdk11_linux_for_testing"
Expand Down

0 comments on commit 693c88a

Please sign in to comment.