Skip to content

Commit b1d2c85

Browse files
authored
Merge branch 'main' into fix/toml-error-locations
2 parents f937b5a + 11c2c53 commit b1d2c85

9 files changed

Lines changed: 85 additions & 14 deletions

File tree

‎.github/workflows/release-performance.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ jobs:
6262
- name: Install dependencies
6363
run: uv sync --locked --all-groups --all-extras
6464
- name: Build candidate wheel
65-
run: uv build --wheel --out-dir "${RUNNER_TEMP}/candidate"
65+
run: |
66+
uv build --wheel --out-dir "${RUNNER_TEMP}/candidate"
67+
uv build --wheel crates/sqlbuild-cli --out-dir "${RUNNER_TEMP}/candidate"
6668
# Temporary: one-model edit compiles use MAX_EDIT_COMPILE_TIME_RATIO (1.35x) because an edited
6769
# model recompiles uncached; tighten it back to 1.15x once native rendering is the default.
6870
- name: Compare candidate and previous release on this runner

‎scripts/release_performance/_helpers/versions.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ def install_wheel(*, wheel: Path, venv_dir: Path, python: str) -> Path:
196196

197197
_create_venv(venv_dir=venv_dir, python=python)
198198
completed: subprocess.CompletedProcess[str] = _uv_pip_install(
199-
venv_dir=venv_dir, requirements=(str(wheel.resolve()),)
199+
venv_dir=venv_dir,
200+
requirements=("--find-links", str(wheel.resolve().parent), str(wheel.resolve())),
200201
)
201202
if completed.returncode != 0:
202203
raise ReleasePerformanceError(f"Installing {wheel} failed: {_tail(completed.stderr)}")

‎scripts/release_performance/constants.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,23 +86,23 @@
8686
name="lineage hub downstream",
8787
project=INSPECTION_PROJECT,
8888
sqb_args=("lineage", SHARED_DIAMOND_HUB, "--direction", "downstream"),
89+
max_rss_ratio=1.75,
8990
),
9091
BenchmarkCommand(
9192
name="lineage rollup upstream",
9293
project=INSPECTION_PROJECT,
9394
sqb_args=("lineage", SHARED_DIAMOND_ROLLUP, "--direction", "upstream"),
95+
max_rss_ratio=1.75,
9496
),
9597
BenchmarkCommand(
9698
name="lineage column trace",
9799
project=INSPECTION_PROJECT,
98100
sqb_args=("lineage", f"{SHARED_DIAMOND_ROLLUP}.amount", "--direction", "upstream"),
99-
max_rss_ratio=2.0,
100101
),
101102
BenchmarkCommand(
102103
name="dag --json",
103104
project=INSPECTION_PROJECT,
104105
sqb_args=("dag", "--json"),
105-
max_rss_ratio=1.5,
106106
),
107107
BenchmarkCommand(
108108
name="scope --json",
@@ -118,7 +118,6 @@
118118
),
119119
BenchmarkCommand(
120120
name="compile (one-model edit)",
121-
max_rss_ratio=1.35,
122121
project=INSPECTION_PROJECT,
123122
sqb_args=("compile", "--json"),
124123
edits_model=True,
@@ -128,6 +127,7 @@
128127
name="dense compile (warm cache)",
129128
project=DENSE_PROJECT,
130129
sqb_args=("compile", "--json"),
130+
max_rss_ratio=1.45,
131131
max_time_ratio=MAX_COMPILE_TIME_RATIO,
132132
),
133133
BenchmarkCommand(

‎tests/e2e/scripts/release_performance/test_compare_release_performance.py‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@
3939
"| `plan --json` |",
4040
"| `build (empty warehouse)` |",
4141
"| `lineage column trace` |",
42-
"Peak RSS limit for `lineage column trace`: 2.00x "
43-
"(+100%; temporary memory exception).",
44-
"Peak RSS limit for `dag --json`: 1.50x (+50%; temporary memory exception).",
42+
"Peak RSS limit for `lineage hub downstream`: 1.75x "
43+
"(+75%; temporary memory exception).",
44+
"Peak RSS limit for `dense compile (warm cache)`: 1.45x "
45+
"(+45%; temporary memory exception).",
4546
"Benchmark projects are generated per side",
4647
"**Result: ",
4748
),
@@ -121,9 +122,9 @@ def test_given_two_installations_when_comparing_release_performance_then_reports
121122
]
122123
for command in recorded["commands"]:
123124
assert command["max_rss_ratio"] == {
124-
"lineage column trace": 2.0,
125-
"dag --json": 1.5,
126-
"compile (one-model edit)": 1.35,
125+
"lineage hub downstream": 1.75,
126+
"lineage rollup upstream": 1.75,
127+
"dense compile (warm cache)": 1.45,
127128
}.get(command["name"])
128129

129130

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Integration checks for repository tooling."""
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Release candidate installation integration checks."""
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
"""Local candidate installation cases."""
2+
3+
from dataclasses import dataclass
4+
5+
6+
@dataclass(frozen=True)
7+
class LocalWheelTestCase:
8+
"""A synchronized candidate and companion version."""
9+
10+
description: str
11+
version: str
12+
expected_version: str
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
"""Exercise candidate installation with an unpublished companion wheel."""
2+
3+
import sys
4+
from pathlib import Path
5+
from zipfile import ZipFile
6+
7+
import pytest
8+
9+
from scripts.release_performance._helpers.versions import install_wheel, installed_version
10+
from tests.integration.scripts.release_performance._test_types import LocalWheelTestCase
11+
12+
13+
@pytest.mark.skipif(sys.platform == "win32", reason="Release comparison uses POSIX environments")
14+
@pytest.mark.parametrize(
15+
"test_case",
16+
[
17+
LocalWheelTestCase(
18+
description="unpublished companion installs offline beside its candidate",
19+
version="0.1.0",
20+
expected_version="0.1.0",
21+
)
22+
],
23+
ids=lambda case: case.description,
24+
)
25+
def test_given_unpublished_companion_when_installing_candidate_then_resolves_local_wheel(
26+
test_case: LocalWheelTestCase, tmp_path: Path, monkeypatch: pytest.MonkeyPatch
27+
) -> None:
28+
monkeypatch.setenv("UV_NO_INDEX", "1")
29+
wheels: Path = tmp_path / "wheels"
30+
wheels.mkdir()
31+
version: str = test_case.version
32+
for name, dependency, entry_points in (
33+
("sqlbuild", f"Requires-Dist: sqlbuild-cli=={version}\n", ""),
34+
("sqlbuild_cli", "", "[console_scripts]\nsqb = sqlbuild_cli_probe:main\n"),
35+
):
36+
metadata: str = f"Metadata-Version: 2.1\nName: {name}\nVersion: {version}\n{dependency}"
37+
with ZipFile(wheels / f"{name}-{version}-py3-none-any.whl", "w") as wheel:
38+
info: str = f"{name}-{version}.dist-info"
39+
wheel.writestr(f"{info}/METADATA", metadata)
40+
wheel.writestr(
41+
f"{info}/WHEEL",
42+
"Wheel-Version: 1.0\nGenerator: release-probe\n"
43+
"Root-Is-Purelib: true\nTag: py3-none-any\n",
44+
)
45+
wheel.writestr(f"{info}/RECORD", "")
46+
wheel.writestr(f"{name}_probe.py", f"def main():\n print('sqlbuild {version}')\n")
47+
wheel.writestr(f"{info}/entry_points.txt", entry_points)
48+
sqb: Path = install_wheel(
49+
wheel=wheels / f"sqlbuild-{version}-py3-none-any.whl",
50+
venv_dir=tmp_path / "candidate",
51+
python=sys.executable,
52+
)
53+
assert installed_version(sqb=sqb) == test_case.expected_version

‎tests/unit/scripts/release_performance/_helpers/test_verdict.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,9 @@ def test_given_configured_command_when_judging_time_then_its_own_limit_applies(
290290
description=f"{command.name} enforces its RSS allowance and time limits",
291291
command=command,
292292
expected_rss_ratio={
293-
"lineage column trace": 2.0,
294-
"dag --json": 1.5,
295-
"compile (one-model edit)": 1.35,
293+
"lineage hub downstream": 1.75,
294+
"lineage rollup upstream": 1.75,
295+
"dense compile (warm cache)": 1.45,
296296
}.get(command.name, 1.25),
297297
)
298298
for command in BENCHMARK_COMMANDS

0 commit comments

Comments
 (0)