DBeagle Testing

April 11, 2026 ยท View on GitHub

Automated Gates

The repository now uses three tiers of automated validation:

  • npm run ci:smoke
  • npm run ci:validate
  • npm run test:vscode
  • npm run test:integration:drivers

npm run ci:validate remains the shared non-Docker baseline:

  • npm run lint
  • npm run typecheck
  • cargo test --workspace
  • npm run test:coverage
  • npm run build

You can run the full gate locally with:

  • npm run test:baseline

The Marketplace smoke path now also includes:

  • npm run test:vscode for Extension Development Host activation, command registration, SQL symbols/completions, and contributed view resolution
  • npm run test:integration:drivers against the seeded Docker stack in test/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:

BenchmarkLimit
ingest_100k_rows200ms
sort_100k_rows_single_column200ms
filter_100k_rows_regex100ms
export_csv_100k_rows400ms
parse_complex_query50ms
read_only_complex_query50ms

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, and tsql editors
  • verify mutation blocking in read-only mode
  • verify metadata failures surface clear errors instead of silently degrading
  • verify resultGrid.maxRows truncates 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:preflight and confirm artifacts/dbeagle-preflight.vsix packages cleanly from the repo root

Driver Smoke Matrix

Run the following matrix against the seeded test/local/ targets before shipping multi-driver changes:

DriverConnectBrowsePreviewRun queryCancelCompletion
Trinolocalhost:8080, catalog dbeagle, schema demoExpand dbeagle.demo and confirm the shared tables appearPreview dummy_orders from the treeSELECT 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 sessionIn a trino or sql editor, confirm table and column suggestions resolve for dummy_orders
PostgreSQLlocalhost:5432, database dbeagle, schema demoExpand dbeagle.demo and confirm the shared tables appearPreview dummy_orders from the treeSELECT 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 sessionIn a postgres or sql editor, confirm table and column suggestions resolve for demo.dummy_orders
MySQLlocalhost:3306, database dbeagleExpand the dbeagle database and confirm the shared tables appearPreview dummy_orders from the treeSELECT 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 sessionIn a mysql or sql editor, confirm table and column suggestions resolve for dbeagle.dummy_orders
SQL Serverlocalhost:1433, database dbeagle, schema demoExpand dbeagle.demo and confirm the shared tables appearPreview dummy_orders from the treeSELECT 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 sessionIn a mssql, tsql, or sql editor, confirm table and column suggestions resolve for demo.dummy_orders
Verticalocalhost:5433, database dbeagle, schema publicExpand dbeagle.public and confirm the shared tables appearPreview dummy_orders from the treeSELECT 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 sessionIn 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:up
  • npm run test:local:seed
  • npm run test:local:down
  • npm run test:local:trino:up
  • npm run test:local:trino:seed
  • npm run test:local:trino:down
  • npm run test:local:postgres:up
  • npm run test:local:postgres:seed
  • npm run test:local:postgres:down
  • npm run test:local:vertica:up
  • npm run test:local:vertica:seed
  • npm run test:local:vertica:down
  • npm run test:local:mysql:up
  • npm run test:local:mysql:seed
  • npm run test:local:mysql:down
  • npm run test:local:mssql:up
  • npm run test:local:mssql:seed
  • npm run test:local:mssql:down

The CI integration suite uses the combined stack:

  • npm run test:local:up
  • npm run test:local:seed
  • npm run test:integration:drivers
  • npm run test:local:down