bin: enhance `skipif`
xxchan opened this issue · 3 comments
We have a skipif
, added in #27, which uses DB::engine_name
sqllogictest-rs/sqllogictest/src/runner.rs
Lines 914 to 919 in 27eb9f5
#27 also added a flag --engine
. But we use --engine
to switch driver now, and the engine_name
is not implemented in sqllogictest-bin
sqllogictest-rs/sqllogictest-bin/src/engines.rs
Lines 96 to 105 in 27eb9f5
I think adding a new flag like --name
or --label
can be enough.
Use case here risingwavelabs/risingwave#9013 (comment)
I think the original use case is “SQL syntax varies between databases” (ref https://www.sqlite.org/sqllogictest/doc/trunk/about.wiki), so the is just driver name. (But this is also break in out sqllogictest-bin now! 😄)
This new use case is that one driver’s different behavior under different configuration. Kind of like postgres+risingwave
, postgres+risingwave-in-mem
, postgres+cockroach
…
I'm thinking of whether we can decouple onlyif
/skipif
with engine name, and make it something like conditional compilation in Rust.
Specifically, users can add one or more lables by --cfg <label>
, and use them as conditions by skipif <label1> <label2> ...
. The condition takes effect only if all labels are present. Another syntax may be introduced to express the OR logic.
In the use case above, there could be two labels: risingwave
and in-mem
. Users can choose any one or both of them to make condition. I think this design allows for more flexibility.
Also, could be nice to skipif/onlyif
for the whole file, like with control