Skip to content

Commit 581236f

Browse files
authored
Merge pull request #31 from ClickHouse/support-flink-1.17
Support flink 1.17+
2 parents c2654f8 + 7bdcf00 commit 581236f

File tree

45 files changed

+2420
-182
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+2420
-182
lines changed

.github/workflows/tests-scala.yaml

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ name: Apache Flink ClickHouse Connector Tests CI (Scala)
33
on: [push]
44

55
jobs:
6-
build:
6+
test-flink-17:
77
runs-on: ubuntu-latest
88
strategy:
99
fail-fast: false
1010
matrix:
1111
clickhouse: [ "23.7", "24.3", "latest", "cloud" ]
12-
name: Apache Flink ClickHouse Connector tests with ClickHouse ${{ matrix.clickhouse }}
12+
flink: [ "1.17.2", "1.18.1", "1.19.3", "1.20.2"]
13+
name: Apache Flink ${{ matrix.flink }} ClickHouse Connector tests with ClickHouse ${{ matrix.clickhouse }}
1314
steps:
1415
- name: Check for Cloud Credentials
1516
id: check-cloud-credentials
@@ -29,12 +30,48 @@ jobs:
2930
java-version: '21'
3031
distribution: 'adopt'
3132
architecture: x64
32-
- name: Setup and execute Gradle 'runScalaTests' task
33+
- name: Setup and execute Gradle 'test' task
3334
if: env.SKIP_STEP != 'true'
3435
uses: gradle/gradle-build-action@v2
3536
env:
3637
CLICKHOUSE_VERSION: ${{ matrix.clickhouse }}
3738
CLICKHOUSE_CLOUD_HOST: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_HOST_SMT }}
3839
CLICKHOUSE_CLOUD_PASSWORD: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_PASSWORD_SMT }}
40+
FLINK_VERSION: ${{ matrix.flink }}
3941
with:
40-
arguments: runScalaTests
42+
arguments: :flink-connector-clickhouse-1.17:runScalaTests
43+
test-flink-2:
44+
runs-on: ubuntu-latest
45+
strategy:
46+
fail-fast: false
47+
matrix:
48+
clickhouse: [ "23.7", "24.3", "latest", "cloud" ]
49+
name: Apache Flink 2.0.0 ClickHouse Connector tests with ClickHouse ${{ matrix.clickhouse }}
50+
steps:
51+
- name: Check for Cloud Credentials
52+
id: check-cloud-credentials
53+
run: |
54+
if [[ "${{ matrix.clickhouse }}" == "cloud" && (-z "${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_HOST_SMT }}" || -z "${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_PASSWORD_SMT }}") ]]; then
55+
echo "SKIP_STEP=true" >> $GITHUB_ENV
56+
else
57+
echo "SKIP_STEP=false" >> $GITHUB_ENV
58+
fi
59+
shell: bash
60+
- uses: actions/checkout@v3
61+
if: env.SKIP_STEP != 'true'
62+
- name: Set up JDK 21
63+
if: env.SKIP_STEP != 'true'
64+
uses: actions/setup-java@v3
65+
with:
66+
java-version: '21'
67+
distribution: 'adopt'
68+
architecture: x64
69+
- name: Setup and execute Gradle 'test' task
70+
if: env.SKIP_STEP != 'true'
71+
uses: gradle/gradle-build-action@v2
72+
env:
73+
CLICKHOUSE_VERSION: ${{ matrix.clickhouse }}
74+
CLICKHOUSE_CLOUD_HOST: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_HOST_SMT }}
75+
CLICKHOUSE_CLOUD_PASSWORD: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_PASSWORD_SMT }}
76+
with:
77+
arguments: :flink-connector-clickhouse-2.0.0:runScalaTests

.github/workflows/tests.yaml

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ name: Apache Flink ClickHouse Connector Tests CI (Java)
33
on: [push]
44

55
jobs:
6-
build:
6+
test-flink-17:
77
runs-on: ubuntu-latest
88
strategy:
99
fail-fast: false
1010
matrix:
1111
clickhouse: [ "23.7", "24.3", "latest", "cloud" ]
12-
name: Apache Flink ClickHouse Connector tests with ClickHouse ${{ matrix.clickhouse }}
12+
flink: [ "1.17.2", "1.18.1", "1.19.3", "1.20.2"]
13+
name: Apache Flink ${{ matrix.flink }} ClickHouse Connector tests with ClickHouse ${{ matrix.clickhouse }}
1314
steps:
1415
- name: Check for Cloud Credentials
1516
id: check-cloud-credentials
@@ -36,5 +37,41 @@ jobs:
3637
CLICKHOUSE_VERSION: ${{ matrix.clickhouse }}
3738
CLICKHOUSE_CLOUD_HOST: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_HOST_SMT }}
3839
CLICKHOUSE_CLOUD_PASSWORD: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_PASSWORD_SMT }}
40+
FLINK_VERSION: ${{ matrix.flink }}
3941
with:
40-
arguments: test
42+
arguments: :flink-connector-clickhouse-1.17:test
43+
test-flink-2:
44+
runs-on: ubuntu-latest
45+
strategy:
46+
fail-fast: false
47+
matrix:
48+
clickhouse: [ "23.7", "24.3", "latest", "cloud" ]
49+
name: Apache Flink 2.0.0 ClickHouse Connector tests with ClickHouse ${{ matrix.clickhouse }}
50+
steps:
51+
- name: Check for Cloud Credentials
52+
id: check-cloud-credentials
53+
run: |
54+
if [[ "${{ matrix.clickhouse }}" == "cloud" && (-z "${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_HOST_SMT }}" || -z "${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_PASSWORD_SMT }}") ]]; then
55+
echo "SKIP_STEP=true" >> $GITHUB_ENV
56+
else
57+
echo "SKIP_STEP=false" >> $GITHUB_ENV
58+
fi
59+
shell: bash
60+
- uses: actions/checkout@v3
61+
if: env.SKIP_STEP != 'true'
62+
- name: Set up JDK 21
63+
if: env.SKIP_STEP != 'true'
64+
uses: actions/setup-java@v3
65+
with:
66+
java-version: '21'
67+
distribution: 'adopt'
68+
architecture: x64
69+
- name: Setup and execute Gradle 'test' task
70+
if: env.SKIP_STEP != 'true'
71+
uses: gradle/gradle-build-action@v2
72+
env:
73+
CLICKHOUSE_VERSION: ${{ matrix.clickhouse }}
74+
CLICKHOUSE_CLOUD_HOST: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_HOST_SMT }}
75+
CLICKHOUSE_CLOUD_PASSWORD: ${{ secrets.INTEGRATIONS_TEAM_TESTS_CLOUD_PASSWORD_SMT }}
76+
with:
77+
arguments: :flink-connector-clickhouse-2.0.0:test

build.gradle.kts

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
plugins {
2+
`maven-publish`
3+
java
4+
signing
5+
id("com.gradleup.nmcp") version "0.0.8"
6+
id("com.github.johnrengelman.shadow") version "8.1.1"
7+
8+
}
9+
10+
val sinkVersion by extra("0.0.1")
11+
val flinkVersion by extra("1.18.0")
12+
val clickhouseVersion by extra("0.4.6")
13+
val junitVersion by extra("5.8.2")
14+
15+
allprojects {
16+
group = "org.apache.flink"
17+
version = sinkVersion
18+
19+
repositories {
20+
mavenCentral()
21+
}
22+
}
23+
24+
subprojects {
25+
apply(plugin = "java-library")
26+
apply(plugin = "maven-publish")
27+
28+
java {
29+
toolchain {
30+
languageVersion.set(JavaLanguageVersion.of(11))
31+
}
32+
}
33+
34+
dependencies {
35+
// Use JUnit Jupiter for testing.
36+
// testImplementation(libs.junit.jupiter)
37+
testImplementation("org.junit.jupiter:junit-jupiter:$junitVersion")
38+
testImplementation("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
39+
}
40+
41+
tasks.test {
42+
useJUnitPlatform()
43+
44+
include("**/*Test.class", "**/*Tests.class", "**/*Spec.class")
45+
testLogging {
46+
events("passed", "failed", "skipped")
47+
//showStandardStreams = true - , "standardOut", "standardError"
48+
}
49+
}
50+
51+
tasks.compileJava {
52+
options.encoding = "UTF-8"
53+
}
54+
55+
tasks.compileTestJava {
56+
options.encoding = "UTF-8"
57+
}
58+
59+
tasks.withType<ScalaCompile> {
60+
scalaCompileOptions.apply {
61+
encoding = "UTF-8"
62+
isDeprecation = true
63+
additionalParameters = listOf("-feature", "-unchecked")
64+
}
65+
}
66+
67+
68+
tasks.register<JavaExec>("runScalaTests") {
69+
group = "verification"
70+
mainClass.set("org.scalatest.tools.Runner")
71+
classpath = sourceSets["test"].runtimeClasspath
72+
args = listOf(
73+
"-R", "build/classes/scala/test",
74+
"-oD", // show durations
75+
"-s", "org.apache.flink.connector.clickhouse.test.scala.ClickHouseSinkTests"
76+
)
77+
}
78+
}
79+
80+
//sourceSets {
81+
// main {
82+
// scala {
83+
// srcDirs("src/main/scala")
84+
// }
85+
// java {
86+
// srcDirs("src/main/java")
87+
// }
88+
// }
89+
// test {
90+
// scala {
91+
// srcDirs("src/test/scala")
92+
// }
93+
// java {
94+
// srcDirs("src/test/java")
95+
// }
96+
// }
97+
//}

0 commit comments

Comments
 (0)