Add --local to sqlmesh test #6022
Copy link
Copy link
Closed
Description
Summary
sqlmesh lint --local skips loading remote state. sqlmesh test always loads state, so a commit hook or offline unit-test run can still open the warehouse/state backend. Will possibly run into issues with multiple gateways, similar to --local with lint.
Current behavior
- Format is already local-only
- Lint special-cases
--localbefore Context is constructed (load_state=False) - Test is not in that set and has no flag
Proposed CLI
sqlmesh test --local
sqlmesh test --local tests/test_orders.yaml
Same meaning as lint: use only locally loaded project files, do not load state. Multi-repo projects that rely on models that exist only in remote state may see missing-reference errors; that is acceptable and should be documented the same way as lint.
Acceptance
sqlmesh test --localdoes not connect to the state backend- Default
sqlmesh test(no flag) is unchanged - Group-level Context construction must honor
--localthe same way lint does (the parent callback builds Context before the test command runs)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
format,lint, andtestcommands to make pre-commit setup simple and more efficient #6020tripleaceme commentedon Sep 12, 2026
I'd like to take this one if it's free with no assignee or linked PR right now.