Skip to content

Commit

Permalink
Merge pull request #4614 from sysown/v2.6.x-add_test_groups
Browse files Browse the repository at this point in the history
V2.6.x add test groups
  • Loading branch information
renecannao authored Aug 21, 2024
2 parents da0cec0 + c512f90 commit b95f2bc
Show file tree
Hide file tree
Showing 7 changed files with 235 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/tap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
15 changes: 15 additions & 0 deletions test/tap/groups/gen-groups-json.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

# make sure we have correct cwd
pushd $(dirname $0) > /dev/null


GRPS=$(echo $(ls -d */ | tr -d / | awk '{ print "\""$1"\"," }'))

echo "{" > groups.json
ls -1 ../tests/*-t | sed 's|../tests/||' | awk '{ print " \""$0"\" : [ \"default\", __GRPS__ ]," }' >> groups.json
ls -1 ../tests_with_deps/deprecate_eof_support/*-t | sed 's|../tests_with_deps/deprecate_eof_support/||' | awk '{ print " \""$0"\" : [ \"default\", __GRPS__ ]," }' >> groups.json
sed -i '$ s/.$//' groups.json
echo "}" >> groups.json
sed -i "s/__GRPS__/${GRPS%,}/" groups.json

184 changes: 184 additions & 0 deletions test/tap/groups/groups.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# proxysql settings
SET mysql-auto_increment_delay_multiplex=0;
LOAD MYSQL VARIABLES TO RUNTIME;
SAVE MYSQL VARIABLES TO DISK;
4 changes: 4 additions & 0 deletions test/tap/groups/mysql-multiplexing=false/pre-proxysql.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# proxysql settings
SET mysql-multiplexing='false';
LOAD MYSQL VARIABLES TO RUNTIME;
SAVE MYSQL VARIABLES TO DISK;
4 changes: 4 additions & 0 deletions test/tap/groups/mysql-query_digests=0/pre-proxysql.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# proxysql settings
SET mysql-query_digests=0;
LOAD MYSQL VARIABLES TO RUNTIME;
SAVE MYSQL VARIABLES TO DISK;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# proxysql settings
SET mysql-query_digests_keep_comment=1;
LOAD MYSQL VARIABLES TO RUNTIME;
SAVE MYSQL VARIABLES TO DISK;

0 comments on commit b95f2bc

Please sign in to comment.