Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lzh_me
TDengine
提交
f5ce39b3
TDengine
项目概览
lzh_me
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
f5ce39b3
编写于
11月 09, 2020
作者:
S
Shengliang Guan
提交者:
GitHub
11月 09, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #4153 from taosdata/xiaoping/add_test_case2
[TD-1794] <test> add test case
上级
ae67adfd
4a6a9ec7
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
165 addition
and
0 deletion
+165
-0
tests/perftest-scripts/perftest-query.sh
tests/perftest-scripts/perftest-query.sh
+92
-0
tests/pytest/fulltest.sh
tests/pytest/fulltest.sh
+3
-0
tests/pytest/wal/addOldWalTest.py
tests/pytest/wal/addOldWalTest.py
+70
-0
未找到文件。
tests/perftest-scripts/perftest-query.sh
0 → 100755
浏览文件 @
f5ce39b3
#!/bin/bash
today
=
`
date
+
"%Y%m%d"
`
WORK_DIR
=
/home/ubuntu/pxiao/
PERFORMANCE_TEST_REPORT
=
$TDENGINE_DIR
/tests/performance-test-report-
$today
.log
# Coloured Echoes #
function
red_echo
{
echo
-e
"
\0
33[31m
$@
\0
33[0m"
;
}
#
function
green_echo
{
echo
-e
"
\0
33[32m
$@
\0
33[0m"
;
}
#
function
yellow_echo
{
echo
-e
"
\0
33[33m
$@
\0
33[0m"
;
}
#
function
white_echo
{
echo
-e
"
\0
33[1;37m
$@
\0
33[0m"
;
}
#
# Coloured Printfs #
function
red_printf
{
printf
"
\0
33[31m
$@
\0
33[0m"
;
}
#
function
green_printf
{
printf
"
\0
33[32m
$@
\0
33[0m"
;
}
#
function
yellow_printf
{
printf
"
\0
33[33m
$@
\0
33[0m"
;
}
#
function
white_printf
{
printf
"
\0
33[1;37m
$@
\0
33[0m"
;
}
#
# Debugging Outputs #
function
white_brackets
{
local
args
=
"
$@
"
;
white_printf
"["
;
printf
"
${
args
}
"
;
white_printf
"]"
;
}
#
function
echoInfo
{
local
args
=
"
$@
"
;
white_brackets
$(
green_printf
"INFO"
)
&&
echo
"
${
args
}
"
;
}
#
function
echoWarn
{
local
args
=
"
$@
"
;
echo
"
$(
white_brackets
"
$(
yellow_printf
"WARN"
)
"
&&
echo
"
${
args
}
"
;
)
"
1>&2
;
}
#
function
echoError
{
local
args
=
"
$@
"
;
echo
"
$(
white_brackets
"
$(
red_printf
"ERROR"
)
"
&&
echo
"
${
args
}
"
;
)
"
1>&2
;
}
#
function
stopTaosd
{
echo
"Stop taosd"
systemctl stop taosd
snap stop tdengine
PID
=
`
ps
-ef
|grep
-w
taosd |
grep
-v
grep
|
awk
'{print $2}'
`
while
[
-n
"
$PID
"
]
do
pkill
-TERM
-x
taosd
sleep
1
PID
=
`
ps
-ef
|grep
-w
taosd |
grep
-v
grep
|
awk
'{print $2}'
`
done
}
function
buildTDengine
{
echoInfo
"Build TDengine"
cd
$WORK_DIR
/TDengine
git remote update
>
/dev/null
REMOTE_COMMIT
=
`
git rev-parse
--short
remotes/origin/develop
`
LOCAL_COMMIT
=
`
git rev-parse
--short
@
`
echo
" LOCAL:
$LOCAL_COMMIT
"
echo
"REMOTE:
$REMOTE_COMMIT
"
if
[
"
$LOCAL_COMMIT
"
==
"
$REMOTE_COMMIT
"
]
;
then
echo
"repo up-to-date"
else
echo
"repo need to pull"
git pull
>
/dev/null
LOCAL_COMMIT
=
`
git rev-parse
--short
@
`
cd
debug
rm
-rf
*
cmake ..
>
/dev/null
make
>
/dev/null
make
install
fi
}
function
runQueryPerfTest
{
nohup
$WORK_DIR
/TDengine/debug/build/bin/taosd
-c
/etc/taodperf/
>
/dev/null 2>&1 &
echoInfo
"Run Performance Test"
cd
$WORK_DIR
/TDengine/tests/pytest
python3 query/queryPerformance.py |
tee
-a
$PERFORMANCE_TEST_REPORT
}
function
sendReport
{
echo
"send report"
receiver
=
"pxiao@taosdata.com"
mimebody
=
"MIME-Version: 1.0
\n
Content-Type: text/html; charset=utf-8
\n
"
cd
$TDENGINE_DIR
sed
-i
's/\x1b\[[0-9;]*m//g'
$PERFORMANCE_TEST_REPORT
BODY_CONTENT
=
`
cat
$PERFORMANCE_TEST_REPORT
`
echo
-e
"to:
${
receiver
}
\n
subject: Query Performace Report
${
today
}
, commit ID:
${
LOCAL_COMMIT
}
\n\n
${
today
}
:
\n
${
BODY_CONTENT
}
"
|
\
(
cat
-
&&
uuencode
$PERFORMANCE_TEST_REPORT
performance-test-report-
$today
.log
)
|
\
ssmtp
"
${
receiver
}
"
&&
echo
"Report Sent!"
}
stopTaosd
buildTDengine
runQueryPerfTest
echoInfo
"Send Report"
sendReport
echoInfo
"End of Test"
tests/pytest/fulltest.sh
浏览文件 @
f5ce39b3
...
...
@@ -221,3 +221,6 @@ python3 ./test.py -f update/merge_commit_data2.py
python3 ./test.py
-f
update/merge_commit_data2_update0.py
python3 ./test.py
-f
update/merge_commit_last-0.py
python3 ./test.py
-f
update/merge_commit_last.py
# wal
python3 ./test.py
-f
wal/addOldWalTest.py
\ No newline at end of file
tests/pytest/wal/addOldWalTest.py
0 → 100644
浏览文件 @
f5ce39b3
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import
sys
import
os
import
taos
from
util.log
import
*
from
util.cases
import
*
from
util.sql
import
*
from
util.dnodes
import
*
class
TDTestCase
:
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
createOldDir
(
self
):
oldDir
=
tdDnodes
.
getDnodesRootDir
()
+
"dnode1/data/vnode/vnode2/wal/old"
os
.
system
(
"sudo mkdir -p %s"
%
oldDir
)
def
createOldDirAndAddWal
(
self
):
oldDir
=
tdDnodes
.
getDnodesRootDir
()
+
"dnode1/data/vnode/vnode2/wal/old"
os
.
system
(
"sudo echo 'test' >> %s/wal"
%
oldDir
)
def
run
(
self
):
tdSql
.
prepare
()
tdSql
.
execute
(
"create table t1(ts timestamp, a int)"
)
tdSql
.
execute
(
"insert into t1 values(now, 1)"
)
# create old dir only
self
.
createOldDir
()
os
.
system
(
"sudo kill -9 $(pgrep taosd)"
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
"use db"
)
tdSql
.
query
(
"select * from t1"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
1
,
1
)
# create old dir and add wal under old dir
self
.
createOldDir
()
self
.
createOldDirAndAddWal
()
os
.
system
(
"sudo kill -9 $(pgrep taosd)"
)
tdDnodes
.
start
(
1
)
tdSql
.
query
(
"select * from t1"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
1
,
1
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录