Skip to content

Commit

Permalink
add tests with various flink versions
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxiqian committed Aug 22, 2024
1 parent 4517c6c commit 2be57e4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/flink_cdc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -315,16 +315,16 @@ jobs:
- name: Prepare CDC versions
run: CDC_SOURCE_HOME=$PWD ruby tools/mig-test/prepare_libs.rb
- name: Prepare Flink distro
run: wget https://dlcdn.apache.org/flink/flink-{{ matrix.flink-version }}/flink-{{ matrix.flink-version }}-bin-scala_2.12.tgz && tar -xzvf flink-{{ matrix.flink-version }}-bin-scala_2.12.tgz
run: wget https://dlcdn.apache.org/flink/flink-${{ matrix.flink-version }}/flink-${{ matrix.flink-version }}-bin-scala_2.12.tgz && tar -xzvf flink-${{ matrix.flink-version }}-bin-scala_2.12.tgz
working-directory: ./tools/mig-test
- name: Patch Flink configs
run: FLINK_HOME=./flink-{{ matrix.flink-version }}/ ruby misc/patch_flink_conf.rb
run: FLINK_HOME=./flink-${{ matrix.flink-version }}/ ruby misc/patch_flink_conf.rb
working-directory: ./tools/mig-test
- name: Start containers
run: cd conf && docker compose up -d
working-directory: ./tools/mig-test
- name: Run migration tests
run: FLINK_HOME=./flink-{{ matrix.flink-version }}/ ruby run_migration_test.rb
run: FLINK_HOME=./flink-${{ matrix.flink-version }}/ ruby run_migration_test.rb ${{ matrix.flink-version }}
working-directory: ./tools/mig-test
- name: Stop containers
if: always()
Expand Down Expand Up @@ -355,10 +355,10 @@ jobs:
- name: Prepare CDC versions
run: CDC_SOURCE_HOME=$PWD ruby tools/mig-test/prepare_libs.rb
- name: Prepare Flink distro
run: wget https://dlcdn.apache.org/flink/flink-{{ matrix.flink-version }}/flink-{{ matrix.flink-version }}-bin-scala_2.12.tgz && tar -xzvf flink-{{ matrix.flink-version }}-bin-scala_2.12.tgz
run: wget https://dlcdn.apache.org/flink/flink-${{ matrix.flink-version }}/flink-${{ matrix.flink-version }}-bin-scala_2.12.tgz && tar -xzvf flink-${{ matrix.flink-version }}-bin-scala_2.12.tgz
working-directory: ./tools/mig-test
- name: Patch Flink configs
run: FLINK_HOME=./flink-{{ matrix.flink-version }}/ ruby misc/patch_flink_conf.rb
run: FLINK_HOME=./flink-${{ matrix.flink-version }}/ ruby misc/patch_flink_conf.rb
working-directory: ./tools/mig-test
- name: Compile Dummy DataStream Jobs
run: cd datastream && ruby compile_jobs.rb
Expand All @@ -367,7 +367,7 @@ jobs:
run: cd conf && docker compose up -d
working-directory: ./tools/mig-test
- name: Run migration tests
run: cd datastream && FLINK_HOME=../flink-{{ matrix.flink-version }}/ ruby run_migration_test.rb
run: cd datastream && FLINK_HOME=../flink-${{ matrix.flink-version }}/ ruby run_migration_test.rb
working-directory: ./tools/mig-test
- name: Stop containers
if: always()
Expand Down
10 changes: 8 additions & 2 deletions tools/mig-test/run_migration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,13 @@ def test_migration(from_version, to_version)
end
end

version_list = %w[3.0.0 3.0.1 3.1.0 3.1.1 3.3-SNAPSHOT]
version_list = case ARGV[0]
when '1.18.1' then %w[3.0.0 3.0.1 3.1.1 3.3-SNAPSHOT]
when '1.19.1' then %w[3.1.1 3.3-SNAPSHOT]
when '1.20.0' then %w[3.3-SNAPSHOT]
else []
end

no_savepoint_versions = %w[3.0.0 3.0.1]
version_result = Hash.new('❓')
@failures = []
Expand Down Expand Up @@ -157,6 +163,6 @@ def test_migration(from_version, to_version)
end
puts "✅ - Compatible, ❌ - Not compatible, ❓ - Target version doesn't support `--from-savepoint`"

if @failures.filter { |old_version, new_version| new_version == version_list.last && old_version != '3.1.0' }.any?
if @failures.any?
abort 'Some migration to snapshot version tests failed.'
end

0 comments on commit 2be57e4

Please sign in to comment.