-
Notifications
You must be signed in to change notification settings - Fork 11
131 lines (107 loc) · 4.71 KB
/
misc-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
name: "Misc: Migration Tests"
on:
push:
branches: ['main', '*.*-dev', '*.*.*-dev']
pull_request:
branches: ['main']
jobs:
run-misc-migration-tests:
runs-on: ubuntu-22.04
services:
postgres:
image: postgres:17
env:
POSTGRES_PASSWORD: postgres
# 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 pg_stat_statements loaded via shared_preload_libraries"
run: |
docker exec ${{ job.services.postgres.id }} sh -c "echo \"shared_preload_libraries = 'pg_stat_statements'\" >> /var/lib/postgresql/data/postgresql.conf"
docker restart ${{ job.services.postgres.id }}
sleep 10
- name: Install python3 and psycopg2
run: |
sudo apt install -y python3
sudo apt install -y libpq-dev
sudo apt install python3-psycopg2
#TODO Remove the install PG 17 command once we do that in installer script
- name: Run installer script to setup voyager
run: |
cd installer_scripts
yes | ./install-yb-voyager --install-from-local-source --only-pg-support
sudo apt-get -y install postgresql-17
echo "/usr/lib/postgresql/17/bin" >> "$GITHUB_PATH"
env:
ON_INSTALLER_ERROR_OUTPUT_LOG: Y
- name: Test PostgreSQL Connection
run: |
psql "postgresql://postgres:[email protected]:5432/postgres" -c "SELECT version();"
- name: Create PostgreSQL user
run: |
./migtests/scripts/postgresql/create_pg_user
- name: "TEST: Assessment Report Test"
run: migtests/scripts/run-validate-assessment-report.sh pg/assessment-report-test
- name: "TEST: Assessment Report Test (Schema list UQC)"
run: migtests/scripts/run-validate-assessment-report.sh pg/assessment-report-test-uqc
- name: "TEST: analyze-schema"
if: ${{ !cancelled() }}
run: migtests/tests/analyze-schema/run-analyze-schema-test
- name: Run import data file tests on different YugabyteDB versions
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 }}
AWS_ACCESS_KEY_ID: ${{ secrets.RAHULB_S3_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.RAHULB_S3_SECRET_ACCESS_KEY }}
if: ${{ !cancelled() }}
run: |
versions=("2024.2.0.0-b145" "2.20.8.0-b53" "2024.1.3.1-b8" "2.23.1.0-b220")
for version in "${versions[@]}"; do
echo "Running tests on version $version"
echo "Start YugabyteDB cluster"
docker run -d --name yugabytedb-$version \
-p7000:7000 -p9000:9000 -p15433:15433 -p5433:5433 -p9042:9042 \
yugabytedb/yugabyte:$version \
bin/yugabyted start --background=false --ui=false
sleep 20
echo "Test YugabyteDB connection"
psql "postgresql://yugabyte:@127.0.0.1:5433/yugabyte" -c "SELECT version();"
echo "Create YugabyteDB user"
./migtests/scripts/yugabytedb/create_yb_user
echo "Enable yb-tserver-n1 and yb-master-n1 name resolution"
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();"
echo "TEST: PG sample schemas (omnibus)"
migtests/scripts/run-schema-migration.sh pg/omnibus
echo "Setup the gcp credentials"
migtests/scripts/gcs/create_gcs_credentials_file
echo "TEST: import-data-file"
migtests/tests/import-file/run-import-file-test
echo "Stop the cluster before the next iteration"
docker stop yugabytedb-$version
docker remove yugabytedb-$version
done
shell: bash