Merge pull request #5224 from taosdata/xiaoping/add_test_case

coverage test/CI: add start time for each case
This commit is contained in:
huili 2021-02-22 15:42:40 +08:00 committed by GitHub
commit 3d407ab587
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 8 deletions

View File

@ -56,9 +56,9 @@ function runGeneralCaseOneByOne {
case=`echo $line | grep sim$ |awk '{print $NF}'` case=`echo $line | grep sim$ |awk '{print $NF}'`
if [ -n "$case" ]; then if [ -n "$case" ]; then
./test.sh -f $case > /dev/null 2>&1 && \ date +%F\ %T | tee -a $TDENGINE_COVERAGE_REPORT && ./test.sh -f $case > /dev/null 2>&1 && \
echo -e "${GREEN}$case success${NC}" | tee -a $TDENGINE_COVERAGE_REPORT || \ ( grep -q 'script.*success.*m$' ../../sim/tsim/log/taoslog0.0 && echo -e "${GREEN}$case success${NC}" | tee -a $TDENGINE_COVERAGE_REPORT ) \
echo -e "${RED}$case failed${NC}" | tee -a $TDENGINE_COVERAGE_REPORT || echo -e "${RED}$case failed${NC}" | tee -a $TDENGINE_COVERAGE_REPORT
fi fi
fi fi
done < $1 done < $1

View File

@ -64,7 +64,7 @@ function runQueryPerfTest {
[ -f $PERFORMANCE_TEST_REPORT ] && rm $PERFORMANCE_TEST_REPORT [ -f $PERFORMANCE_TEST_REPORT ] && rm $PERFORMANCE_TEST_REPORT
nohup $WORK_DIR/TDengine/debug/build/bin/taosd -c /etc/taosperf/ > /dev/null 2>&1 & nohup $WORK_DIR/TDengine/debug/build/bin/taosd -c /etc/taosperf/ > /dev/null 2>&1 &
echoInfo "Wait TDengine to start" echoInfo "Wait TDengine to start"
sleep 60 sleep 120
echoInfo "Run Performance Test" echoInfo "Run Performance Test"
cd $WORK_DIR/TDengine/tests/pytest cd $WORK_DIR/TDengine/tests/pytest
@ -72,7 +72,7 @@ function runQueryPerfTest {
python3 insert/insertFromCSVPerformance.py -c $LOCAL_COMMIT | tee -a $PERFORMANCE_TEST_REPORT python3 insert/insertFromCSVPerformance.py -c $LOCAL_COMMIT | tee -a $PERFORMANCE_TEST_REPORT
yes | taosdemo -c /etc/taosperf/ -d taosdemo_insert_test -t 1000 -n 1000 > taosdemoperf.txt yes | taosdemo -c /etc/taosperf/ -d taosdemo_insert_test -x > taosdemoperf.txt
CREATETABLETIME=`grep 'Spent' taosdemoperf.txt | awk 'NR==1{print $2}'` CREATETABLETIME=`grep 'Spent' taosdemoperf.txt | awk 'NR==1{print $2}'`
INSERTRECORDSTIME=`grep 'Spent' taosdemoperf.txt | awk 'NR==2{print $2}'` INSERTRECORDSTIME=`grep 'Spent' taosdemoperf.txt | awk 'NR==2{print $2}'`

View File

@ -41,7 +41,23 @@ class TDTestCase:
tdSql.query("select * from ampere") tdSql.query("select * from ampere")
tdSql.checkRows(2) tdSql.checkRows(2)
tdSql.checkData(0, 6, None) tdSql.checkData(0, 6, None)
tdSql.checkData(1, 6, 'test') tdSql.checkData(1, 6, 'test')
# Test case for: https://jira.taosdata.com:18080/browse/TD-2423
tdSql.execute("create table stb(ts timestamp, col1 int, col2 nchar(20)) tags(tg1 int, tg2 binary(20), tg3 nchar(25))")
tdSql.execute("insert into tb1 using stb(tg1, tg3) tags(1, 'test1') values(now, 1, 'test1')")
tdSql.query("select *, tg1, tg2, tg3 from tb1")
tdSql.checkRows(1)
tdSql.checkData(0, 3, 1)
tdSql.checkData(0, 4, None)
tdSql.checkData(0, 5, 'test1')
tdSql.execute("create table tb2 using stb(tg3, tg2) tags('test3', 'test2')")
tdSql.query("select tg1, tg2, tg3 from tb2")
tdSql.checkRows(1)
tdSql.checkData(0, 0, None)
tdSql.checkData(0, 1, 'test2')
tdSql.checkData(0, 2, 'test3')
def stop(self): def stop(self):
tdSql.close() tdSql.close()

View File

@ -21,8 +21,8 @@ function runSimCaseOneByOne {
if [[ $line =~ ^./test.sh* ]] || [[ $line =~ ^run* ]]; then if [[ $line =~ ^./test.sh* ]] || [[ $line =~ ^run* ]]; then
case=`echo $line | grep sim$ |awk '{print $NF}'` case=`echo $line | grep sim$ |awk '{print $NF}'`
IN_TDINTERNAL="community" IN_TDINTERNAL="community"
start_time=`date +%s` start_time=`date +%s`
IN_TDINTERNAL="community" date +%F\ %T | tee -a out.log
if [[ "$tests_dir" == *"$IN_TDINTERNAL"* ]]; then if [[ "$tests_dir" == *"$IN_TDINTERNAL"* ]]; then
echo -n $case echo -n $case
./test.sh -f $case > /dev/null 2>&1 && \ ./test.sh -f $case > /dev/null 2>&1 && \
@ -53,6 +53,7 @@ function runSimCaseOneByOnefq {
start_time=`date +%s` start_time=`date +%s`
IN_TDINTERNAL="community" IN_TDINTERNAL="community"
date +%F\ %T | tee -a out.log
if [[ "$tests_dir" == *"$IN_TDINTERNAL"* ]]; then if [[ "$tests_dir" == *"$IN_TDINTERNAL"* ]]; then
echo -n $case echo -n $case
./test.sh -f $case > /dev/null 2>&1 && \ ./test.sh -f $case > /dev/null 2>&1 && \
@ -94,6 +95,7 @@ function runPyCaseOneByOne {
case=`echo $line|awk '{print $NF}'` case=`echo $line|awk '{print $NF}'`
fi fi
start_time=`date +%s` start_time=`date +%s`
date +%F\ %T | tee -a pytest-out.log
echo -n $case echo -n $case
$line > /dev/null 2>&1 && \ $line > /dev/null 2>&1 && \
echo -e "${GREEN} success${NC}" | tee -a pytest-out.log || \ echo -e "${GREEN} success${NC}" | tee -a pytest-out.log || \
@ -122,6 +124,7 @@ function runPyCaseOneByOnefq {
case=`echo $line|awk '{print $NF}'` case=`echo $line|awk '{print $NF}'`
fi fi
start_time=`date +%s` start_time=`date +%s`
date +%F\ %T | tee -a pytest-out.log
echo -n $case echo -n $case
$line > /dev/null 2>&1 && \ $line > /dev/null 2>&1 && \
echo -e "${GREEN} success${NC}" | tee -a pytest-out.log || \ echo -e "${GREEN} success${NC}" | tee -a pytest-out.log || \