mirror of
https://github.com/allankoechke/turso.git
synced 2026-11-30 11:12:58 +00:00
Add property-based differential tests that compare an embedded Turso driver against the serverless driver of the same language, running against a live Turso Cloud database configured with TURSO_DATABASE_URL and TURSO_AUTH_TOKEN. The tests skip when the variables are unset. Random operation sequences (DDL, DML, queries, parameter binding, transactions, batches, triggers, error cases) execute on both drivers, and every result must match: success or failure, column names and counts, row counts, value type tags, cell values, affected row counts, and last insert rowids. Because the workloads are generated, the suite finds divergences no hand-written test covers, and fast-check shrinks failures to a minimal reproducing sequence. The shared operation vocabulary lives in serverless/conformance/differential/spec/ops.json so every language harness faces the same workloads; each harness lives next to the driver it tests. The JavaScript harness in serverless/javascript/differential covers @tursodatabase/serverless against the native @tursodatabase/database driver; since the serverless driver mirrors the embedded API, one adapter drives both sides and any API divergence fails the suite. Co-authored-by: Pekka Enberg <penberg@iki.fi>
18 lines
396 B
JSON
18 lines
396 B
JSON
{
|
|
"name": "@tursodatabase/serverless-differential",
|
|
"version": "0.0.0",
|
|
"private": true,
|
|
"type": "module",
|
|
"scripts": {
|
|
"test": "ava --timeout=15m"
|
|
},
|
|
"devDependencies": {
|
|
"ava": "^6.4.1",
|
|
"fast-check": "^4.6.0"
|
|
},
|
|
"dependencies": {
|
|
"@tursodatabase/database": "file:../../../bindings/javascript/packages/native",
|
|
"@tursodatabase/serverless": "file:.."
|
|
}
|
|
}
|