Skip to content

perf: plan SQL tests during warehouse inspection and skip them without tests - #796

Merged
kvlonge merged 2 commits into
mainfrom
perf/overlap-sql-test-planning
Sep 23, 2026
Merged

kvlonge merged 2 commits into
mainfrom
perf/overlap-sql-test-planning

Conversation

@kvlonge

@kvlonge kvlonge commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Why

sqb plan and sqb build planned every selected SQL test from scratch after warehouse inspection finished, even though test planning never touches the warehouse. On a large project this took most of the "Generated plan" phase. build --no-tests planned tests it would never run.

Changes

  • SQL test planning runs on a background daemon thread started once scopes are resolved, overlapping warehouse inspection. The result is joined before plan assembly and reused only when its selected keys match the execution scope; otherwise tests are planned as before. Planning errors are raised at the same point as before.
  • build --no-tests, direct and virtual, no longer plans SQL tests. As a result, an invalid test fixture no longer fails build --no-tests; normal builds still reject it.
  • A failed or interrupted plan never waits for the background thread before exiting.

Verification

  • Real large-project sqb plan, 3 paired runs: "Generated plan" went from 17.6–19.3s to 3.0–4.2s. The full plan was identical to main apart from live data-version fields, which also differ between two main runs.
  • New real-CLI integration tests for direct and virtual builds with an invalid fixture, with and without --no-tests. Unit tests cover the background result, disabled planning, error propagation and the daemon worker.
  • make test and make check-ci pass, public-repo scan clean, one review cycle with findings fixed and re-verified.

@kvlonge
kvlonge enabled auto-merge (squash) September 23, 2026 16:58
@kvlonge
kvlonge force-pushed the perf/overlap-sql-test-planning branch from c357096 to c865484 Compare September 23, 2026 17:09
@kvlonge
kvlonge merged commit 6f1a086 into main Sep 23, 2026
28 checks passed
@kvlonge
kvlonge deleted the perf/overlap-sql-test-planning branch September 23, 2026 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant