databend icon indicating copy to clipboard operation
databend copied to clipboard

A logic test auto complete tools

Open ZeaLoVe opened this issue 2 years ago • 2 comments

cc @ZeaLoVe

It will be very useful if we can generate a full test file with a prototype test file.

For example, we can write an original prototype test file as:

statement ok
create table t(a int);

statement ok
insert into t values(1), (2), (3);

statement query I
select * from t;
----
(left empty here)

And then we can run the test and fill the result back to test file as:

python main.py --generate

This will generate a full test file:

statement ok
create table t(a int);

statement ok
insert into t values(1), (2), (3);

statement query I
select * from t;
----
1
2
3

Sometimes, developers may need to modify some test file, this mechanism will be very helpful.

Originally posted by @leiysky in https://github.com/datafuselabs/databend/discussions/5838#discussioncomment-2946778

ZeaLoVe avatar Jul 20 '22 09:07 ZeaLoVe

The better one is auto generate logic test suite by xx.sql file, contains only sql statement, all others get from query response.

ZeaLoVe avatar Jul 20 '22 09:07 ZeaLoVe

Compare result with mysql or clickhouse to make sure result is right. Take it in consideration.

ZeaLoVe avatar Aug 02 '22 12:08 ZeaLoVe