mirror of https://github.com/sysown/proxysql
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
235 lines
7.8 KiB
235 lines
7.8 KiB
|
|
name: CI-cb_taptests
|
|
|
|
on:
|
|
# push:
|
|
# branches: [ "v2.x" ]
|
|
# paths-ignore:
|
|
# - '.github/**'
|
|
# - '**.md'
|
|
# pull_request:
|
|
# branches: [ "v2.x" ]
|
|
# paths-ignore:
|
|
# - '.github/**'
|
|
# - '**.md'
|
|
# schedule:
|
|
# - cron: '15 13 * * 3'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
builds:
|
|
runs-on: ubuntu-22.04
|
|
outputs:
|
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- dist: 'ubuntu22'
|
|
type: '-tap'
|
|
steps:
|
|
|
|
- name: Cache build
|
|
id: cache
|
|
if: ${{ matrix.type == '-tap' }}
|
|
uses: actions/cache@v3
|
|
with:
|
|
key: ${{ github.workflow }}_${{ github.sha }}_${{ matrix.dist }}${{ matrix.type }}
|
|
# lookup-only: true
|
|
path: |
|
|
proxysql/
|
|
|
|
- name: Checkout repository
|
|
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
|
|
uses: actions/checkout@v3
|
|
with:
|
|
repository: 'sysown/proxysql'
|
|
# ref: 'v2.x'
|
|
fetch-depth: 0
|
|
path: 'proxysql'
|
|
|
|
- name: Build
|
|
id: build
|
|
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
|
|
run: |
|
|
cd proxysql/
|
|
# build proxysql
|
|
sed -i "/command/c \ command: bash -l -c 'cd /opt/proxysql && make -j6 debug_clickhouse WITHGCOV=1'" docker-compose.yml
|
|
make ${{ matrix.dist }}-dbg
|
|
# build tap tests
|
|
sed -i "/command/c \ command: bash -l -c 'cd /opt/proxysql && make -j6 build_tap_test_debug WITHGCOV=1'" docker-compose.yml
|
|
make ${{ matrix.dist }}-dbg | tee ../build.log
|
|
|
|
- name: Check build
|
|
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
|
|
run: |
|
|
grep 'exited with code 0' build.log
|
|
|
|
- name: Prepare tests
|
|
id: set-matrix
|
|
if: ${{ success() }}
|
|
run: |
|
|
find proxysql/src -type f -executable -print > proxysql/executable.txt
|
|
find proxysql/test -type f -executable -print >> proxysql/executable.txt
|
|
MATRIX="[ "$(find proxysql/test/tap/tests/ -type f -name '*-t' -executable -printf "'%f', ")" ]"
|
|
#echo "matrix=${MATRIX}"
|
|
echo "matrix=${MATRIX}" >> $GITHUB_OUTPUT
|
|
|
|
|
|
###############################################################################################################
|
|
|
|
|
|
test:
|
|
runs-on: ubuntu-22.04
|
|
needs: [ builds ]
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
# testgroup: [ '.*admin.*-t|.*basic.*-t|.*charset.*-t|.*firewall.*-t|.*kill.*-t|.*max.*-t', 'multiple.*-t', '.*mysql.*-t', '.*prepare.*-t', 'reg_test.*-t', 'save.*-t', '.*set.*-t', '.*sqlite.*-t', '.*ssl.*-t', 'test_.*-t' ]
|
|
testgroup: [ 'set_testing-240-t', '.*ssl.*-t' ]
|
|
# testgroup: ${{ fromJson(needs.builds.outputs.matrix) }}
|
|
steps:
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt-get update -y
|
|
sudo apt-get install -y python3-pymysql python3-structlog sysbench mycli
|
|
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
|
|
wget https://repo.mysql.com/mysql-apt-config_0.8.24-1_all.deb
|
|
sudo dpkg -i mysql-apt-config_0.8.24-1_all.deb
|
|
sudo apt-get update -y
|
|
sudo apt-cache policy mysql-shell
|
|
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-cache policy libmysqlclient-dev
|
|
sudo apt-get install -y --allow-downgrades libmysqlclient-dev=5.7*
|
|
|
|
- name: Cache build
|
|
id: cache
|
|
uses: actions/cache@v3
|
|
with:
|
|
key: ${{ github.workflow }}_${{ github.sha }}_${{ matrix.dist }}${{ matrix.type }}
|
|
# lookup-only: true
|
|
path: |
|
|
proxysql/
|
|
|
|
- name: Checkout jenkins_build_scripts
|
|
uses: actions/checkout@v3
|
|
with:
|
|
repository: 'proxysql/jenkins-build-scripts'
|
|
ref: 'kubernetes'
|
|
# fetch-depth: 0
|
|
path: 'jenkins-build-scripts'
|
|
token: ${{ secrets.GH_TOKEN }}
|
|
submodules: 'false'
|
|
|
|
- name: Configure env.sh
|
|
run: |
|
|
cd jenkins-build-scripts
|
|
# configure paths
|
|
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
|
|
# select tests
|
|
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="${{ matrix.testgroup }}"' >> test/env.sh
|
|
#echo 'export TEST_PY_TAP_EXCL=""' >> test/env.sh
|
|
echo 'export MALLOC_CONF="retain:false"' >> test/env.sh
|
|
echo 'export' >> test/env.sh
|
|
cat test/env.sh
|
|
|
|
- name: Docker-hoster
|
|
run: |
|
|
cd ${{ github.workspace }}/jenkins-build-scripts/infra-docker-hoster
|
|
docker-compose up -d
|
|
|
|
- name: Run proxysql
|
|
run: |
|
|
set -x
|
|
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 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();"
|
|
|
|
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-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: TAP-tests
|
|
run: |
|
|
set +e
|
|
cd ${{ github.workspace }}/jenkins-build-scripts
|
|
|
|
source ./env.sh
|
|
env | sort
|
|
sudo -E ./test-scripts/bin/proxysql-tester.py
|
|
RC=$?
|
|
|
|
exit $RC
|
|
|
|
- name: Cleanup
|
|
if: ${{ always() }}
|
|
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-mysql57
|
|
sed -i "s/\${INFRA}-\${CONTAINER}-1/\${INFRA}_\${CONTAINER}_1/" docker-compose-init.bash
|
|
./docker-compose-destroy.bash
|
|
|
|
sudo chmod -R 777 ${{ github.workspace }}/*
|
|
echo "${{ matrix.testgroup }}" | tr -d '*|' | xargs -0 printf 'TESTGROUP=%s' >> $GITHUB_ENV
|
|
|
|
- name: Archive artifacts
|
|
if: ${{ failure() }}
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: ci-selftests-${{ env.GIT_VERSION }}-run#${{ github.run_number }}-${{ env.TESTGROUP }}
|
|
path: |
|
|
proxysql/ci_gcov_logs/
|
|
proxysql/ci_infra_logs/
|
|
proxysql/ci_tests_logs/
|
|
|