feat: complete production workflow migration
This commit is contained in:
@@ -31,6 +31,7 @@ EXPECTED = {
|
||||
"adaptive_selectors.py",
|
||||
"collectors/jd_data_collector.py",
|
||||
"collectors/jd_peer_store_data_collector.py",
|
||||
"collectors/jd_self_operated_brand_daily.py",
|
||||
"collectors/dy_store_competitor_store_scraping.py",
|
||||
"collectors/taobao_sycm.py",
|
||||
"runners/run_shop.py",
|
||||
@@ -39,9 +40,8 @@ EXPECTED = {
|
||||
"writers/peer_store_writer.py",
|
||||
"db/db.py",
|
||||
"db/schema.sql",
|
||||
"scripts/setup_scheduler.ps1",
|
||||
},
|
||||
"classifications": {"scheduled", "internal", "maintenance"},
|
||||
"classifications": {"scheduled", "manual", "internal"},
|
||||
},
|
||||
"supply_chain": {
|
||||
"minimum_files": 37,
|
||||
@@ -100,13 +100,12 @@ def test_source_manifest_covers_runtime_sources_and_entrypoints(module: str) ->
|
||||
target = PurePosixPath(item["target_relative_path"])
|
||||
assert not target.is_absolute()
|
||||
assert ".." not in target.parts
|
||||
assert target.parts[:5] == (
|
||||
"src",
|
||||
"gyxx_flow",
|
||||
"modules",
|
||||
module,
|
||||
"runtime",
|
||||
)
|
||||
if item["category"] == "test":
|
||||
assert target.parts[:3] == ("tests", "modules", module)
|
||||
elif target.parts[0] == "src":
|
||||
assert target.parts[:4] == ("src", "gyxx_flow", "modules", module)
|
||||
else:
|
||||
assert target.parts[:2] == ("docs", "history")
|
||||
assert SHA256.fullmatch(item["source_sha256"])
|
||||
assert SHA256.fullmatch(item["target_sha256"])
|
||||
assert item["transformed"] is (
|
||||
@@ -125,9 +124,7 @@ def test_source_manifest_covers_runtime_sources_and_entrypoints(module: str) ->
|
||||
def test_runtime_files_match_manifest_and_are_decoupled(module: str) -> None:
|
||||
manifest_path = MANIFEST_ROOT / f"{module}.json"
|
||||
manifest = json.loads(manifest_path.read_text(encoding="utf-8"))
|
||||
runtime_root = (
|
||||
PROJECT_ROOT / "src" / "gyxx_flow" / "modules" / module / "runtime"
|
||||
)
|
||||
runtime_root = PROJECT_ROOT / "src" / "gyxx_flow" / "modules" / module
|
||||
|
||||
for item in manifest["files"]:
|
||||
target = PROJECT_ROOT.joinpath(
|
||||
@@ -166,15 +163,18 @@ def test_source_manifest_explicitly_excludes_secrets_and_runtime_state(
|
||||
"**/data/**",
|
||||
"**/logs/**",
|
||||
} <= excluded
|
||||
if module == "shop_intelligence":
|
||||
assert {
|
||||
"scripts/setup_scheduler.ps1",
|
||||
"scripts/remove_scheduler.ps1",
|
||||
} <= excluded
|
||||
|
||||
|
||||
@pytest.mark.parametrize("module", sorted(EXPECTED))
|
||||
def test_runtime_has_no_legacy_absolute_paths_or_sys_path_bootstrap(
|
||||
module: str,
|
||||
) -> None:
|
||||
runtime_root = (
|
||||
PROJECT_ROOT / "src" / "gyxx_flow" / "modules" / module / "runtime"
|
||||
)
|
||||
runtime_root = PROJECT_ROOT / "src" / "gyxx_flow" / "modules" / module
|
||||
for path in runtime_root.rglob("*"):
|
||||
if not path.is_file() or b"\x00" in path.read_bytes():
|
||||
continue
|
||||
@@ -191,11 +191,10 @@ def test_supply_backfill_reads_only_from_portable_shared_data_root() -> None:
|
||||
/ "gyxx_flow"
|
||||
/ "modules"
|
||||
/ "supply_chain"
|
||||
/ "runtime"
|
||||
/ "orchestrator"
|
||||
/ "sql"
|
||||
/ "backfill_history.py"
|
||||
).read_text(encoding="utf-8-sig")
|
||||
|
||||
assert "from gyxx_flow.modules.supply_chain.runtime.paths import SHARED_ROOT" in backfill
|
||||
assert "from gyxx_flow.modules.supply_chain.paths import SHARED_ROOT" in backfill
|
||||
assert "ROOT = SHARED_ROOT" in backfill
|
||||
|
||||
Reference in New Issue
Block a user