Skip to content

Commit 54231e8

Browse files
authored
try to fix forward tests for java 17 (#39058)
* try to fix forward with 17 only * address just two workflows * Revert XVR Spark3 workflow java-version override * Add Java 17 and 11 setup and -Pjava17Home across all XVR workflows * Revert redundant java-version override in TransformService Direct workflow
1 parent eaba570 commit 54231e8

8 files changed

Lines changed: 40 additions & 10 deletions

File tree

.github/workflows/beam_PostCommit_XVR_Flink.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ jobs:
7575
- name: Setup environment
7676
uses: ./.github/actions/setup-environment-action
7777
with:
78+
java-version: |
79+
17
80+
11
7881
python-version: ${{ matrix.python_version }}
7982
- name: run PostCommit XVR Flink script
8083
env:
@@ -83,6 +86,7 @@ jobs:
8386
with:
8487
gradle-command: :runners:flink:${{ env.FlinkVersion }}:job-server:validatesCrossLanguageRunner
8588
arguments: |
89+
-Pjava17Home=$JAVA_HOME_17_X64 \
8690
-PpythonVersion=${{ matrix.python_version }} \
8791
-PskipNonPythonTask=${{ (matrix.python_version == '3.10' && true) || false }} \
8892
- name: Archive JUnit Test Results

.github/workflows/beam_PostCommit_XVR_GoUsingJava_Dataflow.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ jobs:
7676
- name: Setup environment
7777
uses: ./.github/actions/setup-environment-action
7878
with:
79+
java-version: |
80+
17
81+
11
7982
python-version: default
8083
- name: Set up Docker Buildx
8184
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5
@@ -86,6 +89,7 @@ jobs:
8689
with:
8790
gradle-command: :runners:google-cloud-dataflow-java:validatesCrossLanguageRunnerGoUsingJava
8891
arguments: |
92+
-Pjava17Home=$JAVA_HOME_17_X64 \
8993
-PuseDockerBuildx
9094
- name: Archive JUnit Test Results
9195
uses: actions/upload-artifact@v7

.github/workflows/beam_PostCommit_XVR_JavaUsingPython_Dataflow.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ jobs:
7474
- name: Setup environment
7575
uses: ./.github/actions/setup-environment-action
7676
with:
77+
java-version: |
78+
17
79+
11
7780
python-version: |
7881
3.10
7982
${{ matrix.python_version }}
@@ -82,6 +85,7 @@ jobs:
8285
with:
8386
gradle-command: :runners:google-cloud-dataflow-java:validatesCrossLanguageRunnerJavaUsingPython
8487
arguments: |
88+
-Pjava17Home=$JAVA_HOME_17_X64 \
8589
-PpythonVersion=${{ matrix.python_version }} \
8690
- name: Archive JUnit Test Results
8791
uses: actions/upload-artifact@v7

.github/workflows/beam_PostCommit_XVR_PythonUsingJavaSQL_Dataflow.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,16 @@ jobs:
7373
- name: Setup environment
7474
uses: ./.github/actions/setup-environment-action
7575
with:
76+
java-version: |
77+
17
78+
11
7679
python-version: 3.14
7780
- name: run PostCommit XVR PythonUsingJavaSQL Dataflow script
7881
uses: ./.github/actions/gradle-command-self-hosted-action
7982
with:
8083
gradle-command: :runners:google-cloud-dataflow-java:validatesCrossLanguageRunnerPythonUsingSql
8184
arguments: |
85+
-Pjava17Home=$JAVA_HOME_17_X64 \
8286
-PpythonVersion=3.14 \
8387
- name: Archive Python Test Results
8488
uses: actions/upload-artifact@v7

.github/workflows/beam_PostCommit_XVR_PythonUsingJava_Dataflow.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ jobs:
7474
- name: Setup environment
7575
uses: ./.github/actions/setup-environment-action
7676
with:
77+
java-version: |
78+
17
79+
11
7780
python-version: |
7881
3.10
7982
${{ matrix.python_version }}
@@ -82,6 +85,7 @@ jobs:
8285
with:
8386
gradle-command: :runners:google-cloud-dataflow-java:validatesCrossLanguageRunnerPythonUsingJava
8487
arguments: |
88+
-Pjava17Home=$JAVA_HOME_17_X64 \
8589
-PpythonVersion=${{ matrix.python_version }} \
8690
- name: Archive Python Test Results
8791
uses: actions/upload-artifact@v7

.github/workflows/beam_PostCommit_XVR_Spark3.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ jobs:
7474
- name: Setup environment
7575
uses: ./.github/actions/setup-environment-action
7676
with:
77+
java-version: |
78+
17
79+
11
7780
python-version: ${{ matrix.python_version }}
7881
- name: run PostCommit XVR Spark3 script
7982
env:
@@ -82,6 +85,7 @@ jobs:
8285
with:
8386
gradle-command: :runners:spark:3:job-server:validatesCrossLanguageRunner
8487
arguments: |
88+
-Pjava17Home=$JAVA_HOME_17_X64 \
8589
-PpythonVersion=${{ matrix.python_version }} \
8690
-PskipNonPythonTask=${{ (matrix.python_version == '3.10' && true) || false }} \
8791
- name: Archive JUnit Test Results

buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,9 @@ class BeamModulePlugin implements Plugin<Project> {
978978

979979
// set compiler options for java version overrides to compile with a different java version
980980
project.ext.setJavaVerOptions = { CompileOptions options, String ver ->
981+
if (!project.findProperty("java${ver}Home")) {
982+
return
983+
}
981984
if (ver == '8') {
982985
def java8Home = project.findProperty("java8Home")
983986
options.fork = true
@@ -1161,16 +1164,16 @@ class BeamModulePlugin implements Plugin<Project> {
11611164
// If compiled on older SDK, compile with JDK configured with compatible javaXXHome
11621165
// The order is intended here
11631166
if (requireJavaVersion.compareTo(JavaVersion.VERSION_11) <= 0 &&
1164-
project.hasProperty('java11Home')) {
1167+
project.findProperty('java11Home')) {
11651168
forkJavaVersion = '11'
11661169
} else if (requireJavaVersion.compareTo(JavaVersion.VERSION_17) <= 0 &&
1167-
project.hasProperty('java17Home')) {
1170+
project.findProperty('java17Home')) {
11681171
forkJavaVersion = '17'
11691172
} else if (requireJavaVersion.compareTo(JavaVersion.VERSION_21) <= 0 &&
1170-
project.hasProperty('java21Home')) {
1173+
project.findProperty('java21Home')) {
11711174
forkJavaVersion = '21'
11721175
} else if (requireJavaVersion.compareTo(JavaVersion.VERSION_25) <= 0 &&
1173-
project.hasProperty('java25Home')) {
1176+
project.findProperty('java25Home')) {
11741177
forkJavaVersion = '25'
11751178
} else {
11761179
logger.config("Module ${project.name} disabled. To enable, either " +
@@ -1628,7 +1631,7 @@ class BeamModulePlugin implements Plugin<Project> {
16281631
}
16291632
// if specified test java version, modify the compile and runtime versions accordingly
16301633
if (['11', '17', '21', '25'].contains(testJavaVersion)) {
1631-
def testJavaHome = project.getProperty("java${testJavaVersion}Home")
1634+
def testJavaHome = project.findProperty("java${testJavaVersion}Home")
16321635

16331636
// redirect java compiler to specified version for compileTestJava only
16341637
project.tasks.compileTestJava {
@@ -2710,7 +2713,8 @@ class BeamModulePlugin implements Plugin<Project> {
27102713

27112714
def pythonDir = project.project(":sdks:python").projectDir
27122715
def usesDataflowRunner = config.pythonPipelineOptions.contains("--runner=TestDataflowRunner") || config.pythonPipelineOptions.contains("--runner=DataflowRunner")
2713-
def javaContainerSuffix = getSupportedJavaVersion()
2716+
String ver = project.findProperty('testJavaVersion')
2717+
def javaContainerSuffix = ver ? getSupportedJavaVersion(ver) : getSupportedJavaVersion()
27142718

27152719
// Sets up, collects, and runs Python pipeline tests
27162720
project.tasks.register(config.name+"PythonUsingJava") {
@@ -2790,7 +2794,8 @@ class BeamModulePlugin implements Plugin<Project> {
27902794
]
27912795
def serviceArgs = project.project(':sdks:python').mapToArgString(expansionServiceOpts)
27922796
def pythonContainerSuffix = project.project(':sdks:python').pythonVersion.replace('.', '')
2793-
def javaContainerSuffix = getSupportedJavaVersion()
2797+
String ver = project.findProperty('testJavaVersion')
2798+
def javaContainerSuffix = ver ? getSupportedJavaVersion(ver) : getSupportedJavaVersion()
27942799
def setupTask = project.tasks.register(config.name+"Setup", Exec) {
27952800
dependsOn ':sdks:java:container:'+javaContainerSuffix+':docker'
27962801
dependsOn ':sdks:python:container:py'+pythonContainerSuffix+':docker'
@@ -2979,10 +2984,11 @@ class BeamModulePlugin implements Plugin<Project> {
29792984
]
29802985
def serviceArgs = project.project(':sdks:python').mapToArgString(transformServiceOpts)
29812986
def pythonContainerSuffix = project.project(':sdks:python').pythonVersion.replace('.', '')
2982-
def javaContainerSuffix = getSupportedJavaVersion()
2987+
String ver = project.findProperty('testJavaVersion')
2988+
def javaContainerSuffix = ver ? getSupportedJavaVersion(ver) : getSupportedJavaVersion()
29832989

29842990
// Transform service delivers transforms that refer to SDK harness containers with following sufixes.
2985-
def transformServiceJavaContainerSuffix = 'java11'
2991+
def transformServiceJavaContainerSuffix = 'java17'
29862992
def transformServicePythonContainerSuffix = pythonContainerSuffix
29872993

29882994
def setupTask = project.tasks.register(config.name+"Setup", Exec) {

sdks/java/transform-service/controller-container/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# limitations under the License.
1717
###############################################################################
1818

19-
FROM eclipse-temurin:11
19+
FROM eclipse-temurin:17
2020
LABEL Author "Apache Beam <dev@beam.apache.org>"
2121
ARG TARGETOS
2222
ARG TARGETARCH

0 commit comments

Comments
 (0)