- Home
- Skills
- Tursodatabase
- Turso
- Testing
testing_skill
- Rust
17.4k
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill tursodatabase/turso --skill testing- SKILL.md3.0 KB
Overview
This skill explains how to write and run tests for Turso, when to use each test type, and how to convert legacy TCL tests into the preferred .sqltest format. It focuses on practical commands, file locations, and concrete rules so tests reliably catch regressions across CLI, Rust bindings, and other backends. The guidance covers .sqltest syntax, conversion tips, and Rust integration tests.
How this skill works
The skill describes the test types (.sqltest, legacy TCL .test, Rust integration, and fuzz) and where they live in the project. It shows how the test runner executes .sqltest files across multiple backends and how to run the test runner or cargo test locally. It also explains converting TCL tests to .sqltest, verifying converted outputs, and adjusting expectations when database seeds differ.
When to use it
- Use .sqltest for new SQL compatibility tests and cross-backend execution.
- Use TCL .test only for legacy cases during conversion; do not create new TCL tests.
- Use Rust integration tests for complex scenarios and regressions requiring programmatic setup.
- Use fuzzing for edge-case discovery and complex feature stress tests.
- Run cargo test for unit/integration Rust tests across the workspace.
Best practices
- Prefer .sqltest for new tests and place them in testing/runner/tests/*.sqltest.
- Start with failing tests: write tests before implementing changes when possible.
- Use in-memory databases (:memory: for .sqltest, {:memory:} for TCL) to keep tests fast and deterministic.
- When converting TCL tests, run the test-runner convert command and manually fix warnings; don’t change SQL statements—adjust expected output instead.
- Keep tests small and focused: each test should verify one behavior and fail without the intended change.
Example use cases
- Add a SQL compatibility test that asserts a query returns specific rows using a .sqltest file.
- Convert a legacy TCL test by running the test-runner convert command, then run make -C testing/runner run-rust to validate and fix expected output.
- Write a Rust integration test to exercise complex transaction behavior not easily expressed in .sqltest.
- Run the full test matrix with make test or run a single TCL test with make test-single TEST=select.test.
- Enable detailed logs for a failing test with RUST_LOG=none,turso_core=trace make test and inspect testing/system/test.log.
FAQ
Run cargo run -p test-runner -- convert <TCL_test_path> -o <out_dir>. Inspect warnings, manually fix any unconverted constructs, then run make -C testing/runner run-rust to validate and adjust expected output.
Why do expected outputs change after conversion?
The .sqltest runner generates databases with different seeds than the hardcoded TCL databases, so row ordering or generated IDs can differ; don’t change SQL—update expected results to match the new database output.