mirror of https://github.com/sysown/proxysql
Register test_cluster_sync_pgsql-t in groups.json (default-g3) so it is picked up by CI-taptests-groups and passes check_groups.py validation. Add CI-taptests-pgsql-cluster.yml as a standalone workflow that runs only the PostgreSQL cluster sync TAP test, triggered after CI-trigger or via workflow_dispatch.fix/postgresql-cluster-sync_2
parent
859c89b30e
commit
cbc50ebf8a
@ -0,0 +1,189 @@
|
||||
name: CI-taptests-pgsql-cluster
|
||||
run-name: '${{ github.event.workflow_run && github.event.workflow_run.head_branch || github.ref_name }} ${{ github.workflow }} ${{ github.event.workflow_run && github.event.workflow_run.head_sha || github.sha }}'
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
workflow_run:
|
||||
workflows: [ CI-trigger ]
|
||||
types: [ completed ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.workflow_run && github.event.workflow_run.head_branch || github.ref_name }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
SHA: ${{ github.event.workflow_run && github.event.workflow_run.head_sha || github.sha }}
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
runs-on: ubuntu-22.04
|
||||
if: ${{ github.event.workflow_run && github.event.workflow_run.conclusion == 'success' || ! github.event.workflow_run }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
testdist: [ 'ubuntu22-tap' ]
|
||||
infradb: [ 'mysql57' ]
|
||||
env:
|
||||
TESTDIST: ${{ matrix.testdist }}
|
||||
INFRADB: ${{ matrix.infradb }}
|
||||
BLDCACHE: ${{ github.event.workflow_run && github.event.workflow_run.head_sha || github.sha }}_${{ matrix.testdist }}
|
||||
|
||||
steps:
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update -y
|
||||
sudo apt-get full-upgrade -y
|
||||
sudo apt-get install -y python3-pymysql python3-structlog sysbench mycli
|
||||
sudo apt-get install -y --no-install-recommends python3-pip
|
||||
sudo pip3 install fastcov
|
||||
|
||||
wget https://github.com/openark/orchestrator/releases/download/v3.2.6/orchestrator-client_3.2.6_amd64.deb
|
||||
sudo dpkg -i orchestrator-client_3.2.6_amd64.deb
|
||||
|
||||
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29
|
||||
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A8D3785C
|
||||
wget https://repo.mysql.com/mysql-apt-config_0.8.29-1_all.deb
|
||||
sudo dpkg -i mysql-apt-config_0.8.29-1_all.deb
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y mysql-shell
|
||||
|
||||
sudo sed -i 's/8.0/5.7/' /etc/apt/sources.list.d/mysql.list
|
||||
sudo sed -i 's/jammy/bionic/' /etc/apt/sources.list.d/mysql.list
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y --allow-downgrades libmysqlclient-dev=5.7*
|
||||
|
||||
- name: Cache restore src
|
||||
id: cache-src
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
key: ${{ env.BLDCACHE }}_src
|
||||
fail-on-cache-miss: true
|
||||
path: |
|
||||
proxysql/src/
|
||||
|
||||
- name: Cache restore test
|
||||
id: cache-test
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
key: ${{ env.BLDCACHE }}_test
|
||||
fail-on-cache-miss: true
|
||||
path: |
|
||||
proxysql/test/
|
||||
|
||||
- name: Checkout jenkins_build_scripts
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: 'proxysql/jenkins-build-scripts'
|
||||
ref: 'kubernetes'
|
||||
path: 'jenkins-build-scripts'
|
||||
token: ${{ secrets.GH_TOKEN_PROXYSQL }}
|
||||
submodules: 'false'
|
||||
|
||||
- name: Configure env.sh
|
||||
run: |
|
||||
cd jenkins-build-scripts
|
||||
sed -i "s|JENKINS_SCRIPTS_PATH=.*|JENKINS_SCRIPTS_PATH=${GITHUB_WORKSPACE}/jenkins-build-scripts|" env.sh
|
||||
sed -i "s|WORKSPACE=.*|WORKSPACE=${GITHUB_WORKSPACE}/proxysql|" env.sh
|
||||
|
||||
- name: Configure test/env.sh
|
||||
run: |
|
||||
cd proxysql
|
||||
|
||||
echo "export TAP_WORKDIR=\$WORKSPACE/test/tap/tests" >> test/env.sh
|
||||
echo "export TEST_PY_INTERNAL=0" >> test/env.sh
|
||||
echo "export TEST_PY_BENCHMARK=0" >> test/env.sh
|
||||
echo "export TEST_PY_CHUSER=0" >> test/env.sh
|
||||
echo "export TEST_PY_STATS=0" >> test/env.sh
|
||||
echo "export TEST_PY_TAP=1" >> test/env.sh
|
||||
echo "export TEST_PY_TAPINT=0" >> test/env.sh
|
||||
echo "export TEST_PY_FAILOVER=0" >> test/env.sh
|
||||
echo 'export TEST_PY_TAP_INCL="test_cluster_sync_pgsql-t"' >> test/env.sh
|
||||
echo 'export MALLOC_CONF="retain:false"' >> test/env.sh
|
||||
echo 'export WITHGCOV=0' >> test/env.sh
|
||||
|
||||
- name: Start ProxySQL cluster
|
||||
run: |
|
||||
set +e
|
||||
cd "${GITHUB_WORKSPACE}/jenkins-build-scripts"
|
||||
source ./env.sh
|
||||
|
||||
./cluster_start.bash
|
||||
sleep 10
|
||||
|
||||
cd "${GITHUB_WORKSPACE}/proxysql"
|
||||
mkdir -p ci_infra_logs/regular_infra/proxysql
|
||||
cd src
|
||||
mkdir -p coverage_reports
|
||||
|
||||
(./proxysql --clickhouse-server --sqlite3-server --idle-threads -f -c "$DOCKER_SCRIPT_PATH/conf/proxysql/proxysql.cnf" -D $REGULAR_INFRA_DATADIR &> $REGULAR_INFRA_DATADIR/proxysql.log) &
|
||||
sleep 10
|
||||
mysql -uadmin -padmin -h127.0.0.1 -P6032 -e "SELECT version();" 2>&1 | grep -v "Using a password"
|
||||
|
||||
cd "${GITHUB_WORKSPACE}/jenkins-build-scripts"
|
||||
./cluster_init.bash
|
||||
sleep 10
|
||||
|
||||
- name: Infra
|
||||
run: |
|
||||
cd "${GITHUB_WORKSPACE}/jenkins-build-scripts"
|
||||
source ./env.sh
|
||||
|
||||
cd "${GITHUB_WORKSPACE}/jenkins-build-scripts/infra-docker-hoster"
|
||||
sed -i 's|image: .*|image: ghcr.io/mrmohebi/docker-hoster|' docker-compose.yml
|
||||
./docker-compose-init.bash
|
||||
|
||||
cd "${GITHUB_WORKSPACE}/jenkins-build-scripts/infra-mysql57"
|
||||
sed -i "s/\${INFRA}-\${CONTAINER}-1/\${INFRA}_\${CONTAINER}_1/" docker-compose-init.bash
|
||||
./docker-compose-init.bash
|
||||
|
||||
docker ps -a
|
||||
cat /etc/hosts
|
||||
|
||||
- name: Run test_cluster_sync_pgsql-t
|
||||
run: |
|
||||
set +e
|
||||
cd "${GITHUB_WORKSPACE}/jenkins-build-scripts"
|
||||
source ./env.sh
|
||||
|
||||
sudo -E ./test-scripts/bin/proxysql-tester.py
|
||||
RC=$?
|
||||
|
||||
exit $RC
|
||||
|
||||
- name: Cleanup
|
||||
if: ${{ failure() && !cancelled() }}
|
||||
run: |
|
||||
set +e
|
||||
cd "${GITHUB_WORKSPACE}/jenkins-build-scripts"
|
||||
source ./env.sh
|
||||
|
||||
mysql -h127.0.0.1 -P6032 -uadmin -padmin -e "PROXYSQL SHUTDOWN SLOW" &> /dev/null
|
||||
sleep 10
|
||||
killall proxysql
|
||||
|
||||
cd "${GITHUB_WORKSPACE}/jenkins-build-scripts/infra-docker-hoster"
|
||||
sed -i 's|image: .*|image: ghcr.io/mrmohebi/docker-hoster|' docker-compose.yml
|
||||
./docker-compose-destroy.bash
|
||||
|
||||
cd "${GITHUB_WORKSPACE}/jenkins-build-scripts/infra-mysql57"
|
||||
sed -i "s/\${INFRA}-\${CONTAINER}-1/\${INFRA}_\${CONTAINER}_1/" docker-compose-init.bash
|
||||
./docker-compose-destroy.bash
|
||||
|
||||
sudo chmod -R 777 "${GITHUB_WORKSPACE}"/*
|
||||
|
||||
- name: Archive artifacts logs
|
||||
if: ${{ failure() && !cancelled() }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ github.workflow }}-${{ env.SHA }}-logs-run#${{ github.run_number }}
|
||||
path: |
|
||||
proxysql/ci_*_logs/
|
||||
|
||||
- name: Archive artifacts tests
|
||||
if: ${{ failure() && !cancelled() }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ github.workflow }}-${{ env.SHA }}-tests-run#${{ github.run_number }}
|
||||
path: |
|
||||
proxysql/test/tap/tests*
|
||||
Loading…
Reference in new issue