test:add container sh

This commit is contained in:
happyguoxy 2025-03-21 17:18:44 +08:00
parent fad7fe4b32
commit d63cad4b6b
1 changed files with 61 additions and 0 deletions

View File

@ -0,0 +1,61 @@
#!/bin/bash
function usage() {
echo "$0"
echo -e "\t -d work dir"
echo -e "\t -b branch id"
echo -e "\t -h help"
}
while getopts "d:b:w:f:h" opt; do
case $opt in
d)
WORKDIR=$OPTARG
;;
b)
branch_name_id=$OPTARG
;;
h)
usage
exit 0
;;
\?)
echo "Invalid option: -$OPTARG"
usage
exit 0
;;
esac
done
if [ -z "$branch_name_id" ]; then
usage
exit 1
fi
if [ -z "$WORKDIR" ]; then
usage
exit 1
fi
# enterprise edition
INTERNAL_REPDIR=$WORKDIR/TDinternal
REPDIR_DEBUG=$WORKDIR/debugNoSan/
REP_MOUNT_DEBUG="${REPDIR_DEBUG}:/home/TDinternal/debug/"
REP_MOUNT_PARAM="$INTERNAL_REPDIR:/home/TDinternal"
CONTAINER_TESTDIR=/home/TDinternal/community
ulimit -c unlimited
docker run \
--name taos_coverage \
-v $REP_MOUNT_PARAM \
-v $REP_MOUNT_DEBUG \
--rm --ulimit core=-1 taos_test:v1.0 sh -c "bash ${CONTAINER_TESTDIR}/tests/run_workflow_coverage.sh -b ${branch_name_id}"
ret=$?
exit $ret