From 13230df94822b7da55387f889a694286f784cd2f Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Thu, 14 Jul 2022 15:51:59 +0800 Subject: [PATCH] test: restore some 2.0 case --- tests/script/jenkins/basic.txt | 47 ++++++++++++----------- tests/script/tsim/table/autocreate.sim | 2 +- tests/script/tsim/table/basic1.sim | 17 --------- tests/script/tsim/table/basic2.sim | 6 +-- tests/script/tsim/table/basic3.sim | 4 +- tests/script/tsim/table/createmulti.sim | 2 +- tests/script/tsim/table/date.sim | 16 ++++---- tests/script/tsim/table/int.sim | 50 ++++++++++++------------- tests/script/tsim/table/limit.sim | 4 +- tests/script/tsim/table/smallint.sim | 38 +++++++++---------- tests/script/tsim/table/table.sim | 5 +-- tests/script/tsim/table/tinyint.sim | 36 +++++++++--------- tests/script/tsim/table/vgroup.sim | 24 ++++++------ 13 files changed, 112 insertions(+), 139 deletions(-) diff --git a/tests/script/jenkins/basic.txt b/tests/script/jenkins/basic.txt index 2c7170d40b..4de8b3667d 100644 --- a/tests/script/jenkins/basic.txt +++ b/tests/script/jenkins/basic.txt @@ -103,34 +103,33 @@ ./test.sh -f tsim/show/basic.sim # ---- table -# ./test.sh -f tsim/table/autocreate.sim +./test.sh -f tsim/table/autocreate.sim ./test.sh -f tsim/table/basic1.sim -# ./test.sh -f tsim/table/basic2.sim -# ./test.sh -f tsim/table/basic3.sim -# ./test.sh -f tsim/table/bigint.sim -# ./test.sh -f tsim/table/binary.sim -# ./test.sh -f tsim/table/bool.sim -# ./test.sh -f tsim/table/column_name.sim -# ./test.sh -f tsim/table/column_num.sim -# ./test.sh -f tsim/table/column_value.sim -# ./test.sh -f tsim/table/column2.sim -# ./test.sh -f tsim/table/createmulti.sim -# ./test.sh -f tsim/table/date.sim -# ./test.sh -f tsim/table/db.table.sim +./test.sh -f tsim/table/basic2.sim +./test.sh -f tsim/table/basic3.sim +./test.sh -f tsim/table/bigint.sim +./test.sh -f tsim/table/binary.sim +./test.sh -f tsim/table/bool.sim +./test.sh -f tsim/table/column_name.sim +./test.sh -f tsim/table/column_num.sim +./test.sh -f tsim/table/column_value.sim +./test.sh -f tsim/table/column2.sim +./test.sh -f tsim/table/createmulti.sim +./test.sh -f tsim/table/date.sim +./test.sh -f tsim/table/db.table.sim # ./test.sh -f tsim/table/delete_reuse1.sim # ./test.sh -f tsim/table/delete_reuse2.sim # ./test.sh -f tsim/table/delete_writing.sim -# ./test.sh -f tsim/table/describe.sim -# ./test.sh -f tsim/table/double.sim -# ./test.sh -f tsim/table/fill.sim -# ./test.sh -f tsim/table/float.sim -# ./test.sh -f tsim/table/int.sim -# ./test.sh -f tsim/table/limit.sim -# ./test.sh -f tsim/table/smallint.sim -# ./test.sh -f tsim/table/table_len.sim -# ./test.sh -f tsim/table/table.sim -# ./test.sh -f tsim/table/tinyint.sim -# ./test.sh -f tsim/table/vgroup.sim +./test.sh -f tsim/table/describe.sim +./test.sh -f tsim/table/double.sim +./test.sh -f tsim/table/float.sim +./test.sh -f tsim/table/int.sim +./test.sh -f tsim/table/limit.sim +./test.sh -f tsim/table/smallint.sim +./test.sh -f tsim/table/table_len.sim +./test.sh -f tsim/table/table.sim +./test.sh -f tsim/table/tinyint.sim +./test.sh -f tsim/table/vgroup.sim # ---- stream ./test.sh -f tsim/stream/basic0.sim diff --git a/tests/script/tsim/table/autocreate.sim b/tests/script/tsim/table/autocreate.sim index 70d58483a2..1267e33932 100644 --- a/tests/script/tsim/table/autocreate.sim +++ b/tests/script/tsim/table/autocreate.sim @@ -6,7 +6,7 @@ sql connect print =============== create database sql create database db sql show databases -if $rows != 1 then +if $rows != 3 then return -1 endi diff --git a/tests/script/tsim/table/basic1.sim b/tests/script/tsim/table/basic1.sim index 913ced74aa..6cb5bc54f7 100644 --- a/tests/script/tsim/table/basic1.sim +++ b/tests/script/tsim/table/basic1.sim @@ -213,23 +213,6 @@ endi system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s start -$loop_cnt = 0 -check_dnode_ready: - $loop_cnt = $loop_cnt + 1 - sleep 200 - if $loop_cnt == 10 then - print ====> dnode not ready! - return -1 - endi -sql show dnodes -print ===> $rows $data00 $data01 $data02 $data03 $data04 $data05 -if $data00 != 1 then - return -1 -endi -if $data04 != ready then - goto check_dnode_ready -endi - print =============== query data sql select * from c1 print rows: $rows diff --git a/tests/script/tsim/table/basic2.sim b/tests/script/tsim/table/basic2.sim index 737d5a3efe..297ae3d333 100644 --- a/tests/script/tsim/table/basic2.sim +++ b/tests/script/tsim/table/basic2.sim @@ -20,11 +20,11 @@ endi print =============== show sql show databases -if $data02 != 2 then +if $data22 != 2 then return -1 endi -if $data03 != 1 then +if $data24 != 1 then return -1 endi @@ -33,7 +33,7 @@ if $data00 != 2 then return -1 endi -if $data01 != 2 then +if $data01 != d1 then return -1 endi diff --git a/tests/script/tsim/table/basic3.sim b/tests/script/tsim/table/basic3.sim index 21470affa8..c9335b6d1b 100644 --- a/tests/script/tsim/table/basic3.sim +++ b/tests/script/tsim/table/basic3.sim @@ -6,7 +6,7 @@ sql connect print =============== create database sql create database db sql show databases -if $rows != 1 then +if $rows != 3 then return -1 endi @@ -72,7 +72,7 @@ endi print =============== drop stable sql drop table db.st sql show db.stables -if $rows != 2 then +if $rows != 0 then return -1 endi diff --git a/tests/script/tsim/table/createmulti.sim b/tests/script/tsim/table/createmulti.sim index efdb276c94..e204bd4f3d 100644 --- a/tests/script/tsim/table/createmulti.sim +++ b/tests/script/tsim/table/createmulti.sim @@ -6,7 +6,7 @@ sql connect print =============== create database sql create database db sql show databases -if $rows != 1 then +if $rows != 3 then return -1 endi diff --git a/tests/script/tsim/table/date.sim b/tests/script/tsim/table/date.sim index 218049d329..f2361cf4f5 100644 --- a/tests/script/tsim/table/date.sim +++ b/tests/script/tsim/table/date.sim @@ -24,18 +24,18 @@ if $data00 != @17-01-01 08:00:00.001@ then endi print =============== step2 -sql insert into $tb values ('2017-08-28 00:23:46.429+ 1a', 2) -#sql insert into $tb values ('2017-08-28 00:23:46cd .429', 2) +sql_error insert into $tb values ('2017-08-28 00:23:46.429+ 1a', 2) +sql_error insert into $tb values ('2017-08-28 00:23:46cd .429', 2) sql select ts from $tb -if $rows != 2 then +if $rows != 1 then return -1 endi print =============== step3 -#sql insert into $tb values ('1970-01-01 08:00:00.000', 3) -#sql insert into $tb values ('1970-01-01 08:00:00.000', 3) +sql_error insert into $tb values ('1970-01-01 08:00:00.000', 3) +sql_error insert into $tb values ('1970-01-01 08:00:00.000', 3) sql select ts from $tb -if $rows != 2 then +if $rows != 1 then return -1 endi @@ -54,7 +54,7 @@ print =============== step5 sql_error insert into $tb values ('9999-12-31 213:59:59.999', 13) sql select ts from $tb print $rows -if $rows != 8 then +if $rows != 7 then return -1 endi @@ -62,7 +62,7 @@ print =============== step6 sql_error insert into $tb values ('9999-12-99 23:59:59.999', 13) sql select ts from $tb -if $rows != 8 then +if $rows != 7 then return -1 endi diff --git a/tests/script/tsim/table/int.sim b/tests/script/tsim/table/int.sim index f84858c7d0..7e3cefc7ca 100644 --- a/tests/script/tsim/table/int.sim +++ b/tests/script/tsim/table/int.sim @@ -24,12 +24,10 @@ if $data01 != NULL then endi print =============== step2 -sql insert into $tb values (now+1m, -2147483648) -x step2 - return -1 -step2: -sql insert into $tb values (now+1m, NULL) +sql insert into $tb values (now+1m, -2147483648) +sql insert into $tb values (now+2m, NULL) sql select * from $tb order by ts desc -if $rows != 2 then +if $rows != 3 then return -1 endi if $data01 != NULL then @@ -37,9 +35,9 @@ if $data01 != NULL then endi print =============== step3 -sql insert into $tb values (now+2m, 2147483647) +sql insert into $tb values (now+3m, 2147483647) sql select * from $tb order by ts desc -if $rows != 3 then +if $rows != 4 then return -1 endi if $data01 != 2147483647 then @@ -47,12 +45,10 @@ if $data01 != 2147483647 then endi print =============== step4 -sql insert into $tb values (now+3m, 2147483648) -x step4 - return -1 -step4: -sql insert into $tb values (now+3m, NULL) +sql_error insert into $tb values (now+4m, 2147483648) +sql insert into $tb values (now+5m, NULL) sql select * from $tb order by ts desc -if $rows != 4 then +if $rows != 5 then return -1 endi if $data01 != NULL then @@ -60,10 +56,10 @@ if $data01 != NULL then endi print =============== step5 -sql_error insert into $tb values (now+4m, a2) -sql insert into $tb values (now+4m, 0) +sql_error insert into $tb values (now+6m, a2) +sql insert into $tb values (now+7m, 0) sql select * from $tb order by ts desc -if $rows != 5 then +if $rows != 6 then return -1 endi if $data01 != 0 then @@ -71,10 +67,10 @@ if $data01 != 0 then endi print =============== step6 -sql_error insert into $tb values (now+5m, 2a) -sql insert into $tb values (now+5m, 2) +sql_error insert into $tb values (now+8m, 2a) +sql insert into $tb values (now+9m, 2) sql select * from $tb order by ts desc -if $rows != 6 then +if $rows != 7 then return -1 endi if $data01 != 2 then @@ -82,10 +78,10 @@ if $data01 != 2 then endi print =============== step7 -sql_error insert into $tb values (now+6m, 2a'1) -sql insert into $tb values (now+6m, 2) +sql_error insert into $tb values (now+10m, 2a'1) +sql insert into $tb values (now+11m, 2) sql select * from $tb order by ts desc -if $rows != 7 then +if $rows != 8 then return -1 endi if $data01 != 2 then @@ -93,9 +89,9 @@ if $data01 != 2 then endi print =============== step8 -sql insert into $tb values (now+8m, "NULL") +sql insert into $tb values (now+12m, "NULL") sql select * from $tb order by ts desc -if $rows != 8 then +if $rows != 9 then return -1 endi if $data01 != NULL then @@ -103,9 +99,9 @@ if $data01 != NULL then endi print =============== step9 -sql insert into $tb values (now+9m, 'NULL') +sql insert into $tb values (now+13m, 'NULL') sql select * from $tb order by ts desc -if $rows != 9 then +if $rows != 10 then return -1 endi if $data01 != NULL then @@ -113,9 +109,9 @@ if $data01 != NULL then endi print =============== step10 -sql insert into $tb values (now+10m, -123) +sql insert into $tb values (now+14m, -123) sql select * from $tb order by ts desc -if $rows != 10 then +if $rows != 11 then return -1 endi if $data01 != -123 then diff --git a/tests/script/tsim/table/limit.sim b/tests/script/tsim/table/limit.sim index 0a07ee3efa..d20938367e 100644 --- a/tests/script/tsim/table/limit.sim +++ b/tests/script/tsim/table/limit.sim @@ -12,10 +12,10 @@ $db = $dbPrefix . $i $tb = $tbPrefix . $i print =================== step 0 -sql create database $db +sql create database $db vgroups 8 sql use $db sql show vgroups -if $rows != 0 then +if $rows != 8 then return -1 endi diff --git a/tests/script/tsim/table/smallint.sim b/tests/script/tsim/table/smallint.sim index c81681c316..87140c561a 100644 --- a/tests/script/tsim/table/smallint.sim +++ b/tests/script/tsim/table/smallint.sim @@ -25,12 +25,10 @@ if $data01 != NULL then endi print =============== step2 -sql insert into $tb values (now+1m, -32768) -x step2 - return -1 -step2: -sql insert into $tb values (now+1m, NULL) +sql insert into $tb values (now+1m, -32768) +sql insert into $tb values (now+2m, NULL) sql select * from $tb order by ts desc -if $rows != 2 then +if $rows != 3 then return -1 endi if $data01 != NULL then @@ -38,9 +36,9 @@ if $data01 != NULL then endi print =============== step3 -sql insert into $tb values (now+2m, 32767) +sql insert into $tb values (now+3m, 32767) sql select * from $tb order by ts desc -if $rows != 3 then +if $rows != 4 then return -1 endi if $data01 != 32767 then @@ -48,12 +46,12 @@ if $data01 != 32767 then endi print =============== step4 -sql insert into $tb values (now+3m, 32768) -x step4 +sql insert into $tb values (now+4m, 32768) -x step4 return -1 step4: -sql insert into $tb values (now+3m, NULL) +sql insert into $tb values (now+5m, NULL) sql select * from $tb order by ts desc -if $rows != 4 then +if $rows != 5 then return -1 endi if $data01 != NULL then @@ -61,10 +59,10 @@ if $data01 != NULL then endi print =============== step5 -sql_error insert into $tb values (now+4m, a2) -sql insert into $tb values (now+4m, 0) +sql_error insert into $tb values (now+6m, a2) +sql insert into $tb values (now+7m, 0) sql select * from $tb order by ts desc -if $rows != 5 then +if $rows != 6 then return -1 endi if $data01 != 0 then @@ -72,10 +70,10 @@ if $data01 != 0 then endi print =============== step6 -sql_error insert into $tb values (now+5m, 2a) -sql insert into $tb values (now+5m, 2) +sql_error insert into $tb values (now+8m, 2a) +sql insert into $tb values (now+9m, 2) sql select * from $tb order by ts desc -if $rows != 6 then +if $rows != 7 then return -1 endi if $data01 != 2 then @@ -83,16 +81,16 @@ if $data01 != 2 then endi print =============== step7 -sql_error insert into $tb values (now+6m, 2a'1) -sql insert into $tb values (now+6m, 2) +sql_error insert into $tb values (now+10m, 2a'1) +sql insert into $tb values (now+11m, 2) sql select * from $tb order by ts desc -if $rows != 7 then +if $rows != 8 then return -1 endi if $data01 != 2 then return -1 endi - +return sql drop database $db sql show databases if $rows != 2 then diff --git a/tests/script/tsim/table/table.sim b/tests/script/tsim/table/table.sim index 6a706c979f..65774dd03c 100644 --- a/tests/script/tsim/table/table.sim +++ b/tests/script/tsim/table/table.sim @@ -197,16 +197,15 @@ if $data01 != 7 then endi print =============== step10 -$i = 1 $tb = $tbPrefix . $i -sql create table $tb (ts timestamp, val tinyint, val2 tinyint) +sql_error create table $tb (ts timestamp, val tinyint, val2 tinyint) sql show tables if $rows != 7 then return -1 endi print =============== step11 -sql create table $tb (ts timestamp, val float, val2 double) +sql_error create table $tb (ts timestamp, val float, val2 double) sql show tables if $rows != 7 then return -1 diff --git a/tests/script/tsim/table/tinyint.sim b/tests/script/tsim/table/tinyint.sim index 089fab0bfa..4764600b5b 100644 --- a/tests/script/tsim/table/tinyint.sim +++ b/tests/script/tsim/table/tinyint.sim @@ -24,12 +24,10 @@ if $data01 != NULL then endi print =============== step2 -sql insert into $tb values (now+1m, -128) -x step2 - return -1 -step2: -sql insert into $tb values (now+1m, NULL) +sql insert into $tb values (now+1m, -128) +sql insert into $tb values (now+2m, NULL) sql select * from $tb order by ts desc -if $rows != 2 then +if $rows != 3 then return -1 endi if $data01 != NULL then @@ -37,9 +35,9 @@ if $data01 != NULL then endi print =============== step3 -sql insert into $tb values (now+2m, 127) +sql insert into $tb values (now+3m, 127) sql select * from $tb order by ts desc -if $rows != 3 then +if $rows != 4 then return -1 endi if $data01 != 127 then @@ -47,12 +45,12 @@ if $data01 != 127 then endi print =============== step4 -sql insert into $tb values (now+3m, 128) -x step4 +sql insert into $tb values (now+4m, 128) -x step4 return -1 step4: -sql insert into $tb values (now+3m, NULL) +sql insert into $tb values (now+5m, NULL) sql select * from $tb -if $rows != 4 then +if $rows != 5 then return -1 endi if $data01 != NULL then @@ -60,10 +58,10 @@ if $data01 != NULL then endi print =============== step5 -sql_error insert into $tb values (now+4m, a2) -sql insert into $tb values (now+4m, 0) +sql_error insert into $tb values (now+6m, a2) +sql insert into $tb values (now+7m, 0) sql select * from $tb order by ts desc -if $rows != 5 then +if $rows != 6 then return -1 endi if $data01 != 0 then @@ -71,10 +69,10 @@ if $data01 != 0 then endi print =============== step6 -sql_error insert into $tb values (now+5m, 2a) -sql insert into $tb values (now+5m, 2) +sql_error insert into $tb values (now+8m, 2a) +sql insert into $tb values (now+9m, 2) sql select * from $tb order by ts desc -if $rows != 6 then +if $rows != 7 then return -1 endi if $data01 != 2 then @@ -82,10 +80,10 @@ if $data01 != 2 then endi print =============== step7 -sql_error insert into $tb values (now+6m, 2a'1) -sql insert into $tb values (now+6m, 2) +sql_error insert into $tb values (now+10m, 2a'1) +sql insert into $tb values (now+11m, 2) sql select * from $tb order by ts desc -if $rows != 7 then +if $rows != 8 then return -1 endi if $data01 != 2 then diff --git a/tests/script/tsim/table/vgroup.sim b/tests/script/tsim/table/vgroup.sim index 902415400e..2925e9de4c 100644 --- a/tests/script/tsim/table/vgroup.sim +++ b/tests/script/tsim/table/vgroup.sim @@ -12,10 +12,10 @@ $db = $dbPrefix . $i $tb = $tbPrefix . $i print =================== step 1 -sql create database $db +sql create database $db vgroups 4 sql use $db sql show vgroups -if $rows != 0 then +if $rows != 4 then return -1 endi @@ -24,7 +24,7 @@ sql create table table2 (ts timestamp, speed int) sql create table table3 (ts timestamp, speed int) sql create table table4 (ts timestamp, speed int) sql show vgroups -if $rows != 1 then +if $rows != 4 then return -1 endi @@ -33,7 +33,7 @@ sql create table table6 (ts timestamp, speed int) sql create table table7 (ts timestamp, speed int) sql create table table8 (ts timestamp, speed int) sql show vgroups -if $rows != 2 then +if $rows != 4 then return -1 endi @@ -42,7 +42,7 @@ sql create table table10 (ts timestamp, speed int) sql create table table11 (ts timestamp, speed int) sql create table table12 (ts timestamp, speed int) sql show vgroups -if $rows != 3 then +if $rows != 4 then return -1 endi @@ -54,7 +54,7 @@ endi sql drop table table13 sql show vgroups -if $rows != 3 then +if $rows != 4 then return -1 endi @@ -68,10 +68,10 @@ print =================== step 2 $i = 1 $db = $dbPrefix . $i -sql create database $db +sql create database $db vgroups 2 sql use $db sql show vgroups -if $rows != 0 then +if $rows != 2 then return -1 endi @@ -84,13 +84,13 @@ $db = $dbPrefix . $i sql use $db sql create table table2 (ts timestamp, speed int) sql show vgroups -if $rows != 1 then +if $rows != 2 then return -1 endi sql drop table table2 sql show vgroups -if $rows != 0 then +if $rows != 2 then return -1 endi @@ -100,7 +100,7 @@ sql create table table3 (ts timestamp, speed int) sql create table table4 (ts timestamp, speed int) sql drop table table1 sql show vgroups -if $rows != 1 then +if $rows != 2 then return -1 endi @@ -129,7 +129,7 @@ sql create database $db sql use $db sql show databases -if $rows != 5 then +if $rows != 7 then return -1 endi -- GitLab