Skip to content

Shivansh/remove gcc requirement installerscript #1369

Shivansh/remove gcc requirement installerscript

Shivansh/remove gcc requirement installerscript #1369

Workflow file for this run

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