DBeagle Testing
April 11, 2026 ยท View on GitHub
Automated Gates
The repository now uses three tiers of automated validation:
npm run ci:smokenpm run ci:validatenpm run test:vscodenpm run test:integration:drivers
npm run ci:validate remains the shared non-Docker baseline:
npm run lintnpm run typecheckcargo test --workspacenpm run test:coveragenpm run build
You can run the full gate locally with:
npm run test:baseline
The Marketplace smoke path now also includes:
npm run test:vscodefor Extension Development Host activation, command registration, SQL symbols/completions, and contributed view resolutionnpm run test:integration:driversagainst the seeded Docker stack intest/local/
CI runs npm run ci:validate on Ubuntu, lightweight npm run ci:smoke jobs on macOS and Windows, then the VS Code-host and Docker-backed driver suites on Ubuntu.
npm run bench:rust is kept as a local pre-push performance check instead of a GitHub workflow gate.
src/query/parameterProtocol.ts is intentionally excluded from coverage because it is a type-only message contract.
Coverage Policy
Vitest coverage is enabled through @vitest/coverage-v8 and enforced in CI for the unit-testable core modules that the current suite exercises directly:
- configuration and connection-form helpers
- driver and loader modules
- query execution orchestration
- result chart/page sizing helpers
- result-session lifecycle and export flows
- results webview state and event helpers
- connection webview render/validation helpers
Benchmarks are available locally through npm run bench:rust.
Current thresholds:
- Statements: 80%
- Branches: 70%
- Functions: 85%
- Lines: 80%
What We Test
TypeScript / Vitest
- configuration loading
- driver registry and driver-manager behavior
- query execution flow, read-only enforcement, diagnostics, truncation, and history
- result-session lifecycle cleanup, export behavior, and active-session routing
- results webview state transitions and browser-side event/message resolution
- connection-form parsing and browser-side validation/render helpers
- strict inbound webview message validation for connection, parameter, and result views
- exact module-loader behavior for native binaries and the SQL parser
- extension activation and contributed command/view wiring inside a real VS Code Extension Development Host
- Docker-backed driver integration for connect, metadata browse, query, streaming, cancellation, and disconnect flows
Rust / Cargo
- result-store ingest, paging, search filtering, sort/filter view building, chart shaping, and export paths
- parser read-only checks, splitting, formatting, and completion context
- benchmark thresholds for critical native and parser hot paths
Benchmark Budgets
npm run bench:rust checks Criterion output against the current budgets when you run it locally:
| Benchmark | Limit |
|---|---|
ingest_100k_rows | 200ms |
sort_100k_rows_single_column | 200ms |
filter_100k_rows_regex | 100ms |
export_csv_100k_rows | 400ms |
parse_complex_query | 50ms |
read_only_complex_query | 50ms |
If any threshold fails, treat it as a local pre-push blocker.
Manual Checks
Automated tests do not replace the basic manual pass before cutting a VSIX:
- add, edit, duplicate, and connect a connection in each shipped driver
- run a multi-statement query from an editor
- verify completion, outline, and diagnostics behavior in
sql,trino,postgres,mysql,mssql, andtsqleditors - verify mutation blocking in read-only mode
- verify metadata failures surface clear errors instead of silently degrading
- verify
resultGrid.maxRowstruncates with a clear session message - detach a result view, close the source document, and confirm the detached session survives until the panel closes
- export CSV, JSON, and chart PNG from a finalized result
- run
npm run package:preflightand confirmartifacts/dbeagle-preflight.vsixpackages cleanly from the repo root
Driver Smoke Matrix
Run the following matrix against the seeded test/local/ targets before shipping multi-driver changes:
| Driver | Connect | Browse | Preview | Run query | Cancel | Completion |
|---|---|---|---|---|---|---|
| Trino | localhost:8080, catalog dbeagle, schema demo | Expand dbeagle.demo and confirm the shared tables appear | Preview dummy_orders from the tree | SELECT order_id, order_status FROM dbeagle.demo.dummy_orders ORDER BY order_id DESC LIMIT 20; | Start SELECT COUNT(*) FROM dbeagle.demo.dummy_orders a CROSS JOIN dbeagle.demo.order_items b; and cancel from the running session | In a trino or sql editor, confirm table and column suggestions resolve for dummy_orders |
| PostgreSQL | localhost:5432, database dbeagle, schema demo | Expand dbeagle.demo and confirm the shared tables appear | Preview dummy_orders from the tree | SELECT order_id, order_status FROM demo.dummy_orders ORDER BY order_id DESC LIMIT 20; | Start SELECT COUNT(*) FROM demo.dummy_orders a CROSS JOIN demo.order_items b; and cancel from the running session | In a postgres or sql editor, confirm table and column suggestions resolve for demo.dummy_orders |
| MySQL | localhost:3306, database dbeagle | Expand the dbeagle database and confirm the shared tables appear | Preview dummy_orders from the tree | SELECT order_id, order_status FROM dbeagle.dummy_orders ORDER BY order_id DESC LIMIT 20; | Start SELECT COUNT(*) FROM dbeagle.dummy_orders a CROSS JOIN dbeagle.order_items b; and cancel from the running session | In a mysql or sql editor, confirm table and column suggestions resolve for dbeagle.dummy_orders |
| SQL Server | localhost:1433, database dbeagle, schema demo | Expand dbeagle.demo and confirm the shared tables appear | Preview dummy_orders from the tree | SELECT TOP (20) order_id, order_status FROM [dbeagle].[demo].[dummy_orders] ORDER BY order_id DESC; | Start SELECT COUNT(*) FROM [dbeagle].[demo].[dummy_orders] a CROSS JOIN [dbeagle].[demo].[order_items] b; and cancel from the running session | In a mssql, tsql, or sql editor, confirm table and column suggestions resolve for demo.dummy_orders |
| Vertica | localhost:5433, database dbeagle, schema public | Expand dbeagle.public and confirm the shared tables appear | Preview dummy_orders from the tree | SELECT order_id, order_status FROM public.dummy_orders ORDER BY order_id DESC LIMIT 20; | Start SELECT COUNT(*) FROM public.dummy_orders a CROSS JOIN public.order_items b; and cancel from the running session | In a generic sql editor, confirm table and column suggestions resolve for public.dummy_orders |
Local Targets
test/local/ contains the reproducible Trino, PostgreSQL, MySQL, Vertica, and SQL Server setups used for manual extension checks:
npm run test:local:upnpm run test:local:seednpm run test:local:downnpm run test:local:trino:upnpm run test:local:trino:seednpm run test:local:trino:downnpm run test:local:postgres:upnpm run test:local:postgres:seednpm run test:local:postgres:downnpm run test:local:vertica:upnpm run test:local:vertica:seednpm run test:local:vertica:downnpm run test:local:mysql:upnpm run test:local:mysql:seednpm run test:local:mysql:downnpm run test:local:mssql:upnpm run test:local:mssql:seednpm run test:local:mssql:down
The CI integration suite uses the combined stack:
npm run test:local:upnpm run test:local:seednpm run test:integration:driversnpm run test:local:down