MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / update_sqlite_repo

Function update_sqlite_repo

misc/python/materialize/cli/run.py:66–89  ·  view source on GitHub ↗

Since the SQLite SLT repository is >2x the size of the entire Materialize repository we don't want it as a submodule for everyone to have to fetch, especially in CI. Instead only clone it when we run the tests.

()

Source from the content-addressed store, hash-verified

64
65
66def update_sqlite_repo() -> None:
67 """Since the SQLite SLT repository is >2x the size of the entire Materialize repository we don't want it as a submodule for everyone to have to fetch, especially in CI. Instead only clone it when we run the tests."""
68 path = pathlib.Path(MZ_ROOT / "test" / "sqllogictest" / "sqlite")
69 if (path / ".git").is_dir():
70 if ui.env_is_truthy("CI"):
71 spawn.runv(["git", "-C", str(path), "pull"])
72 else:
73 spawn.runv(["git", "-C", str(path), "fetch"])
74 local = spawn.capture(["git", "-C", str(path), "rev-parse", "@"])
75 remote = spawn.capture(["git", "-C", str(path), "rev-parse", "@{upstream}"])
76 if local != remote:
77 spawn.runv(["git", "-C", str(path), "pull"])
78 else:
79 path.mkdir(exist_ok=True)
80 spawn.runv(
81 [
82 "git",
83 "clone",
84 # This is currently way slower, I guess GitHub doesn't have it cached:
85 # "--depth=1",
86 "https://github.com/MaterializeInc/sqllogictest",
87 str(path),
88 ]
89 )
90
91
92def main() -> int:

Callers 4

workflow_fast_testsFunction · 0.90
workflow_slow_testsFunction · 0.90
workflow_selectionFunction · 0.90
mainFunction · 0.85

Calls 1

captureMethod · 0.80

Tested by

no test coverage detected