Skip to content

Commit 4ffa6d4

Browse files
committed
test(e2e): rename the attachment cache JSON helper to avoid shadowing
1 parent 89eb40c commit 4ffa6d4

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎tests/e2e/src/sqlbuild/cli/commands/main/compile/helpers.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2633,7 +2633,7 @@ def compile_manifest_run_ids(*, project_dir: Path, env: dict[str, str]) -> froze
26332633
return frozenset(_HOOK_RUN_ID_PATTERN.findall(manifest))
26342634

26352635

2636-
def compile_json_payload(*, project_dir: Path, env: dict[str, str]) -> dict[str, Any]:
2636+
def fresh_compile_json_payload(*, project_dir: Path, env: dict[str, str]) -> dict[str, Any]:
26372637
"""Compile in a fresh process and return the parsed JSON payload."""
26382638

26392639
result: subprocess.CompletedProcess[str] = run_installed_sqb(

‎tests/e2e/src/sqlbuild/cli/commands/main/compile/test_compile_attachment_cache.py‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
CompileCacheOutcome,
2020
attachment_cache_counts,
2121
compile_cache_outcome,
22-
compile_json_payload,
2322
compile_manifest_run_ids,
23+
fresh_compile_json_payload,
2424
outcome_attachment_counts,
2525
replace_project_text,
2626
write_project_file,
@@ -175,8 +175,8 @@ def test_given_attachment_diagnostics_when_compiling_warm_then_cache_hit_replays
175175
write_project_files(project_dir, test_case.files)
176176
env: dict[str, str] = {COMPILE_CACHE_REGION_ENV_VAR: "east"}
177177

178-
cold: dict[str, Any] = compile_json_payload(project_dir=project_dir, env=env)
179-
warm: dict[str, Any] = compile_json_payload(project_dir=project_dir, env=env)
178+
cold: dict[str, Any] = fresh_compile_json_payload(project_dir=project_dir, env=env)
179+
warm: dict[str, Any] = fresh_compile_json_payload(project_dir=project_dir, env=env)
180180
warm_outcome: CompileCacheOutcome = compile_cache_outcome(project_dir=project_dir, env=env)
181181
reference: CompileCacheOutcome = compile_cache_outcome(
182182
project_dir=project_dir, env=env, compile_args=("--no-cache",)
@@ -230,21 +230,21 @@ def test_given_replayed_diagnostic_when_reference_policy_toggles_then_matches_un
230230
project_dir: Path = cache_invalidation_project
231231
write_project_files(project_dir, test_case.files)
232232
env: dict[str, str] = {COMPILE_CACHE_REGION_ENV_VAR: "east"}
233-
_ = compile_json_payload(project_dir=project_dir, env=env)
234-
strict_warm: dict[str, Any] = compile_json_payload(project_dir=project_dir, env=env)
233+
_ = fresh_compile_json_payload(project_dir=project_dir, env=env)
234+
strict_warm: dict[str, Any] = fresh_compile_json_payload(project_dir=project_dir, env=env)
235235

236236
test_case.relax(project_dir)
237237
relaxed: CompileCacheOutcome = compile_cache_outcome(project_dir=project_dir, env=env)
238238
relaxed_reference: CompileCacheOutcome = compile_cache_outcome(
239239
project_dir=project_dir, env=env, compile_args=("--no-cache",)
240240
)
241-
relaxed_rewarm: dict[str, Any] = compile_json_payload(project_dir=project_dir, env=env)
241+
relaxed_rewarm: dict[str, Any] = fresh_compile_json_payload(project_dir=project_dir, env=env)
242242
test_case.restore(project_dir)
243243
restored: CompileCacheOutcome = compile_cache_outcome(project_dir=project_dir, env=env)
244244
restored_reference: CompileCacheOutcome = compile_cache_outcome(
245245
project_dir=project_dir, env=env, compile_args=("--no-cache",)
246246
)
247-
restored_rewarm: dict[str, Any] = compile_json_payload(project_dir=project_dir, env=env)
247+
restored_rewarm: dict[str, Any] = fresh_compile_json_payload(project_dir=project_dir, env=env)
248248

249249
assert tuple(item["code"] for item in strict_warm["diagnostics"]) == (
250250
test_case.expected_strict_codes

0 commit comments

Comments
 (0)