mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-17 02:53:51 +08:00
The TAP testing PG framework meets our requirements for doing multinode/stand-alone-binaries testing for scenarios which need individual multiple PG instances (multi-node testing is a prime example). This commit adds the necessary wrappers to allow the use of the TAP testing framework in timescale code base. The README in "test/perl" directory gives a fair idea of how to write tap tests. A simple tap test has been added to provide a reference point for developers to write new ones. One can go to "build/tsl/test" and invoke "make checkprove" to see the tap test in action. Also includes changes for enabling github CI to run these taptests by installing the requisite dependencies. Includes changes to license checking scripts to handle new *.pl and *.pm files. Also added a new scripts/perltidyrc to aid in formatting of these files.
48 lines
1.3 KiB
Bash
Executable File
48 lines
1.3 KiB
Bash
Executable File
#! /bin/bash
|
|
|
|
SCRIPT_DIR=$(dirname ${0})
|
|
SRC_DIR=$(dirname ${SCRIPT_DIR})
|
|
|
|
# we skip license checks for:
|
|
# - the update script fragments, because the generated update scripts will
|
|
# contain the license at top, and we don't want to repeat it in the middle
|
|
# - test/sql/dump which contains auto-generated code
|
|
# - src/chunk_adatptive since it's still in BETA
|
|
|
|
check_file() {
|
|
SUFFIX0=
|
|
SUFFIX1=
|
|
|
|
if [[ ${1} == '-c' || ${1} == '-e' ]]; then
|
|
SUFFIX0='*.c'
|
|
SUFFIX1='*.h'
|
|
elif [[ ${1} == '-i' || ${1} == '-j' ]]; then
|
|
SUFFIX0='*.spec'
|
|
SUFFIX1='*.spec.in'
|
|
elif [[ ${1} == '-p' ]]; then
|
|
SUFFIX0='*.pl'
|
|
SUFFIX1='*.pm'
|
|
else
|
|
SUFFIX0='*.sql'
|
|
SUFFIX1='*.sql.in'
|
|
fi
|
|
|
|
find $2 -type f \( -name "${SUFFIX0}" -or -name "${SUFFIX1}" \) -and -not -path "${SRC_DIR}/sql/updates/*.sql" -and -not -path "${SRC_DIR}/test/sql/dump/*.sql" -and -not -path "${SRC_DIR}/src/chunk_adaptive.*" -print0 | xargs -0 -n1 $(dirname ${0})/check_file_license.sh ${1}
|
|
}
|
|
|
|
args=`getopt "c:e:i:j:p:s:t:" $*`; errcode=$?; set -- $args
|
|
|
|
ERRORCODE=0
|
|
|
|
while [[ ${1} ]]; do
|
|
if [[ ${1} == "--" ]]; then
|
|
break;
|
|
fi
|
|
check_file ${1} ${2}
|
|
FILE_ERR=${?}
|
|
ERRORCODE=$((${FILE_ERR} | ${ERRORCODE}));
|
|
shift; shift;
|
|
done
|
|
|
|
exit ${ERRORCODE};
|