Skip to content

Commit 897001d

Browse files
[FLINK-35007] Add support for Flink 1.19 (#90)
* [FLINK-35007] Add support for Flink 1.19 This also includes dropping the weekly tests for the `v3.0` branch, since `v3.1` has been released and that's our main version going forward. * [FLINK-35007] Remove unused test class that relied on removed Internal class * [FLINK-35007][ci] Copy old `flink-conf.yaml` to make sure that all Python tests work for Flink 1.x releases
1 parent 15f2662 commit 897001d

File tree

5 files changed

+338
-36
lines changed

5 files changed

+338
-36
lines changed

.github/workflows/push_pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
include:
3131
- flink: 1.18.1
3232
jdk: '8, 11, 17'
33-
- flink: 1.19-SNAPSHOT
33+
- flink: 1.19.0
3434
jdk: '8, 11, 17, 21'
3535
uses: apache/flink-connector-shared-utils/.github/workflows/ci.yml@ci_utils
3636
with:
@@ -39,7 +39,7 @@ jobs:
3939
python_test:
4040
strategy:
4141
matrix:
42-
flink: [ 1.17.2, 1.18.1, 1.19-SNAPSHOT ]
42+
flink: [ 1.17.2, 1.18.1, 1.19.0 ]
4343
uses: apache/flink-connector-shared-utils/.github/workflows/python_ci.yml@ci_utils
4444
with:
4545
flink_version: ${{ matrix.flink }}

.github/workflows/weekly.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ jobs:
3737
flink: 1.19-SNAPSHOT,
3838
jdk: '8, 11, 17, 21',
3939
branch: main
40+
}, {
41+
flink: 1.20-SNAPSHOT,
42+
jdk: '8, 11, 17, 21',
43+
branch: main
4044
}, {
4145
flink: 1.17.2,
4246
branch: v3.1
@@ -45,11 +49,9 @@ jobs:
4549
jdk: '8, 11, 17',
4650
branch: v3.1
4751
}, {
48-
flink: 1.17.2,
49-
branch: v3.0
50-
}, {
51-
flink: 1.18.1,
52-
branch: v3.0
52+
flink: 1.19.0,
53+
branch: v3.1,
54+
jdk: '8, 11, 17',
5355
}]
5456
uses: apache/flink-connector-shared-utils/.github/workflows/ci.yml@ci_utils
5557
with:

flink-connector-kafka/src/test/java/org/apache/flink/streaming/connectors/kafka/testutils/DataGenerators.java

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,13 @@
1818

1919
package org.apache.flink.streaming.connectors.kafka.testutils;
2020

21-
import org.apache.flink.api.common.JobExecutionResult;
2221
import org.apache.flink.api.common.restartstrategy.RestartStrategies;
2322
import org.apache.flink.api.common.serialization.SimpleStringSchema;
2423
import org.apache.flink.api.common.serialization.TypeInformationSerializationSchema;
2524
import org.apache.flink.api.common.typeinfo.BasicTypeInfo;
26-
import org.apache.flink.api.dag.Transformation;
2725
import org.apache.flink.streaming.api.datastream.DataStream;
2826
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
2927
import org.apache.flink.streaming.api.functions.source.RichParallelSourceFunction;
30-
import org.apache.flink.streaming.api.graph.StreamGraph;
3128
import org.apache.flink.streaming.api.operators.StreamSink;
3229
import org.apache.flink.streaming.connectors.kafka.FlinkKafkaProducerBase;
3330
import org.apache.flink.streaming.connectors.kafka.KafkaTestEnvironment;
@@ -36,8 +33,6 @@
3633
import org.apache.flink.streaming.runtime.streamrecord.StreamRecord;
3734
import org.apache.flink.streaming.util.OneInputStreamOperatorTestHarness;
3835

39-
import java.util.Collections;
40-
import java.util.List;
4136
import java.util.Properties;
4237
import java.util.Random;
4338

@@ -210,29 +205,5 @@ public void shutdown() {
210205
public Throwable getError() {
211206
return this.error;
212207
}
213-
214-
private static class MockTransformation extends Transformation<String> {
215-
public MockTransformation() {
216-
super("MockTransform", BasicTypeInfo.STRING_TYPE_INFO, 1);
217-
}
218-
219-
@Override
220-
public List<Transformation<?>> getTransitivePredecessors() {
221-
return null;
222-
}
223-
224-
@Override
225-
public List<Transformation<?>> getInputs() {
226-
return Collections.emptyList();
227-
}
228-
}
229-
230-
private static class DummyStreamExecutionEnvironment extends StreamExecutionEnvironment {
231-
232-
@Override
233-
public JobExecutionResult execute(StreamGraph streamGraph) throws Exception {
234-
return null;
235-
}
236-
}
237208
}
238209
}

flink-python/dev/integration_test.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,23 @@ echo "Checking ${FLINK_SOURCE_DIR} for 'pyflink_gateway_server.py'"
5050
find "${FLINK_SOURCE_DIR}/flink-python" -name pyflink_gateway_server.py
5151
find "${FLINK_SOURCE_DIR}/flink-python/.tox" -name pyflink_gateway_server.py -exec cp "${FLINK_SOURCE_DIR}/flink-python/pyflink/pyflink_gateway_server.py" {} \;
5252

53+
# Copy an empty flink-conf.yaml to conf/ folder, so that all Python tests on Flink 1.x can succeed.
54+
# This needs to be changed when adding support for Flink 2.0
55+
echo "Checking ${FLINK_SOURCE_DIR} for 'config.yaml'"
56+
find "${FLINK_SOURCE_DIR}/flink-python" -name config.yaml
57+
58+
# For every occurrence of config.yaml (new YAML file since Flink 1.19), copy in the old flink-conf.yaml so that
59+
# is used over the new config.yaml file.
60+
#
61+
# Because our intention is to copy `flink-conf.yaml` into the same directory as `config.yaml` and not replace it,
62+
# we need to extract the directory from `{}` and then specify the target filename (`flink-conf.yaml`) explicitly.
63+
# Unfortunately, `find`'s `-exec` doesn't directly support manipulating `{}`. So we use a slightly modified shell command
64+
#
65+
# `"${1}"` and `"${2}"` correspond to the first and second arguments after the shell command.
66+
# In this case, `"${1}"` is the path to `flink-conf.yaml` and `"${2}"` is the path to each `config.yaml` found by `find`.
67+
# `$(dirname "${2}")` extracts the directory part of the path to `config.yaml`, and then `/flink-conf.yaml`
68+
# specifies the target filename within that directory.
69+
find "${FLINK_SOURCE_DIR}/flink-python/.tox" -name config.yaml -exec sh -c 'cp "${1}" "$(dirname "${2}")/flink-conf.yaml"' _ "${FLINK_SOURCE_DIR}/flink-python/pyflink/flink-conf.yaml" {} \;
70+
5371
# python test
5472
test_all_modules

0 commit comments

Comments
 (0)