databend
databend copied to clipboard
A logic test auto complete tools
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
The better one is auto generate logic test suite by xx.sql file, contains only sql statement, all others get from query response.
Compare result with mysql or clickhouse to make sure result is right. Take it in consideration.