Skip to content

Add --local to sqlmesh test #6022

Description

@cmgoffena13

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions