Skip to content

Commit babf20c

Browse files
authored
Adds validates runner post commit tests for Java streaming worker on streaming engine (#37872)
Adds a ValidatesRunner post-commit test suite using streaming engine. Previously we only tested the Java worker on appliance.
1 parent 0fb490f commit babf20c

File tree

3 files changed

+111
-0
lines changed

3 files changed

+111
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"comment": "Modify this file in a trivial way to cause this test suite to run!",
3+
"modification": 1,
4+
}
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing,
11+
# software distributed under the License is distributed on an
12+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
13+
# KIND, either express or implied. See the License for the
14+
# specific language governing permissions and limitations
15+
# under the License.
16+
17+
name: PostCommit Java ValidatesRunner Dataflow Streaming Engine
18+
19+
on:
20+
schedule:
21+
- cron: '30 4/8 * * *'
22+
pull_request_target:
23+
paths: ['release/trigger_all_tests.json', '.github/trigger_files/beam_PostCommit_Java_ValidatesRunner_Dataflow_Streaming_Engine.json']
24+
workflow_dispatch:
25+
26+
# This allows a subsequently queued workflow run to interrupt previous runs
27+
concurrency:
28+
group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login }}'
29+
cancel-in-progress: true
30+
31+
#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
32+
permissions:
33+
actions: write
34+
pull-requests: write
35+
checks: write
36+
contents: read
37+
deployments: read
38+
id-token: none
39+
issues: write
40+
discussions: read
41+
packages: read
42+
pages: read
43+
repository-projects: read
44+
security-events: read
45+
statuses: read
46+
47+
env:
48+
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
49+
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GE_CACHE_USERNAME }}
50+
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
51+
52+
jobs:
53+
beam_PostCommit_Java_ValidatesRunner_Dataflow_Streaming:
54+
name: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
55+
runs-on: [self-hosted, ubuntu-20.04, main]
56+
timeout-minutes: 720
57+
strategy:
58+
matrix:
59+
job_name: [beam_PostCommit_Java_ValidatesRunner_Dataflow_Streaming_Engine]
60+
job_phrase: [Run Dataflow Streaming Engine ValidatesRunner]
61+
if: |
62+
github.event_name == 'workflow_dispatch' ||
63+
github.event_name == 'pull_request_target' ||
64+
(github.event_name == 'schedule' && github.repository == 'apache/beam') ||
65+
github.event.comment.body == 'Run Dataflow Streaming Engine ValidatesRunner'
66+
steps:
67+
- uses: actions/checkout@v4
68+
- name: Setup repository
69+
uses: ./.github/actions/setup-action
70+
with:
71+
comment_phrase: ${{ matrix.job_phrase }}
72+
github_token: ${{ secrets.GITHUB_TOKEN }}
73+
github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
74+
- name: Setup environment
75+
uses: ./.github/actions/setup-environment-action
76+
with:
77+
java-version: default
78+
- name: run validatesRunnerStreaming script
79+
uses: ./.github/actions/gradle-command-self-hosted-action
80+
with:
81+
gradle-command: :runners:google-cloud-dataflow-java:validatesRunnerStreamingEngine
82+
max-workers: 12
83+
- name: Archive JUnit Test Results
84+
uses: actions/upload-artifact@v4
85+
if: ${{ !success() }}
86+
with:
87+
name: JUnit Test Results
88+
path: "**/build/reports/tests/"
89+
- name: Publish JUnit Test Results
90+
uses: EnricoMi/publish-unit-test-result-action@v2
91+
if: always()
92+
with:
93+
commit: '${{ env.prsha || env.GITHUB_SHA }}'
94+
comment_mode: ${{ github.event_name == 'issue_comment' && 'always' || 'off' }}
95+
files: '**/build/test-results/**/*.xml'
96+
large_files: true

runners/google-cloud-dataflow-java/build.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,17 @@ task validatesRunnerStreamingTagEncodingV2 {
506506
]))
507507
}
508508

509+
task validatesRunnerStreamingEngine {
510+
group = "Verification"
511+
description "Validates Dataflow runner forcing streaming mode on streaming engine"
512+
dependsOn(createLegacyWorkerValidatesRunnerTest(validatesRunnerStreamingConfig + [
513+
name: 'validatesRunnerLegacyWorkerTestStreamingEngine',
514+
pipelineOptions: validatesRunnerStreamingConfig.pipelineOptions + [
515+
'--experiments=enable_streaming_engine',
516+
],
517+
]))
518+
}
519+
509520
def setupXVR = tasks.register("setupXVR") {
510521
dependsOn buildAndPushDockerJavaContainer
511522
dependsOn buildAndPushDockerPythonContainer

0 commit comments

Comments
 (0)