Skip to content

Commit 01bd2a6

Browse files
committed
Add Scala muti flink versions tests
1 parent 9994231 commit 01bd2a6

File tree

4 files changed

+128
-70
lines changed

4 files changed

+128
-70
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

build.gradle.kts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,27 @@ subprojects {
5555
tasks.compileTestJava {
5656
options.encoding = "UTF-8"
5757
}
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+
5879
}
5980

6081
//sourceSets {

flink-connector-clickhouse-1.17/build.gradle.kts

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -99,45 +99,45 @@ sourceSets {
9999
}
100100

101101
// Apply a specific Java toolchain to ease working on different environments.
102-
java {
103-
toolchain {
104-
languageVersion = JavaLanguageVersion.of(11)
105-
}
106-
}
107-
108-
tasks.test {
109-
useJUnitPlatform()
110-
111-
include("**/*Test.class", "**/*Tests.class", "**/*Spec.class")
112-
testLogging {
113-
events("passed", "failed", "skipped")
114-
//showStandardStreams = true - , "standardOut", "standardError"
115-
}
116-
}
117-
118-
tasks.withType<ScalaCompile> {
119-
scalaCompileOptions.apply {
120-
encoding = "UTF-8"
121-
isDeprecation = true
122-
additionalParameters = listOf("-feature", "-unchecked")
123-
}
124-
}
125-
126-
tasks.named<Test>("test") {
127-
// Use JUnit Platform for unit tests.
128-
useJUnitPlatform()
129-
}
130-
131-
tasks.register<JavaExec>("runScalaTests") {
132-
group = "verification"
133-
mainClass.set("org.scalatest.tools.Runner")
134-
classpath = sourceSets["test"].runtimeClasspath
135-
args = listOf(
136-
"-R", "build/classes/scala/test",
137-
"-oD", // show durations
138-
"-s", "org.apache.flink.connector.clickhouse.test.scala.ClickHouseSinkTests"
139-
)
140-
}
102+
//java {
103+
// toolchain {
104+
// languageVersion = JavaLanguageVersion.of(11)
105+
// }
106+
//}
107+
108+
//tasks.test {
109+
// useJUnitPlatform()
110+
//
111+
// include("**/*Test.class", "**/*Tests.class", "**/*Spec.class")
112+
// testLogging {
113+
// events("passed", "failed", "skipped")
114+
// //showStandardStreams = true - , "standardOut", "standardError"
115+
// }
116+
//}
117+
//
118+
//tasks.withType<ScalaCompile> {
119+
// scalaCompileOptions.apply {
120+
// encoding = "UTF-8"
121+
// isDeprecation = true
122+
// additionalParameters = listOf("-feature", "-unchecked")
123+
// }
124+
//}
125+
126+
//tasks.named<Test>("test") {
127+
// // Use JUnit Platform for unit tests.
128+
// useJUnitPlatform()
129+
//}
130+
//
131+
//tasks.register<JavaExec>("runScalaTests") {
132+
// group = "verification"
133+
// mainClass.set("org.scalatest.tools.Runner")
134+
// classpath = sourceSets["test"].runtimeClasspath
135+
// args = listOf(
136+
// "-R", "build/classes/scala/test",
137+
// "-oD", // show durations
138+
// "-s", "org.apache.flink.connector.clickhouse.test.scala.ClickHouseSinkTests"
139+
// )
140+
//}
141141

142142
tasks.shadowJar {
143143
archiveClassifier.set("all")

flink-connector-clickhouse-2.0.0/build.gradle.kts

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -98,39 +98,39 @@ sourceSets {
9898
// }
9999
//}
100100

101-
tasks.test {
102-
useJUnitPlatform()
103-
104-
include("**/*Test.class", "**/*Tests.class", "**/*Spec.class")
105-
testLogging {
106-
events("passed", "failed", "skipped")
107-
//showStandardStreams = true - , "standardOut", "standardError"
108-
}
109-
}
110-
111-
tasks.withType<ScalaCompile> {
112-
scalaCompileOptions.apply {
113-
encoding = "UTF-8"
114-
isDeprecation = true
115-
additionalParameters = listOf("-feature", "-unchecked")
116-
}
117-
}
101+
//tasks.test {
102+
// useJUnitPlatform()
103+
//
104+
// include("**/*Test.class", "**/*Tests.class", "**/*Spec.class")
105+
// testLogging {
106+
// events("passed", "failed", "skipped")
107+
// //showStandardStreams = true - , "standardOut", "standardError"
108+
// }
109+
//}
110+
//
111+
//tasks.withType<ScalaCompile> {
112+
// scalaCompileOptions.apply {
113+
// encoding = "UTF-8"
114+
// isDeprecation = true
115+
// additionalParameters = listOf("-feature", "-unchecked")
116+
// }
117+
//}
118118

119119
//tasks.named<Test>("test") {
120120
// // Use JUnit Platform for unit tests.
121121
// useJUnitPlatform()
122122
//}
123123

124-
tasks.register<JavaExec>("runScalaTests") {
125-
group = "verification"
126-
mainClass.set("org.scalatest.tools.Runner")
127-
classpath = sourceSets["test"].runtimeClasspath
128-
args = listOf(
129-
"-R", "build/classes/scala/test",
130-
"-oD", // show durations
131-
"-s", "org.apache.flink.connector.clickhouse.test.scala.ClickHouseSinkTests"
132-
)
133-
}
124+
//tasks.register<JavaExec>("runScalaTests") {
125+
// group = "verification"
126+
// mainClass.set("org.scalatest.tools.Runner")
127+
// classpath = sourceSets["test"].runtimeClasspath
128+
// args = listOf(
129+
// "-R", "build/classes/scala/test",
130+
// "-oD", // show durations
131+
// "-s", "org.apache.flink.connector.clickhouse.test.scala.ClickHouseSinkTests"
132+
// )
133+
//}
134134

135135
tasks.shadowJar {
136136
archiveClassifier.set("all")

0 commit comments

Comments
 (0)