sqllogictest-rs icon indicating copy to clipboard operation
sqllogictest-rs copied to clipboard

idea: use a template language to manage tests

Open xxchan opened this issue 2 years ago • 5 comments

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

xxchan avatar Jan 09 '23 09:01 xxchan

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 avatar Jan 09 '23 10:01 liurenjie1024

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

liurenjie1024 avatar Jan 10 '23 07:01 liurenjie1024

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

TennyZhuang avatar Jan 28 '23 01:01 TennyZhuang

The feature is conflicted with #114

TennyZhuang avatar Jan 28 '23 01:01 TennyZhuang

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.

TennyZhuang avatar Jan 28 '23 01:01 TennyZhuang