Skip to content

Commit

Permalink
tests/issue 73 add smoke tests for changelog and fix format of some …
Browse files Browse the repository at this point in the history
…json files (#75)

* add test cases for changelog and fix format of some json file

* format js code and some sql code.

* add bug tag to some cases fail because of issue 118 and fix some cases with wrong expected results
  • Loading branch information
leo-cai-timeplus authored Sep 21, 2023
1 parent 2d80b74 commit 9cd0430
Show file tree
Hide file tree
Showing 14 changed files with 12,359 additions and 452 deletions.
4 changes: 1 addition & 3 deletions tests/stream/test_stream_smoke/0007_type_and_func_case1.json
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,7 @@
"steps":[
{"statements": [
{"client":"python", "query_type": "table","wait":2, "query":"drop stream if exists lineorder_flat1"},
{"client":"python", "query_type": "table","wait":1, "query":"CREATE STREAM lineorder_flat1
(`LO_ORDERKEY` uint32, `LO_LINENUMBER` uint8, `LO_CUSTKEY` uint32, `LO_PARTKEY` uint32, `LO_SUPPKEY` uint32, `LO_ORDERDATE` date, `LO_ORDERPRIORITY` low_cardinality(string), `LO_SHIPPRIORITY` uint8, `LO_QUANTITY` uint8, `LO_EXTENDEDPRICE` uint32, `LO_ORDTOTALPRICE` uint32, `LO_DISCOUNT` uint8, `LO_REVENUE` uint32, `LO_SUPPLYCOST` uint32, `LO_TAX` uint8, `LO_COMMITDATE` date, `LO_SHIPMODE` low_cardinality(string), `C_NAME` string, `C_ADDRESS` string, `C_CITY` low_cardinality(string), `C_NATION` low_cardinality(string), `C_REGION` low_cardinality(string), `C_PHONE` string, `C_MKTSEGMENT` low_cardinality(string), `S_NAME` string, `S_ADDRESS` string, `S_CITY` low_cardinality(string), `S_NATION` low_cardinality(string), `S_REGION` low_cardinality(string), `S_PHONE` string, `P_NAME` string, `P_MFGR` low_cardinality(string), `P_CATEGORY` low_cardinality(string), `P_BRAND` low_cardinality(string), `P_COLOR` low_cardinality(string), `P_TYPE` low_cardinality(string), `P_SIZE` uint8, `P_CONTAINER` low_cardinality(string)
)"},
{"client":"python", "query_type": "table","wait":1, "query":"CREATE STREAM lineorder_flat1(`LO_ORDERKEY` uint32, `LO_LINENUMBER` uint8, `LO_CUSTKEY` uint32, `LO_PARTKEY` uint32, `LO_SUPPKEY` uint32, `LO_ORDERDATE` date, `LO_ORDERPRIORITY` low_cardinality(string), `LO_SHIPPRIORITY` uint8, `LO_QUANTITY` uint8, `LO_EXTENDEDPRICE` uint32, `LO_ORDTOTALPRICE` uint32, `LO_DISCOUNT` uint8, `LO_REVENUE` uint32, `LO_SUPPLYCOST` uint32, `LO_TAX` uint8, `LO_COMMITDATE` date, `LO_SHIPMODE` low_cardinality(string), `C_NAME` string, `C_ADDRESS` string, `C_CITY` low_cardinality(string), `C_NATION` low_cardinality(string), `C_REGION` low_cardinality(string), `C_PHONE` string, `C_MKTSEGMENT` low_cardinality(string), `S_NAME` string, `S_ADDRESS` string, `S_CITY` low_cardinality(string), `S_NATION` low_cardinality(string), `S_REGION` low_cardinality(string), `S_PHONE` string, `P_NAME` string, `P_MFGR` low_cardinality(string), `P_CATEGORY` low_cardinality(string), `P_BRAND` low_cardinality(string), `P_COLOR` low_cardinality(string), `P_TYPE` low_cardinality(string), `P_SIZE` uint8, `P_CONTAINER` low_cardinality(string))"},
{"client":"python", "query_type": "table","wait":3,"query_id": "801", "query":"SELECT sum(LO_REVENUE), to_year(LO_ORDERDATE) AS year, P_BRAND FROM table(lineorder_flat1) WHERE (P_CATEGORY = 'MFGR#12') AND (S_REGION = 'AMERICA') GROUP BY year, P_BRAND ORDER BY year ASC, P_BRAND ASC"}
]}
],
Expand Down
154 changes: 7 additions & 147 deletions tests/stream/test_stream_smoke/0008_topmax_case.json

Large diffs are not rendered by default.

209 changes: 20 additions & 189 deletions tests/stream/test_stream_smoke/0009_stream_join_stream_case.json

Large diffs are not rendered by default.

97 changes: 12 additions & 85 deletions tests/stream/test_stream_smoke/0009_stream_join_stream_case1.json

Large diffs are not rendered by default.

31 changes: 3 additions & 28 deletions tests/stream/test_stream_smoke/0011_json_case.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,7 @@
{"client":"python","query_id":"1201", "wait":2,"exist":"json_tumble_hop_mv", "exit_wait":2, "query_type": "table", "query":"create materialized view if not exists json_tumble_hop_mv as select window_start as w_s, window_end as w_e, count() as cnt from tumble(json_hop_mv, we, 5s) group by window_start, window_end"},
{"client":"python","query_id":"1202","wait":2, "terinate":"manual", "query_type": "stream","drop_view":"json_tumble_hop_mv,json_hop_mv", "drop_view_wait":2, "query":"select cnt from json_tumble_hop_mv"},
{"client":"python", "query_type": "table","depends_on":1202, "wait":1, "kill": 1202, "kill_wait":8, "query":
"insert into test_json_str (json, timestamp) values
('{\"data\":{\"id\":\"dev1\", \"value\":100, \"create_time\":\"2021-11-02 20:00:01\"}, \"tag\":\"building\"}' ,'2021-11-02 20:00:01')
('{\"data\":{\"id\":\"dev1\", \"value\":100, \"create_time\":\"2021-11-02 20:00:03\"}, \"tag\":\"temperature\"}' ,'2021-11-02 20:00:03')
('{\"data\":{\"id\":\"dev2\", \"value\":100, \"create_time\":\"2021-11-02 20:00:02\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:02')
('{\"data\":{\"id\":\"dev2\", \"value\":100, \"create_time\":\"2021-11-02 20:00:04\"}, \"tag\":\"building\"}' ,'2021-11-02 20:00:04')
('{\"data\":{\"id\":\"dev3\", \"value\":100, \"create_time\":\"2021-11-02 20:00:05\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:05')
('{\"data\":{\"id\":\"dev3\", \"value\":100, \"create_time\":\"2021-11-02 20:00:06\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:06')
('{\"data\":{\"id\":\"dev3\", \"value\":100, \"create_time\":\"2021-11-02 20:00:09\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:09')
('{\"data\":{\"id\":\"dev3\", \"value\":100, \"create_time\":\"2021-11-02 20:00:08\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:08')
('{\"data\":{\"id\":\"dev3\", \"value\":100, \"create_time\":\"2021-11-02 20:00:07\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:07')
('{\"data\":{\"id\":\"dev3\", \"value\":100, \"create_time\":\"2021-11-02 20:00:09\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:09')
('{\"data\":{\"id\":\"dev3\", \"value\":100, \"create_time\":\"2021-11-02 20:00:01\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:01')
('{\"data\":{\"id\":\"dev3\", \"value\":100, \"create_time\":\"2021-11-02 20:00:10\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:10')"
"insert into test_json_str (json, timestamp) values('{\"data\":{\"id\":\"dev1\", \"value\":100, \"create_time\":\"2021-11-02 20:00:01\"}, \"tag\":\"building\"}' ,'2021-11-02 20:00:01')('{\"data\":{\"id\":\"dev1\", \"value\":100, \"create_time\":\"2021-11-02 20:00:03\"}, \"tag\":\"temperature\"}' ,'2021-11-02 20:00:03')('{\"data\":{\"id\":\"dev2\", \"value\":100, \"create_time\":\"2021-11-02 20:00:02\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:02')('{\"data\":{\"id\":\"dev2\", \"value\":100, \"create_time\":\"2021-11-02 20:00:04\"}, \"tag\":\"building\"}' ,'2021-11-02 20:00:04')('{\"data\":{\"id\":\"dev3\", \"value\":100, \"create_time\":\"2021-11-02 20:00:05\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:05')('{\"data\":{\"id\":\"dev3\", \"value\":100, \"create_time\":\"2021-11-02 20:00:06\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:06')('{\"data\":{\"id\":\"dev3\", \"value\":100, \"create_time\":\"2021-11-02 20:00:09\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:09')('{\"data\":{\"id\":\"dev3\", \"value\":100, \"create_time\":\"2021-11-02 20:00:08\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:08')('{\"data\":{\"id\":\"dev3\", \"value\":100, \"create_time\":\"2021-11-02 20:00:07\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:07')('{\"data\":{\"id\":\"dev3\", \"value\":100, \"create_time\":\"2021-11-02 20:00:09\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:09')('{\"data\":{\"id\":\"dev3\", \"value\":100, \"create_time\":\"2021-11-02 20:00:01\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:01')('{\"data\":{\"id\":\"dev3\", \"value\":100, \"create_time\":\"2021-11-02 20:00:10\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:10')"
}
]}

Expand All @@ -73,19 +61,7 @@
{"client":"python","query_id":"1201", "wait":2,"exist":"json_tumble_hop_v", "exit_wait":2, "query_type": "table", "query":"create view if not exists json_tumble_hop_v as select window_start as w_s, window_end as w_e, count() as cnt from tumble(json_hop_v, we, 5s) group by window_start, window_end"},
{"client":"python","query_id":"1202", "wait":2, "terinate":"manual", "query_type": "stream","drop_view":"json_tumble_hop_v,json_hop_v", "drop_view_wait":2, "query":"select cnt from json_tumble_hop_v"},
{"client":"python", "query_type": "table","depends_on":1202, "wait":1, "kill": 1202, "kill_wait":8,"query":
"insert into test_json_str (json, timestamp) values
('{\"data\":{\"id\":\"dev1\", \"value\":100, \"create_time\":\"2021-11-02 20:00:01\"}, \"tag\":\"building\"}' ,'2021-11-02 20:00:01')
('{\"data\":{\"id\":\"dev1\", \"value\":100, \"create_time\":\"2021-11-02 20:00:03\"}, \"tag\":\"temperature\"}' ,'2021-11-02 20:00:03')
('{\"data\":{\"id\":\"dev2\", \"value\":100, \"create_time\":\"2021-11-02 20:00:02\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:02')
('{\"data\":{\"id\":\"dev2\", \"value\":100, \"create_time\":\"2021-11-02 20:00:04\"}, \"tag\":\"building\"}' ,'2021-11-02 20:00:04')
('{\"data\":{\"id\":\"dev3\", \"value\":100, \"create_time\":\"2021-11-02 20:00:05\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:05')
('{\"data\":{\"id\":\"dev3\", \"value\":100, \"create_time\":\"2021-11-02 20:00:06\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:06')
('{\"data\":{\"id\":\"dev3\", \"value\":100, \"create_time\":\"2021-11-02 20:00:09\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:09')
('{\"data\":{\"id\":\"dev3\", \"value\":100, \"create_time\":\"2021-11-02 20:00:08\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:08')
('{\"data\":{\"id\":\"dev3\", \"value\":100, \"create_time\":\"2021-11-02 20:00:07\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:07')
('{\"data\":{\"id\":\"dev3\", \"value\":100, \"create_time\":\"2021-11-02 20:00:09\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:09')
('{\"data\":{\"id\":\"dev3\", \"value\":100, \"create_time\":\"2021-11-02 20:00:01\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:01')
('{\"data\":{\"id\":\"dev3\", \"value\":100, \"create_time\":\"2021-11-02 20:00:10\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:10')"
"insert into test_json_str (json, timestamp) values('{\"data\":{\"id\":\"dev1\", \"value\":100, \"create_time\":\"2021-11-02 20:00:01\"}, \"tag\":\"building\"}' ,'2021-11-02 20:00:01')('{\"data\":{\"id\":\"dev1\", \"value\":100, \"create_time\":\"2021-11-02 20:00:03\"}, \"tag\":\"temperature\"}' ,'2021-11-02 20:00:03')('{\"data\":{\"id\":\"dev2\", \"value\":100, \"create_time\":\"2021-11-02 20:00:02\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:02')('{\"data\":{\"id\":\"dev2\", \"value\":100, \"create_time\":\"2021-11-02 20:00:04\"}, \"tag\":\"building\"}' ,'2021-11-02 20:00:04')('{\"data\":{\"id\":\"dev3\", \"value\":100, \"create_time\":\"2021-11-02 20:00:05\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:05')('{\"data\":{\"id\":\"dev3\", \"value\":100, \"create_time\":\"2021-11-02 20:00:06\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:06')('{\"data\":{\"id\":\"dev3\", \"value\":100, \"create_time\":\"2021-11-02 20:00:09\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:09')('{\"data\":{\"id\":\"dev3\", \"value\":100, \"create_time\":\"2021-11-02 20:00:08\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:08')('{\"data\":{\"id\":\"dev3\", \"value\":100, \"create_time\":\"2021-11-02 20:00:07\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:07')('{\"data\":{\"id\":\"dev3\", \"value\":100, \"create_time\":\"2021-11-02 20:00:09\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:09')('{\"data\":{\"id\":\"dev3\", \"value\":100, \"create_time\":\"2021-11-02 20:00:01\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:01')('{\"data\":{\"id\":\"dev3\", \"value\":100, \"create_time\":\"2021-11-02 20:00:10\"}, \"tag\":\"water\"}' ,'2021-11-02 20:00:10')"
}
]}
],
Expand All @@ -104,8 +80,7 @@
{"client":"python", "query_type": "table","wait":1, "query":"drop stream if exists test_json_obj"},
{"client":"python", "query_type": "table", "wait":2, "query":"create stream if not exists test_json_obj (json json, timestamp datetime64(3) default now64(3))"},
{"client":"python", "query_type": "table","depends_on_stream": "test_json_obj", "wait":2,"query":
"insert into test_json_obj (json, timestamp) values
('{\"data\":{\"id\":\"dev1\", \"value\":100, \"create_time\":\"2021-11-02 20:00:01\"}, \"tag\":\"building\"}' ,'2021-11-02 20:00:01')"
"insert into test_json_obj (json, timestamp) values('{\"data\":{\"id\":\"dev1\", \"value\":100, \"create_time\":\"2021-11-02 20:00:01\"}, \"tag\":\"building\"}' ,'2021-11-02 20:00:01')"
},
{"client":"python", "query_id":"1203", "depends_on_stream": "test_json_obj", "wait":3, "query":"select json.data.id, json.data.value, json.tag from test_json_obj limit 1 settings seek_to='earliest'"},
{"client":"python", "query_id":"1204", "query_type": "table" ,"depends_on_stream": "test_json_obj","wait":2, "query":"select json.data.id, json.data.value, json.tag from table(test_json_obj)"}
Expand Down
Loading

0 comments on commit 9cd0430

Please sign in to comment.