apache / apache/beam

[Task]: Compile Java Examples Main on Java 11/17/21 when run Java Example Tests

Open
#28,967 1 comment 0 reactions 1 assignee Claimed by @Abacn View on GitHub
new feature P2 pinned
Dominant language
Java
Stars
8.7k
Forks
4.7k
Avg merge
1d 20h
Merged PRs (30d)
196

Description

### What would you like to happen?

Currently we run Java Examples in different Java versions (11, 17), e.g.

- https://ci-beam.apache.org/job/beam_PostCommit_Java_Examples_Dataflow_V2_java11/
- https://ci-beam.apache.org/job/beam_PostCommit_Java_Examples_Dataflow_V2_java17/
- https://github.com/apache/beam/blob/master/.github/workflows/beam_PostCommit_Java_Examples_Dataflow_Java.yml

In current tests (Jenkins, GHA Examples Dataflow v1), java home is always Java8, and it compile and run **tests** on Java 11/17, see
https://github.com/apache/beam/blob/a94d29ffd21710eac3e88be9325346171368e219/.test-infra/jenkins/job_PostCommit_Java_Examples_Dataflow_V2_Java11.groovy#L48

https://github.com/apache/beam/blob/a94d29ffd21710eac3e88be9325346171368e219/.github/workflows/beam_PostCommit_Java_Examples_Dataflow_Java.yml#L79-L80

(note that GHA Examples Dataflow v2 currently just setup a single Java version, which is not quite aligned with this pattern)

However, the test scope source of `:example:java` project is really a thin wrapper for the examples, which live in main scope. This actually means the pipeline is compiled with Java8, then run with Java11/17 runtime, which is not quite we want (GHA Dataflow v2 accidentally compile all sources with Java11/17 though)

We should clean up current setting to make the Example test to
- all beam dependencies (e.g. Java core, runners) compile on Java 8 -- in alignment with released version
- examples main and test src compile with given Java version
- run test with given Java version

### Issue Priority

Priority: 2 (default / most feature requests should be filed as P2)

### Issue Components

- [ ] Component: Python SDK
- [ ] Component: Java SDK
- [ ] Component: Go SDK
- [ ] Component: Typescript SDK
- [ ] Component: IO connector
- [ ] Component: Beam YAML
- [ ] Component: Beam examples
- [ ] Component: Beam playground
- [ ] Component: Beam katas
- [ ] Component: Website
- [ ] Component: Spark Runner
- [ ] Component: Flink Runner
- [ ] Component: Samza Runner
- [ ] Component: Twister2 Runner
- [ ] Component: Hazelcast Jet Runner
- [ ] Component: Google Cloud Dataflow Runner

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.