-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FLINK-35736][tests] Add migration test scripts & CI workflows
- Loading branch information
Showing
30 changed files
with
2,185 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
*.sql | ||
savepoints/** | ||
cdc-versions/** | ||
cache/** | ||
.idea/** | ||
Gemfile.lock | ||
/logs/ | ||
conf/temp.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Flink CDC Migration Test Utilities | ||
|
||
## Pipeline Jobs | ||
### Preparation | ||
|
||
1. Install Ruby (macOS has embedded it by default) | ||
2. (Optional) Run `gem install terminal-table` for better display | ||
|
||
### Compile snapshot CDC versions | ||
3. Set `CDC_SOURCE_HOME` to the root directory of the Flink CDC git repository | ||
4. Run `ruby prepare_libs.rb` to download released / compile snapshot CDC versions | ||
|
||
### Run migration tests | ||
5. Enter `conf/` and run `docker compose up -d` to start up test containers | ||
6. Set `FLINK_HOME` to the home directory of Flink | ||
7. Run `ruby run_migration_test.rb` to start testing | ||
|
||
### Result | ||
The migration result will be displayed in the console like this: | ||
|
||
``` | ||
+--------------------------------------------------------------------+ | ||
| Migration Test Result | | ||
+--------------+-------+-------+-------+--------------+--------------+ | ||
| | 3.0.0 | 3.0.1 | 3.1.0 | 3.1-SNAPSHOT | 3.2-SNAPSHOT | | ||
| 3.0.0 | ❓ | ❓ | ❌ | ✅ | ✅ | | ||
| 3.0.1 | | ❓ | ❌ | ✅ | ✅ | | ||
| 3.1.0 | | | ✅ | ❌ | ❌ | | ||
| 3.1-SNAPSHOT | | | | ✅ | ✅ | | ||
| 3.2-SNAPSHOT | | | | | ✅ | | ||
+--------------+-------+-------+-------+--------------+--------------+ | ||
``` | ||
|
||
## DataStream Jobs | ||
|
||
See `datastream/README.md`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
version: '3' | ||
services: | ||
mysql: | ||
image: mysql:8.0 | ||
environment: | ||
MYSQL_ALLOW_EMPTY_PASSWORD: "true" | ||
MYSQL_DATABASE: fallen | ||
ports: | ||
- 3306:3306 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
source: | ||
type: mysql | ||
name: MySQL Source | ||
hostname: localhost | ||
port: 3306 | ||
username: root | ||
password: "" | ||
tables: fallen.\.* | ||
server-id: 5400-5500 | ||
server-time-zone: UTC | ||
|
||
sink: | ||
type: values | ||
name: Values Sink | ||
|
||
pipeline: | ||
name: ${PIPELINE_NAME} | ||
parallelism: 1 | ||
|
||
route: | ||
- source-table: fallen.\.* | ||
sink-table: fallen.terminus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
source: | ||
type: mysql | ||
name: MySQL Source | ||
hostname: localhost | ||
port: 3306 | ||
username: root | ||
password: "" | ||
tables: fallen.\.* | ||
server-id: 5400-5500 | ||
server-time-zone: UTC | ||
|
||
sink: | ||
type: values | ||
name: Values Sink | ||
|
||
pipeline: | ||
name: ${PIPELINE_NAME} | ||
parallelism: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Flink CDC MigrationTestUtils | ||
|
||
## DataStream Jobs | ||
### Preparation | ||
|
||
1. Install Ruby (macOS has embedded it by default) | ||
2. (Optional) Run `gem install terminal-table` for better display | ||
|
||
### Compile DataStream Jobs | ||
3. Run `ruby compile_jobs.rb` to compile dummy DataStream jobs with specific version tags | ||
4. Run `ruby run_migration_test.rb` to start testing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
|
||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
JOB_VERSIONS = %w[2.4.2 3.0.0 3.0.1 3.1.0 3.1.1 3.2-SNAPSHOT] | ||
|
||
JOB_VERSIONS.each do |version| | ||
puts "Compiling DataStream job for CDC #{version}" | ||
`cd datastream-#{version} && mvn clean package -DskipTests` | ||
end | ||
|
||
puts 'Done' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
target/ | ||
!.mvn/wrapper/maven-wrapper.jar | ||
!**/src/main/**/target/ | ||
!**/src/test/**/target/ | ||
|
||
### IntelliJ IDEA ### | ||
.idea/modules.xml | ||
.idea/jarRepositories.xml | ||
.idea/compiler.xml | ||
.idea/libraries/ | ||
*.iws | ||
*.iml | ||
*.ipr | ||
|
||
### Eclipse ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
/.nb-gradle/ | ||
build/ | ||
!**/src/main/**/build/ | ||
!**/src/test/**/build/ | ||
|
||
### VS Code ### | ||
.vscode/ | ||
|
||
### Mac OS ### | ||
.DS_Store |
Oops, something went wrong.