SQL integration test harNESS
An ergonomic, opinionated framework for SQL integration test.
See basic.rs to learn how to setup a basic test. This is the directory structure of examples
$ tree examples/
examples/
├── basic-case # Testcase root directory
│ └── simple # One environment
│ ├── config.toml # Config file for current environment
│ ├── select.result # Expected result file
│ └── select.sql # Input SQL testcase
├── basic.rs # Entrypoint of this example
When run it via
cargo run --example basic
It will do following things:
- Collect all environments(first-level directory) under
basic-case
. - Run testcases(
.sql
files) under environment one after one.- Write temporary result to
{testcase}.output
- Compare
{testcase}.output
with{testcase}.result
usingdiff
- Write temporary result to
- Report result.
Our target is to keep *.result
file up to date, when *.output
is equals to its corresponding result, the runner will delete it after executed.
When there is any diffs, the runner will keep *.output
for later investigation.
Below is the output of this example:
Run testcase...
Start, env:simple, config:Some("examples/basic-case/simple/config.toml").
Test case "examples/basic-case/simple/select" finished, cost: 0ms
Environment simple run finished, cost:1ms
Stop, env:simple.
MyDB stopped.
- CeresDB, a high-performance, distributed, cloud native time-series database that can handle both time-series and analytics workloads.
- GreptimeDB, an open-source, cloud-native, distributed time-series database.
If you’re using sqlness and like to be added to this list, welcome to open a PR.
This project is under Apache License 2.0.