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.
()
| 64 | |
| 65 | |
| 66 | def 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 | |
| 92 | def main() -> int: |
no test coverage detected