risinglightdb / sqllogictest-rs

Sqllogictest parser and runner in Rust.
Apache License 2.0
168 stars 42 forks source link

idea: use a template language to manage tests #143

Open xxchan opened 1 year ago

xxchan commented 1 year ago

From https://github.com/risingwavelabs/risingwave/issues/7006, maybe we can maintain such a tool in sqllogictest-rs

One specific use case is that we can deprecate include, which introduced quite a few problems, e.g., prohibits parallel execution, and https://github.com/risinglightdb/sqllogictest-rs/issues?q=label%3AA-include

liurenjie1024 commented 1 year ago

Strongly +1 for this. I have two solide use cases:

  1. For batch query in risingwave, we can use template for different query modes rather than using include. This way we can run slts parallely.
  2. We can use templates for different types. An example comes from duckdb: https://github.com/duckdb/duckdb/blob/53d9518e5f5fef1c1155d353d0132982d85d9ad9/test/sql/join/test_not_distinct_from.test_slow
liurenjie1024 commented 1 year ago

Rust also has jinja2 template engine: https://github.com/Keats/tera

TennyZhuang commented 1 year ago

BTW, I guess we don't need to use a rust jinja.

TennyZhuang commented 1 year ago

The feature is conflicted with #114

TennyZhuang commented 1 year ago

The real solution is that an SLT file should be both self-contained and easy to use. An example of this is JsonNet. If we don't want to spend too much effort on this, just introducing some rough sugar like include is impossible to be friendly enough. I agree with jinja2.