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
--local before 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 --local does not connect to the state backend
- Default
sqlmesh test (no flag) is unchanged
- Group-level Context construction must honor
--local the same way lint does (the parent callback builds Context before the test command runs)
Summary
sqlmesh lint --localskips 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--localwith lint.Current behavior
--localbefore Context is constructed (load_state=False)Proposed CLI
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 backendsqlmesh test(no flag) is unchanged--localthe same way lint does (the parent callback builds Context before the test command runs)