-
Notifications
You must be signed in to change notification settings - Fork 10
188 lines (146 loc) · 7.08 KB
/
pg-migtests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
name: "PG 13: Migration Tests"
on:
push:
branches: ['main']
pull_request:
branches: ['main']
jobs:
run-pg-migration-tests:
strategy:
matrix:
version: [2.21.1.0-b271, 2024.1.1.0-b137, 2.20.5.0-b72]
BETA_FAST_DATA_EXPORT: [0, 1]
env:
BETA_FAST_DATA_EXPORT: ${{ matrix.BETA_FAST_DATA_EXPORT }}
runs-on: ubuntu-latest
services:
postgres:
image: postgres:13
env:
POSTGRES_PASSWORD: secret
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
# https://github.com/actions/setup-java
with:
distribution: "temurin"
java-version: "17"
check-latest: true
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: "Enable postgres with wal_level as logical"
run: |
docker exec ${{ job.services.postgres.id }} sh -c "echo 'wal_level=logical' >> /var/lib/postgresql/data/postgresql.conf"
docker restart ${{ job.services.postgres.id }}
sleep 10
# if: matrix.BETA_FAST_DATA_EXPORT == 1
- name: Install python3 and psycopg2
run: |
sudo apt install -y python3
sudo apt install -y libpq-dev
sudo pip3 install psycopg2
- name: Run installer script to setup voyager
run: |
cd installer_scripts
yes | ./install-yb-voyager --install-from-local-source --only-pg-support
env:
ON_INSTALLER_ERROR_OUTPUT_LOG: Y
DEBEZIUM_VERSION: aneesh_ff-fb-remove
DEBEZIUM_RELEASE_TAG: voyager-debezium
- name: Test PostgreSQL Connection
run: |
psql "postgresql://postgres:secret@127.0.0.1:5432/postgres" -c "SELECT version();"
- name: Create PostgreSQL user
run: |
./migtests/scripts/postgresql/create_pg_user
- name: Start YugabyteDB cluster
run: |
docker pull yugabytedb/yugabyte:${{ matrix.version }}
VERSION=${{ matrix.version }} docker compose -f migtests/setup/yb-docker-compose.yaml up -d
sleep 20
- name: Test YugabyteDB connection
run: |
psql "postgresql://yugabyte:@127.0.0.1:5433/yugabyte" -c "SELECT version();"
- name: Create YugabyteDB user
run: |
./migtests/scripts/yugabytedb/create_yb_user
- name: Enable yb-tserver-n1 and yb-master-n1 name resolution
run: |
echo "127.0.0.1 yb-tserver-n1" | sudo tee -a /etc/hosts
echo "127.0.0.1 yb-master-n1" | sudo tee -a /etc/hosts
psql "postgresql://yugabyte@yb-tserver-n1:5433/yugabyte" -c "SELECT version();"
- name: "TEST: pg-table-list-flags-test (table-list and exclude-table-list)"
run: migtests/scripts/run-test.sh pg/table-list-flags-tests
- name: "TEST: pg-table-list-file-path-test (table-list-file-path and exclude-table-list-file-path)"
run: migtests/scripts/run-test.sh pg/table-list-flags-tests env-file-path-flags.sh
- name: "TEST: pg-case-sensitivity-single-table"
run: migtests/scripts/run-test-export-data.sh pg/case-sensitivity-single-table
- name: "TEST: pg-dvdrental"
run: migtests/scripts/run-test.sh pg/dvdrental
- name: "TEST: pg-datatypes"
run: migtests/scripts/run-test.sh pg/datatypes
- name: "TEST: pg-constraints"
run: migtests/scripts/run-test.sh pg/constraints
- name: "TEST: pg-sequences"
run: migtests/scripts/run-test.sh pg/sequences
- name: "TEST: pg-indexes"
run: migtests/scripts/run-test.sh pg/indexes
- name: "TEST: pg-partitions"
run: migtests/scripts/run-test.sh pg/partitions
- name: "TEST: pg-partitions with (table-list)"
run: EXPORT_TABLE_LIST='customers,sales,emp,p2.boston,p2.london,p2.sydney,range_columns_partition_test,sales_region,test_partitions_sequences' migtests/scripts/run-test.sh pg/partitions
# Broken for v2.15 and v2.16: https://github.com/yugabyte/yugabyte-db/issues/14529
# Fixed in 2.17.1.0-b368
- name: "TEST: pg-partitions-with-indexes"
run: migtests/scripts/run-test.sh pg/partitions-with-indexes
- name: "TEST: pg-views-and-rules"
run: migtests/scripts/run-test.sh pg/views-and-rules
- name: "TEST: pg-misc-objects-1 (Types, case-sensitive-table-name, Domain)"
run: migtests/scripts/run-test.sh pg/misc-objects-1
- name: "TEST: pg-misc-objects-2 (Aggregates, Procedures, triggers, functions, extensions, inline comments)"
run: migtests/scripts/run-test.sh pg/misc-objects-2
- name: "TEST: pg-dependent-ddls"
run: migtests/scripts/run-test.sh pg/dependent-ddls
- name: "TEST: pg-multiple-schemas"
run: migtests/scripts/run-test.sh pg/multiple-schemas
- name: "Set up gcp environment"
env:
GCS_CLIENT_ID: ${{ secrets.PGUPTA_GCS_CLIENT_ID }}
GCS_CLIENT_SECRET: ${{ secrets.PGUPTA_GCS_CLIENT_SECRET }}
GCS_REFRESH_TOKEN: ${{ secrets.PGUPTA_GCS_REFRESH_TOKEN }}
run: migtests/scripts/gcs/create_gcs_credentials_file
- name: "TEST: pg-codependent-schemas"
run: migtests/scripts/run-test.sh pg/codependent-schemas
- name: "TEST: pg-sample-schema-emp"
run: migtests/scripts/run-test.sh pg/sample-employee
- name: "TEST: pg-hasura-ecommerce"
run: migtests/scripts/run-test.sh pg/hasura-ecommerce
- name: "TEST: pg-basic-non-public-live-migration-test"
run: migtests/scripts/live-migration-run-test.sh pg/basic-non-public-live-test
- name: "TEST: pg-unique-key-conflicts-test"
run: migtests/scripts/live-migration-run-test.sh pg/unique-key-conflicts-test
# case sensitive table names are not yet supported in live migration, to restricting test only to a few tables.
- name: "TEST: pg-live-migration-multiple-schemas"
run: EXPORT_TABLE_LIST="ext_test,tt,audit,recipients,session_log,schema2.ext_test,schema2.tt,schema2.audit,schema2.recipients,schema2.session_log" migtests/scripts/live-migration-run-test.sh pg/multiple-schemas
- name: "TEST: pg-basic-public-fall-forward-test"
run: migtests/scripts/live-migration-fallf-run-test.sh pg/basic-public-live-test
- name: "TEST: pg-basic-non-public-fall-back-test"
run: migtests/scripts/live-migration-fallb-run-test.sh pg/basic-non-public-live-test
- name: "TEST: pg-live-migration-partitions-fall-forward"
run: migtests/scripts/live-migration-fallf-run-test.sh pg/partitions
- name: "TEST: pg-case-sensitivity-reserved-words-offline"
run: migtests/scripts/run-test.sh pg/case-sensitivity-reserved-words