File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22 "tool_version" : " 1.2.0" ,
33 "demo_id" : " window" ,
44 "input_digest" : " sha256:e8771283a83c146a2cffce5fe316c1408200b6d7717cbb6d074334aa891672f3" ,
5- "config_digest" : " sha256:6bffef106b0fcdb04d54e3aac8fe5b4b800bf228ad03fe988861486691c76f65 " ,
5+ "config_digest" : " sha256:e7cb0264262cc997edf8f6b987dc0466098f23150d0c6204fb5fd7c245df1d7d " ,
66 "artifact_schema_versions" : {
77 "run_manifest" : " run-manifest/v1" ,
88 "telemetry_summary" : " telemetry-summary/v1"
Original file line number Diff line number Diff line change 22 "tool_version" : " 1.2.0" ,
33 "demo_id" : " window" ,
44 "input_digest" : " sha256:c08795a6a3c361a3339414c5a8441fb74c58f027c96931dbdc0da28560e132ac" ,
5- "config_digest" : " sha256:a6107a2a732e8f4bf03572e9e86697ce1daa0eed1871724d0b44ec677f924b37 " ,
5+ "config_digest" : " sha256:b02cfeb006b05c52f075c3aa454045cd4c46b25be5576e37e184c3f02bf9328b " ,
66 "artifact_schema_versions" : {
77 "run_manifest" : " run-manifest/v1" ,
88 "telemetry_summary" : " telemetry-summary/v1"
Original file line number Diff line number Diff line change 1313from types import SimpleNamespace
1414from typing import Any
1515
16- import yaml
17-
1816
1917REPO_ROOT = Path (__file__ ).resolve ().parents [1 ]
2018SRC_ROOT = REPO_ROOT / "src"
@@ -285,10 +283,7 @@ def _run_window_pipeline_job(
285283 shutil .copytree (REPO_ROOT / "data" / "raw" , generated_repo / "data" / "raw" )
286284
287285 generated_config_path = generated_config_dir / config_path .name
288- generated_config_path .write_text (
289- yaml .safe_dump (config , sort_keys = False ),
290- encoding = "utf-8" ,
291- )
286+ shutil .copyfile (config_path , generated_config_path )
292287 with _pushd (generated_repo ), redirect_stdout (io .StringIO ()):
293288 run_command (SimpleNamespace (config = str (generated_config_path )))
294289
Original file line number Diff line number Diff line change 11from __future__ import annotations
22
33import importlib .util
4+ import json
45import sys
56from pathlib import Path
67
8+ from telemetry_lab .manifest import digest_files
9+
710
811REPO_ROOT = Path (__file__ ).resolve ().parents [1 ]
912SCRIPT_PATH = REPO_ROOT / "scripts" / "regenerate_artifacts.py"
@@ -37,6 +40,26 @@ def test_regenerate_artifacts_check_matches_committed_outputs() -> None:
3740 assert exit_code == 0
3841
3942
43+ def test_window_regeneration_hashes_the_shipped_config_bytes (tmp_path ) -> None :
44+ script = _load_regeneration_script ()
45+ config_path = REPO_ROOT / "configs" / "default.yaml"
46+
47+ artifacts = script ._run_window_pipeline_job (
48+ tmp_path ,
49+ config_path = config_path ,
50+ committed_root = REPO_ROOT / "data" / "processed" ,
51+ )
52+ manifest = json .loads (
53+ (artifacts .generated_root / "run_manifest.json" ).read_text (
54+ encoding = "utf-8"
55+ )
56+ )
57+
58+ assert manifest ["config_digest" ] == digest_files (
59+ {config_path .name : config_path }
60+ )
61+
62+
4063def test_regenerate_artifacts_reports_mismatched_strict_artifact (tmp_path ) -> None :
4164 script = _load_regeneration_script ()
4265 committed_root = tmp_path / "committed"
You can’t perform that action at this time.
0 commit comments