diff --git a/test/tap/README.md b/test/tap/README.md index 8b96dfe9a..4b1d21722 100644 --- a/test/tap/README.md +++ b/test/tap/README.md @@ -3,3 +3,23 @@ - `tap`: Contains TAP helper library for testing, and general utilities used across all tests. - `tests`: General test folder for either unitary or functional tests. - `tests_with_deps`: Test folder that holds all the tests that require special dependencies for being build. + +- `tests_grp_*`: tap test groups of specific tests with special configs applied via + - `pre-tests_grp_*.bash` script run before tests + - `pre-tests_grp_*.sql` script run before tests + - `post-tests_grp_*.bash` script run after tests + - `post-tests_grp_*.sql` script run after tests + +example test group `tests_grp_mytests` can be created by +``` +TG='mytests' +mkdir -p test/tap/tests_grp_$TG +cd test/tap/tests_grp_$TG +for T in $(ls -1 ../tests/); do ln -fsT ../tests/$T $T; done +cat > pre-test_grp_$TG-proxysql.sql << EOF +# run this test group with: +SET mysql-multiplexing='false'; +LOAD MYSQL VARIABLES TO RUNTIME; +SAVE MYSQL VARIABLES TO DISK; +EOF +``` diff --git a/test/tap/tests_grp_auto_increment_delay_multiplex/pre-tests_grp_auto_increment_delay_multiplex-proxysql.sql b/test/tap/tests_grp_auto_increment_delay_multiplex/pre-tests_grp_auto_increment_delay_multiplex-proxysql.sql new file mode 100644 index 000000000..fcd19e67e --- /dev/null +++ b/test/tap/tests_grp_auto_increment_delay_multiplex/pre-tests_grp_auto_increment_delay_multiplex-proxysql.sql @@ -0,0 +1,4 @@ +# proxysql settings +SET mysql-auto_increment_delay_multiplex=0; +LOAD MYSQL VARIABLES TO RUNTIME; +SAVE MYSQL VARIABLES TO DISK; diff --git a/test/tap/tests_grp_auto_increment_delay_multiplex/pre-tests_grp_auto_increment_delay_multiplex.bash b/test/tap/tests_grp_auto_increment_delay_multiplex/pre-tests_grp_auto_increment_delay_multiplex.bash new file mode 100755 index 000000000..078fc5a26 --- /dev/null +++ b/test/tap/tests_grp_auto_increment_delay_multiplex/pre-tests_grp_auto_increment_delay_multiplex.bash @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +# make sure we have correct cwd +pushd $(dirname $0) + +# symlink all files from ../tests +for T in $(ls -1 ../tests/); do +# echo "ln -fsT ../tests/$T $T" + ln -fsT ../tests/$T $T +done + +# remove irelevant +#rm -f test_*-t diff --git a/test/tap/tests_grp_multiplexing/pre-tests_grp_multiplexing-proxysql.sql b/test/tap/tests_grp_multiplexing/pre-tests_grp_multiplexing-proxysql.sql new file mode 100644 index 000000000..db2c00892 --- /dev/null +++ b/test/tap/tests_grp_multiplexing/pre-tests_grp_multiplexing-proxysql.sql @@ -0,0 +1,4 @@ +# proxysql settings +SET mysql-multiplexing='false'; +LOAD MYSQL VARIABLES TO RUNTIME; +SAVE MYSQL VARIABLES TO DISK; diff --git a/test/tap/tests_grp_multiplexing/pre-tests_grp_multiplexing.bash b/test/tap/tests_grp_multiplexing/pre-tests_grp_multiplexing.bash new file mode 100755 index 000000000..078fc5a26 --- /dev/null +++ b/test/tap/tests_grp_multiplexing/pre-tests_grp_multiplexing.bash @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +# make sure we have correct cwd +pushd $(dirname $0) + +# symlink all files from ../tests +for T in $(ls -1 ../tests/); do +# echo "ln -fsT ../tests/$T $T" + ln -fsT ../tests/$T $T +done + +# remove irelevant +#rm -f test_*-t diff --git a/test/tap/tests_grp_query_digests/pre-tests_grp_query_digests-proxysql.sql b/test/tap/tests_grp_query_digests/pre-tests_grp_query_digests-proxysql.sql new file mode 100644 index 000000000..4203e49f4 --- /dev/null +++ b/test/tap/tests_grp_query_digests/pre-tests_grp_query_digests-proxysql.sql @@ -0,0 +1,4 @@ +# proxysql settings +SET mysql-query_digests=0; +LOAD MYSQL VARIABLES TO RUNTIME; +SAVE MYSQL VARIABLES TO DISK; diff --git a/test/tap/tests_grp_query_digests/pre-tests_grp_query_digests.bash b/test/tap/tests_grp_query_digests/pre-tests_grp_query_digests.bash new file mode 100755 index 000000000..078fc5a26 --- /dev/null +++ b/test/tap/tests_grp_query_digests/pre-tests_grp_query_digests.bash @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +# make sure we have correct cwd +pushd $(dirname $0) + +# symlink all files from ../tests +for T in $(ls -1 ../tests/); do +# echo "ln -fsT ../tests/$T $T" + ln -fsT ../tests/$T $T +done + +# remove irelevant +#rm -f test_*-t diff --git a/test/tap/tests_grp_query_digests_keep_comment/pre-tests_grp_query_digests_keep_comment-proxysql.sql b/test/tap/tests_grp_query_digests_keep_comment/pre-tests_grp_query_digests_keep_comment-proxysql.sql new file mode 100644 index 000000000..975f759d7 --- /dev/null +++ b/test/tap/tests_grp_query_digests_keep_comment/pre-tests_grp_query_digests_keep_comment-proxysql.sql @@ -0,0 +1,4 @@ +# proxysql settings +SET mysql-query_digests_keep_comment=1; +LOAD MYSQL VARIABLES TO RUNTIME; +SAVE MYSQL VARIABLES TO DISK; diff --git a/test/tap/tests_grp_query_digests_keep_comment/pre-tests_grp_query_digests_keep_comment.bash b/test/tap/tests_grp_query_digests_keep_comment/pre-tests_grp_query_digests_keep_comment.bash new file mode 100755 index 000000000..078fc5a26 --- /dev/null +++ b/test/tap/tests_grp_query_digests_keep_comment/pre-tests_grp_query_digests_keep_comment.bash @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +# make sure we have correct cwd +pushd $(dirname $0) + +# symlink all files from ../tests +for T in $(ls -1 ../tests/); do +# echo "ln -fsT ../tests/$T $T" + ln -fsT ../tests/$T $T +done + +# remove irelevant +#rm -f test_*-t