Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
475fa75e
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
475fa75e
编写于
4月 20, 2023
作者:
H
Hui Li
提交者:
GitHub
4月 20, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #20984 from taosdata/test/main/TS-3209
test:add testcase of compatibility.py for TS-3209
上级
989f1cdd
2c03ca9c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
91 addition
and
14 deletion
+91
-14
tests/system-test/0-others/TS-3131.tsql
tests/system-test/0-others/TS-3131.tsql
+71
-0
tests/system-test/0-others/compa4096.json
tests/system-test/0-others/compa4096.json
+2
-12
tests/system-test/0-others/compatibility.py
tests/system-test/0-others/compatibility.py
+18
-2
未找到文件。
tests/system-test/0-others/TS-3131.tsql
0 → 100644
浏览文件 @
475fa75e
drop database if exists d0;
create database d0 replica 1 keep 365 minRows 100 maxRows 4096 comp 2 vgroups 2 precision 'ms';
use d0;
create table if not exists almlog (starttime timestamp,endtime timestamp,durationtime int, alarmno int, alarmtext nchar(256),isactive nchar(64)) tags (mcid nchar(16));
create table if not exists mplog (starttime timestamp,mpid int, paravalue nchar(256),mptype nchar(32)) tags (mcid nchar(16));
create table if not exists mdlog (starttime timestamp,endtime timestamp,durationtime int, statuscode int, npcgmname nchar(256),attr int) tags (mcid nchar(16));
create table if not exists nrglog (updatetime timestamp,energyvalue double,enerygyincrease double) tags (mcid nchar(16),enerygytype nchar(16));
create table almlog_m201 using almlog tags("m201");
create table almlog_m0103 using almlog tags("m0103");
create table almlog_m0103_20031 using almlog tags("m0103");
create table almlog_m0103_20032 using almlog tags("m0103");
create table almlog_m0103_3003 using almlog tags("m0103");
create table almlog_m0103_20033 using almlog tags("m0103");
create table almlog_m0103_30031 using almlog tags("m0103");
create table almlog_m0201 using almlog tags("m0201");
create table almlog_m0102 using almlog tags("m0102");
create table almlog_m0101 using almlog tags("m0101");
create table almlog_m1002 using almlog tags("m1002");
create table mplog_m0204_4 using mplog tags("m0204");
create table mplog_m0204_5 using mplog tags("m0204");
create table mplog_m0204_6 using mplog tags("m0204");
create table mplog_m0204_12 using mplog tags("m0204");
create table mplog_m0204 using mplog tags("m0204");
create table mplog_m201 using mplog tags("m201");
create table mplog_m0102 using mplog tags("m0102");
create table mplog_m1101 using mplog tags("m1101");
create table mdlog_m0102 using mplog tags("m0102");
create table mdlog_m0504 using mplog tags("m0504");
create table mdlog_m0505 using mplog tags("m0505");
create table mdlog_m0507 using mplog tags("m0507");
create table mdlog_m1002 using mplog tags("m1002");
create table mdlog_m3201 using mplog tags("m3201");
create table mdlog_m0201 using mplog tags("m0201");
create table mdlog_m1102 using mplog tags("m1102");
create table mdlog_m201 using mplog tags("m201");
create table nrglog_m201_electricvalue1 using nrglog tags("m201","electricValue1");
create table nrglog_m201_oilvalue1 using nrglog tags("m201","oilValue1");
create table nrglog_m201_gasvalue1 using nrglog tags("m201","gasValue1");
create table nrglog_m201_watervalue1 using nrglog tags("m201","waterValue1");
create table nrglog_m0101_oilvalue1 using nrglog tags("m0101","oilValue1");
create table nrglog_m0101_watervalue1 using nrglog tags("m0101","waterValue1");
create table nrglog_m0102_gasvalue1 using nrglog tags("m0102","gasValue1");
create table nrglog_m1903 using nrglog tags("m1903",NULL);
create table nrglog_m2802 using nrglog tags("m2802",NULL);
create table nrglog_m2101 using nrglog tags("m2101",NULL);
create table nrglog_m0102 using nrglog tags("m0102",NULL);
create table nrglog_m0101_electricvalue1 using nrglog tags("m0101","electricValue1");
create table nrglog_m0101_gasvalue1 using nrglog tags("m0101","gasValue1");
create table nrglog_m0102_electricvalue1 using nrglog tags("m0102","electricValue1");
create table nrglog_m0102_oilvalue1 using nrglog tags("m0102","oilValue1");
create table nrglog_m0102_watervalue1 using nrglog tags("m0102","waterValue1");
insert into almlog_m0103 values(now,now+1s,10,0,'','dismissed');
insert into almlog_m0103_20031 values(now,now+1s,10,20031,'','dismissed');
insert into almlog_m0103_20032 values(now,now+1s,10,20032,'','dismissed');
insert into almlog_m0103_3003 values(now,now+1s,10,3003,'','dismissed');
insert into almlog_m0103_20033 values(now,now+1s,10,20033,'','dismissed');
insert into almlog_m0103_30031 values(now,now+1s,10,30031,'','dismissed');
flush database d0;
show table tags from almlog;
select *,tbname from d0.almlog where mcid='m0103';
select table_name from information_schema.ins_tables where db_name='d0';
tests/system-test/0-others/compa4096.json
浏览文件 @
475fa75e
...
...
@@ -53,18 +53,8 @@
"sample_format"
:
"csv"
,
"sample_file"
:
"./sample.csv"
,
"tags_file"
:
""
,
"columns"
:
[
{
"type"
:
"INT"
,
"count"
:
4094
}
],
"tags"
:
[
{
"type"
:
"TINYINT"
,
"count"
:
1
}
]
"columns"
:
[{
"type"
:
"INT"
,
"count"
:
4093
}],
"tags"
:
[{
"type"
:
"TINYINT"
,
"count"
:
1
},{
"type"
:
"NCHAR"
,
"count"
:
1
}]
}
]
}
...
...
tests/system-test/0-others/compatibility.py
浏览文件 @
475fa75e
...
...
@@ -98,9 +98,12 @@ class TDTestCase:
def
buildTaosd
(
self
,
bPath
):
# os.system(f"mv {bPath}/build_bak {bPath}/build ")
os
.
system
(
f
" cd
{
bPath
}
"
)
os
.
system
(
f
" cd
{
bPath
}
"
)
def
is_list_same_as_ordered_list
(
self
,
unordered_list
,
ordered_list
):
sorted_list
=
sorted
(
unordered_list
)
return
sorted_list
==
ordered_list
def
run
(
self
):
scriptsPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
distro_id
=
distro
.
id
()
...
...
@@ -146,6 +149,8 @@ class TDTestCase:
tdLog
.
info
(
" LD_LIBRARY_PATH=/usr/lib taosBenchmark -f 0-others/compa4096.json -y "
)
os
.
system
(
"LD_LIBRARY_PATH=/usr/lib taosBenchmark -f 0-others/compa4096.json -y"
)
os
.
system
(
"LD_LIBRARY_PATH=/usr/lib taos -s 'flush database db4096 '"
)
os
.
system
(
"LD_LIBRARY_PATH=/usr/lib taos -f 0-others/TS-3131.tsql"
)
cmd
=
f
" LD_LIBRARY_PATH=
{
bPath
}
/build/lib
{
bPath
}
/build/bin/taos -h localhost ;"
if
os
.
system
(
cmd
)
==
0
:
raise
Exception
(
"failed to execute system command. cmd: %s"
%
cmd
)
...
...
@@ -220,6 +225,17 @@ class TDTestCase:
tdLog
.
exit
(
"%s(%d) failed"
%
args
)
tdsql
.
query
(
"show streams;"
)
tdsql
.
checkRows
(
2
)
tdsql
.
query
(
"select *,tbname from d0.almlog where mcid='m0103';"
)
tdsql
.
checkRows
(
6
)
expectList
=
[
0
,
3003
,
20031
,
20032
,
20033
,
30031
]
resultList
=
[]
for
i
in
range
(
6
):
resultList
.
append
(
tdsql
.
queryResult
[
i
][
3
])
print
(
resultList
)
if
self
.
is_list_same_as_ordered_list
(
resultList
,
expectList
):
print
(
"The unordered list is the same as the ordered list."
)
else
:
tdlog
.
error
(
"The unordered list is not the same as the ordered list."
)
tdsql
.
execute
(
"insert into test.d80 values (now+1s, 11, 103, 0.21);"
)
tdsql
.
execute
(
"insert into test.d9 values (now+5s, 4.3, 104, 0.4);"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录