From 75d958f29d470aff759a17ab731e5a9cbee98a4a Mon Sep 17 00:00:00 2001 From: Rene Cannao Date: Sun, 22 Mar 2026 19:32:10 +0000 Subject: [PATCH] Fix hardcoded /home/rene/proxysql paths in pre-proxysql.bash scripts Replace hardcoded absolute paths with dynamically derived REPO_ROOT so these scripts work on any machine (CI runners, other developers). Co-Authored-By: Claude Opus 4.6 (1M context) --- test/tap/groups/default/pre-proxysql.bash | 6 ++++-- test/tap/groups/legacy/pre-proxysql.bash | 5 +++-- test/tap/groups/mysql84-gr/pre-proxysql.bash | 9 +++++---- test/tap/groups/mysql84/pre-proxysql.bash | 13 +++++++------ test/tap/groups/mysql90-gr/pre-proxysql.bash | 9 +++++---- test/tap/groups/mysql90/pre-proxysql.bash | 9 +++++---- test/tap/groups/mysql91-gr/pre-proxysql.bash | 9 +++++---- test/tap/groups/mysql91/pre-proxysql.bash | 9 +++++---- test/tap/groups/mysql92-gr/pre-proxysql.bash | 9 +++++---- test/tap/groups/mysql92/pre-proxysql.bash | 9 +++++---- test/tap/groups/mysql93-gr/pre-proxysql.bash | 9 +++++---- test/tap/groups/mysql93/pre-proxysql.bash | 9 +++++---- 12 files changed, 59 insertions(+), 46 deletions(-) diff --git a/test/tap/groups/default/pre-proxysql.bash b/test/tap/groups/default/pre-proxysql.bash index d961fad9b..d55551f69 100755 --- a/test/tap/groups/default/pre-proxysql.bash +++ b/test/tap/groups/default/pre-proxysql.bash @@ -8,8 +8,10 @@ set -o pipefail # Start ProxySQL Cluster if available -/home/rene/proxysql/test/infra/control/cluster_start.bash -/home/rene/proxysql/test/infra/control/cluster_init.bash +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(cd "${SCRIPT_DIR}/../../.." && pwd)" +"${REPO_ROOT}/test/infra/control/cluster_start.bash" +"${REPO_ROOT}/test/infra/control/cluster_init.bash" # wait for cluster to stabilize sleep 10 diff --git a/test/tap/groups/legacy/pre-proxysql.bash b/test/tap/groups/legacy/pre-proxysql.bash index 84e5c186c..f7daac7cc 100755 --- a/test/tap/groups/legacy/pre-proxysql.bash +++ b/test/tap/groups/legacy/pre-proxysql.bash @@ -1,13 +1,14 @@ #!/usr/bin/env bash set -e set -o pipefail +REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" # # Start ProxySQL Cluster if available # inherits env from tester script # -/home/rene/proxysql/test/infra/control/cluster_start.bash -/home/rene/proxysql/test/infra/control/cluster_init.bash +${REPO_ROOT}/test/infra/control/cluster_start.bash +${REPO_ROOT}/test/infra/control/cluster_init.bash # wait for cluster to stabilize sleep 10 diff --git a/test/tap/groups/mysql84-gr/pre-proxysql.bash b/test/tap/groups/mysql84-gr/pre-proxysql.bash index c1e7e33c1..4fd4c96d2 100755 --- a/test/tap/groups/mysql84-gr/pre-proxysql.bash +++ b/test/tap/groups/mysql84-gr/pre-proxysql.bash @@ -1,6 +1,7 @@ #!/usr/bin/env bash set -e set -o pipefail +REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" # # change infra config # inherits env from tester script @@ -11,7 +12,7 @@ set -o pipefail INFRA=infra-$(basename $(dirname "$0") | sed 's/-g[0-9]//' | sed 's/_.*//') # destroy running infras -/home/rene/proxysql/test/infra/control/infra-default/docker-compose-destroy.bash +${REPO_ROOT}/test/infra/control/infra-default/docker-compose-destroy.bash # cleanup mysql ${SSLOPT} -h127.0.0.1 -P6032 -uadmin -padmin -e " \ DELETE FROM mysql_users; \ @@ -38,11 +39,11 @@ SAVE PGSQL SERVERS TO DISK; \ " 2>&1 | grep -vP 'mysql: .?Warning' # load environment for infra -source /home/rene/proxysql/test/infra/control/${INFRA}/.env +source ${REPO_ROOT}/test/infra/control/${INFRA}/.env # Start infra -# /home/rene/proxysql/test/infra/control/infra-docker-hoster/docker-compose-init.bash -/home/rene/proxysql/test/infra/control/${INFRA}/docker-compose-init.bash +# ${REPO_ROOT}/test/infra/control/infra-docker-hoster/docker-compose-init.bash +${REPO_ROOT}/test/infra/control/${INFRA}/docker-compose-init.bash # create default users for MYUSER in root user testuser sbtest1 sbtest2 sbtest3 sbtest4 ssluser ; do diff --git a/test/tap/groups/mysql84/pre-proxysql.bash b/test/tap/groups/mysql84/pre-proxysql.bash index b407e30c7..a9c874b23 100755 --- a/test/tap/groups/mysql84/pre-proxysql.bash +++ b/test/tap/groups/mysql84/pre-proxysql.bash @@ -1,21 +1,22 @@ #!/usr/bin/env bash set -e set -o pipefail +REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" # # change infra config # inherits env from tester script # # Start ProxySQL Cluster if available -/home/rene/proxysql/test/infra/control/cluster_start.bash -/home/rene/proxysql/test/infra/control/cluster_init.bash +${REPO_ROOT}/test/infra/control/cluster_start.bash +${REPO_ROOT}/test/infra/control/cluster_init.bash [[ $(mysql --skip-ssl-verify-server-cert -h 2>&1) =~ skip-ssl-verify-server-cert ]] || export SSLOPT=--skip-ssl-verify-server-cert INFRA=infra-$(basename $(dirname "$0") | sed 's/-g[0-9]//' | sed 's/_.*//') # destroy running infras -/home/rene/proxysql/test/infra/control/infra-default/docker-compose-destroy.bash +${REPO_ROOT}/test/infra/control/infra-default/docker-compose-destroy.bash # cleanup mysql ${SSLOPT} -h127.0.0.1 -P6032 -uadmin -padmin -e " \ DELETE FROM mysql_users; \ @@ -42,11 +43,11 @@ SAVE PGSQL SERVERS TO DISK; \ " 2>&1 | grep -vP 'mysql: .?Warning' # load environment for infra -source /home/rene/proxysql/test/infra/control/${INFRA}/.env +source ${REPO_ROOT}/test/infra/control/${INFRA}/.env # Start infra -# /home/rene/proxysql/test/infra/control/infra-docker-hoster/docker-compose-init.bash -/home/rene/proxysql/test/infra/control/${INFRA}/docker-compose-init.bash +# ${REPO_ROOT}/test/infra/control/infra-docker-hoster/docker-compose-init.bash +${REPO_ROOT}/test/infra/control/${INFRA}/docker-compose-init.bash # create default users for MYUSER in root user testuser sbtest1 sbtest2 sbtest3 sbtest4 ssluser ; do diff --git a/test/tap/groups/mysql90-gr/pre-proxysql.bash b/test/tap/groups/mysql90-gr/pre-proxysql.bash index c1e7e33c1..4fd4c96d2 100755 --- a/test/tap/groups/mysql90-gr/pre-proxysql.bash +++ b/test/tap/groups/mysql90-gr/pre-proxysql.bash @@ -1,6 +1,7 @@ #!/usr/bin/env bash set -e set -o pipefail +REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" # # change infra config # inherits env from tester script @@ -11,7 +12,7 @@ set -o pipefail INFRA=infra-$(basename $(dirname "$0") | sed 's/-g[0-9]//' | sed 's/_.*//') # destroy running infras -/home/rene/proxysql/test/infra/control/infra-default/docker-compose-destroy.bash +${REPO_ROOT}/test/infra/control/infra-default/docker-compose-destroy.bash # cleanup mysql ${SSLOPT} -h127.0.0.1 -P6032 -uadmin -padmin -e " \ DELETE FROM mysql_users; \ @@ -38,11 +39,11 @@ SAVE PGSQL SERVERS TO DISK; \ " 2>&1 | grep -vP 'mysql: .?Warning' # load environment for infra -source /home/rene/proxysql/test/infra/control/${INFRA}/.env +source ${REPO_ROOT}/test/infra/control/${INFRA}/.env # Start infra -# /home/rene/proxysql/test/infra/control/infra-docker-hoster/docker-compose-init.bash -/home/rene/proxysql/test/infra/control/${INFRA}/docker-compose-init.bash +# ${REPO_ROOT}/test/infra/control/infra-docker-hoster/docker-compose-init.bash +${REPO_ROOT}/test/infra/control/${INFRA}/docker-compose-init.bash # create default users for MYUSER in root user testuser sbtest1 sbtest2 sbtest3 sbtest4 ssluser ; do diff --git a/test/tap/groups/mysql90/pre-proxysql.bash b/test/tap/groups/mysql90/pre-proxysql.bash index c1e7e33c1..4fd4c96d2 100755 --- a/test/tap/groups/mysql90/pre-proxysql.bash +++ b/test/tap/groups/mysql90/pre-proxysql.bash @@ -1,6 +1,7 @@ #!/usr/bin/env bash set -e set -o pipefail +REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" # # change infra config # inherits env from tester script @@ -11,7 +12,7 @@ set -o pipefail INFRA=infra-$(basename $(dirname "$0") | sed 's/-g[0-9]//' | sed 's/_.*//') # destroy running infras -/home/rene/proxysql/test/infra/control/infra-default/docker-compose-destroy.bash +${REPO_ROOT}/test/infra/control/infra-default/docker-compose-destroy.bash # cleanup mysql ${SSLOPT} -h127.0.0.1 -P6032 -uadmin -padmin -e " \ DELETE FROM mysql_users; \ @@ -38,11 +39,11 @@ SAVE PGSQL SERVERS TO DISK; \ " 2>&1 | grep -vP 'mysql: .?Warning' # load environment for infra -source /home/rene/proxysql/test/infra/control/${INFRA}/.env +source ${REPO_ROOT}/test/infra/control/${INFRA}/.env # Start infra -# /home/rene/proxysql/test/infra/control/infra-docker-hoster/docker-compose-init.bash -/home/rene/proxysql/test/infra/control/${INFRA}/docker-compose-init.bash +# ${REPO_ROOT}/test/infra/control/infra-docker-hoster/docker-compose-init.bash +${REPO_ROOT}/test/infra/control/${INFRA}/docker-compose-init.bash # create default users for MYUSER in root user testuser sbtest1 sbtest2 sbtest3 sbtest4 ssluser ; do diff --git a/test/tap/groups/mysql91-gr/pre-proxysql.bash b/test/tap/groups/mysql91-gr/pre-proxysql.bash index c1e7e33c1..4fd4c96d2 100755 --- a/test/tap/groups/mysql91-gr/pre-proxysql.bash +++ b/test/tap/groups/mysql91-gr/pre-proxysql.bash @@ -1,6 +1,7 @@ #!/usr/bin/env bash set -e set -o pipefail +REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" # # change infra config # inherits env from tester script @@ -11,7 +12,7 @@ set -o pipefail INFRA=infra-$(basename $(dirname "$0") | sed 's/-g[0-9]//' | sed 's/_.*//') # destroy running infras -/home/rene/proxysql/test/infra/control/infra-default/docker-compose-destroy.bash +${REPO_ROOT}/test/infra/control/infra-default/docker-compose-destroy.bash # cleanup mysql ${SSLOPT} -h127.0.0.1 -P6032 -uadmin -padmin -e " \ DELETE FROM mysql_users; \ @@ -38,11 +39,11 @@ SAVE PGSQL SERVERS TO DISK; \ " 2>&1 | grep -vP 'mysql: .?Warning' # load environment for infra -source /home/rene/proxysql/test/infra/control/${INFRA}/.env +source ${REPO_ROOT}/test/infra/control/${INFRA}/.env # Start infra -# /home/rene/proxysql/test/infra/control/infra-docker-hoster/docker-compose-init.bash -/home/rene/proxysql/test/infra/control/${INFRA}/docker-compose-init.bash +# ${REPO_ROOT}/test/infra/control/infra-docker-hoster/docker-compose-init.bash +${REPO_ROOT}/test/infra/control/${INFRA}/docker-compose-init.bash # create default users for MYUSER in root user testuser sbtest1 sbtest2 sbtest3 sbtest4 ssluser ; do diff --git a/test/tap/groups/mysql91/pre-proxysql.bash b/test/tap/groups/mysql91/pre-proxysql.bash index c1e7e33c1..4fd4c96d2 100755 --- a/test/tap/groups/mysql91/pre-proxysql.bash +++ b/test/tap/groups/mysql91/pre-proxysql.bash @@ -1,6 +1,7 @@ #!/usr/bin/env bash set -e set -o pipefail +REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" # # change infra config # inherits env from tester script @@ -11,7 +12,7 @@ set -o pipefail INFRA=infra-$(basename $(dirname "$0") | sed 's/-g[0-9]//' | sed 's/_.*//') # destroy running infras -/home/rene/proxysql/test/infra/control/infra-default/docker-compose-destroy.bash +${REPO_ROOT}/test/infra/control/infra-default/docker-compose-destroy.bash # cleanup mysql ${SSLOPT} -h127.0.0.1 -P6032 -uadmin -padmin -e " \ DELETE FROM mysql_users; \ @@ -38,11 +39,11 @@ SAVE PGSQL SERVERS TO DISK; \ " 2>&1 | grep -vP 'mysql: .?Warning' # load environment for infra -source /home/rene/proxysql/test/infra/control/${INFRA}/.env +source ${REPO_ROOT}/test/infra/control/${INFRA}/.env # Start infra -# /home/rene/proxysql/test/infra/control/infra-docker-hoster/docker-compose-init.bash -/home/rene/proxysql/test/infra/control/${INFRA}/docker-compose-init.bash +# ${REPO_ROOT}/test/infra/control/infra-docker-hoster/docker-compose-init.bash +${REPO_ROOT}/test/infra/control/${INFRA}/docker-compose-init.bash # create default users for MYUSER in root user testuser sbtest1 sbtest2 sbtest3 sbtest4 ssluser ; do diff --git a/test/tap/groups/mysql92-gr/pre-proxysql.bash b/test/tap/groups/mysql92-gr/pre-proxysql.bash index c1e7e33c1..4fd4c96d2 100755 --- a/test/tap/groups/mysql92-gr/pre-proxysql.bash +++ b/test/tap/groups/mysql92-gr/pre-proxysql.bash @@ -1,6 +1,7 @@ #!/usr/bin/env bash set -e set -o pipefail +REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" # # change infra config # inherits env from tester script @@ -11,7 +12,7 @@ set -o pipefail INFRA=infra-$(basename $(dirname "$0") | sed 's/-g[0-9]//' | sed 's/_.*//') # destroy running infras -/home/rene/proxysql/test/infra/control/infra-default/docker-compose-destroy.bash +${REPO_ROOT}/test/infra/control/infra-default/docker-compose-destroy.bash # cleanup mysql ${SSLOPT} -h127.0.0.1 -P6032 -uadmin -padmin -e " \ DELETE FROM mysql_users; \ @@ -38,11 +39,11 @@ SAVE PGSQL SERVERS TO DISK; \ " 2>&1 | grep -vP 'mysql: .?Warning' # load environment for infra -source /home/rene/proxysql/test/infra/control/${INFRA}/.env +source ${REPO_ROOT}/test/infra/control/${INFRA}/.env # Start infra -# /home/rene/proxysql/test/infra/control/infra-docker-hoster/docker-compose-init.bash -/home/rene/proxysql/test/infra/control/${INFRA}/docker-compose-init.bash +# ${REPO_ROOT}/test/infra/control/infra-docker-hoster/docker-compose-init.bash +${REPO_ROOT}/test/infra/control/${INFRA}/docker-compose-init.bash # create default users for MYUSER in root user testuser sbtest1 sbtest2 sbtest3 sbtest4 ssluser ; do diff --git a/test/tap/groups/mysql92/pre-proxysql.bash b/test/tap/groups/mysql92/pre-proxysql.bash index c1e7e33c1..4fd4c96d2 100755 --- a/test/tap/groups/mysql92/pre-proxysql.bash +++ b/test/tap/groups/mysql92/pre-proxysql.bash @@ -1,6 +1,7 @@ #!/usr/bin/env bash set -e set -o pipefail +REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" # # change infra config # inherits env from tester script @@ -11,7 +12,7 @@ set -o pipefail INFRA=infra-$(basename $(dirname "$0") | sed 's/-g[0-9]//' | sed 's/_.*//') # destroy running infras -/home/rene/proxysql/test/infra/control/infra-default/docker-compose-destroy.bash +${REPO_ROOT}/test/infra/control/infra-default/docker-compose-destroy.bash # cleanup mysql ${SSLOPT} -h127.0.0.1 -P6032 -uadmin -padmin -e " \ DELETE FROM mysql_users; \ @@ -38,11 +39,11 @@ SAVE PGSQL SERVERS TO DISK; \ " 2>&1 | grep -vP 'mysql: .?Warning' # load environment for infra -source /home/rene/proxysql/test/infra/control/${INFRA}/.env +source ${REPO_ROOT}/test/infra/control/${INFRA}/.env # Start infra -# /home/rene/proxysql/test/infra/control/infra-docker-hoster/docker-compose-init.bash -/home/rene/proxysql/test/infra/control/${INFRA}/docker-compose-init.bash +# ${REPO_ROOT}/test/infra/control/infra-docker-hoster/docker-compose-init.bash +${REPO_ROOT}/test/infra/control/${INFRA}/docker-compose-init.bash # create default users for MYUSER in root user testuser sbtest1 sbtest2 sbtest3 sbtest4 ssluser ; do diff --git a/test/tap/groups/mysql93-gr/pre-proxysql.bash b/test/tap/groups/mysql93-gr/pre-proxysql.bash index c1e7e33c1..4fd4c96d2 100755 --- a/test/tap/groups/mysql93-gr/pre-proxysql.bash +++ b/test/tap/groups/mysql93-gr/pre-proxysql.bash @@ -1,6 +1,7 @@ #!/usr/bin/env bash set -e set -o pipefail +REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" # # change infra config # inherits env from tester script @@ -11,7 +12,7 @@ set -o pipefail INFRA=infra-$(basename $(dirname "$0") | sed 's/-g[0-9]//' | sed 's/_.*//') # destroy running infras -/home/rene/proxysql/test/infra/control/infra-default/docker-compose-destroy.bash +${REPO_ROOT}/test/infra/control/infra-default/docker-compose-destroy.bash # cleanup mysql ${SSLOPT} -h127.0.0.1 -P6032 -uadmin -padmin -e " \ DELETE FROM mysql_users; \ @@ -38,11 +39,11 @@ SAVE PGSQL SERVERS TO DISK; \ " 2>&1 | grep -vP 'mysql: .?Warning' # load environment for infra -source /home/rene/proxysql/test/infra/control/${INFRA}/.env +source ${REPO_ROOT}/test/infra/control/${INFRA}/.env # Start infra -# /home/rene/proxysql/test/infra/control/infra-docker-hoster/docker-compose-init.bash -/home/rene/proxysql/test/infra/control/${INFRA}/docker-compose-init.bash +# ${REPO_ROOT}/test/infra/control/infra-docker-hoster/docker-compose-init.bash +${REPO_ROOT}/test/infra/control/${INFRA}/docker-compose-init.bash # create default users for MYUSER in root user testuser sbtest1 sbtest2 sbtest3 sbtest4 ssluser ; do diff --git a/test/tap/groups/mysql93/pre-proxysql.bash b/test/tap/groups/mysql93/pre-proxysql.bash index c1e7e33c1..4fd4c96d2 100755 --- a/test/tap/groups/mysql93/pre-proxysql.bash +++ b/test/tap/groups/mysql93/pre-proxysql.bash @@ -1,6 +1,7 @@ #!/usr/bin/env bash set -e set -o pipefail +REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" # # change infra config # inherits env from tester script @@ -11,7 +12,7 @@ set -o pipefail INFRA=infra-$(basename $(dirname "$0") | sed 's/-g[0-9]//' | sed 's/_.*//') # destroy running infras -/home/rene/proxysql/test/infra/control/infra-default/docker-compose-destroy.bash +${REPO_ROOT}/test/infra/control/infra-default/docker-compose-destroy.bash # cleanup mysql ${SSLOPT} -h127.0.0.1 -P6032 -uadmin -padmin -e " \ DELETE FROM mysql_users; \ @@ -38,11 +39,11 @@ SAVE PGSQL SERVERS TO DISK; \ " 2>&1 | grep -vP 'mysql: .?Warning' # load environment for infra -source /home/rene/proxysql/test/infra/control/${INFRA}/.env +source ${REPO_ROOT}/test/infra/control/${INFRA}/.env # Start infra -# /home/rene/proxysql/test/infra/control/infra-docker-hoster/docker-compose-init.bash -/home/rene/proxysql/test/infra/control/${INFRA}/docker-compose-init.bash +# ${REPO_ROOT}/test/infra/control/infra-docker-hoster/docker-compose-init.bash +${REPO_ROOT}/test/infra/control/${INFRA}/docker-compose-init.bash # create default users for MYUSER in root user testuser sbtest1 sbtest2 sbtest3 sbtest4 ssluser ; do