testing: Add MVCC test suite

This commit is contained in:
Pekka Enberg
2025-07-17 12:59:45 +03:00
parent aa84daabf1
commit 458dd815ac
3 changed files with 38 additions and 1 deletions

View File

@@ -68,7 +68,7 @@ uv-sync-test:
uv sync --all-extras --dev --package turso_test
.PHONE: uv-sync
test: limbo uv-sync-test test-compat test-vector test-sqlite3 test-shell test-memory test-write test-update test-constraint test-collate test-extensions
test: limbo uv-sync-test test-compat test-vector test-sqlite3 test-shell test-memory test-write test-update test-constraint test-collate test-extensions test-mvcc
.PHONY: test
test-extensions: limbo uv-sync-test
@@ -141,6 +141,10 @@ test-constraint: limbo uv-sync-test
fi
.PHONY: test-constraint
test-mvcc: limbo uv-sync-test
RUST_LOG=$(RUST_LOG) SQLITE_EXEC=$(SQLITE_EXEC) uv run --project limbo_test test-mvcc;
.PHONY: test-mvcc
bench-vfs: uv-sync-test
cargo build --release
RUST_LOG=$(RUST_LOG) uv run --project limbo_test bench-vfs "$(SQL)" "$(N)"

32
testing/cli_tests/mvcc.py Executable file
View File

@@ -0,0 +1,32 @@
#!/usr/bin/env python3
from pydantic import BaseModel
from cli_tests import console
from cli_tests.test_turso_cli import TestTursoShell
# This tests verify that experimental MVCC feature works as expected. The test
# suite will go away once the feature becomes more stable because we will just
# run the TCL tests, for example, with MVCC enabled.
class MVCCTest(BaseModel):
pass
def test_create_table_with_mvcc():
"""Test CREATE TABLE t(x) with --experimental-mvcc flag"""
shell = TestTursoShell(flags="--experimental-mvcc", init_commands="")
shell.run_test("create-table-mvcc", "CREATE TABLE t(x);", "")
shell.run_test("insert-mvcc", "INSERT INTO t(x) VALUES (1);", "")
shell.quit()
def main():
console.info("Running MVCC CLI tests...")
test_create_table_with_mvcc()
console.info("All MVCC tests have passed")
if __name__ == "__main__":
main()

View File

@@ -18,6 +18,7 @@ test-memory = "cli_tests.memory:main"
bench-vfs = "cli_tests.vfs_bench:main"
test-constraint = "cli_tests.constraint:main"
test-collate = "cli_tests.collate:main"
test-mvcc = "cli_tests.mvcc:main"
[tool.uv]
package = true