mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-23 08:55:40 +01:00
testing: Add MVCC test suite
This commit is contained in:
6
Makefile
6
Makefile
@@ -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
32
testing/cli_tests/mvcc.py
Executable 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()
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user