Files
gyxx-flow/tests/test_engineering_baseline.py
T
wangyunlong 622a609800 feat(product-commerce): 系列聚合去重与采集开关两层语义
配置来源收敛
- 系列平台编码 tm/jd/dy/jd_self 与 9 类飞书地址改为整系列并集去重后挂锚点,
  子款编码保留在 series.platform_ids 备查;多表冲突保留最高优先级并告警
- 写表脚本(当日/天猫主图/京东主图)去掉本地 JSON 回退,地址缺失或读取失败
  直接 fail closed,避免库与表地址不一致被静默掩盖
- 测试注入 records_provider 时禁用配置缓存读写,防止假数据写入生产快照

采集开关(dim_style.collect_enabled)
- 锚点为系列总开关:false 则整系列不采
- 锚点为 true 时,子款自身 false 仅把自己的 ERP 编码排除出聚合,其余子款照常
- 排除结果记录在 series.erp_excluded 并在运行时提示

聚水潭全店铺日报防错
- 列布局 fail closed、行 td 数校验、满页判定 + 总页数兜底、值域交叉校验
- 新增单日总量闸:超近 14 天中位数 8 倍拒绝落库

其他
- 新增电商费用归集配置 ad_cost_rollup.json 与积分兑换周报采集
- 店铺情报、供应链到货同步、通知路由与相关配置/文档同步更新
- 忽略本地 dsh workbench 脚手架(含 node_modules)
2026-10-30 11:49:31 +08:00

83 lines
2.9 KiB
Python

from __future__ import annotations
import tomllib
from pathlib import Path
PROJECT_ROOT = Path(__file__).resolve().parents[1]
BUSINESS_MODULES = (
"content_marketing",
"product_commerce",
"shop_intelligence",
"supply_chain",
)
def test_repository_keeps_the_simplified_public_structure() -> None:
modules_root = PROJECT_ROOT / "src" / "gyxx_flow" / "modules"
for module in BUSINESS_MODULES:
module_root = modules_root / module
compatibility_items = {
path.name
for path in (module_root / "runtime").iterdir()
if path.name != "__pycache__"
}
assert compatibility_items == {"__init__.py"}
assert not (module_root / "tests").exists()
assert not (module_root / "runtime_tests").exists()
primary_docs = {
path.name for path in (PROJECT_ROOT / "docs").iterdir() if path.is_file()
}
assert primary_docs == {
"acceptance-report.md",
"architecture.md",
"deployment.md",
"dynamic-workflow-config.md",
"note-inventory.md",
"plan.md",
"runbook.md",
"workflow-acceptance-test-report.md",
"workflow-acceptance-test-requirements.md",
"workflow-console.md",
"workflows-overview.md",
"workflow-time-distribution.md",
}
assert not {
"design.md",
"final_report.md",
"plan.md",
"review.md",
} & {path.name for path in PROJECT_ROOT.iterdir() if path.is_file()}
def test_development_group_contains_reproducible_quality_tools() -> None:
configuration = tomllib.loads(
(PROJECT_ROOT / "pyproject.toml").read_text(encoding="utf-8")
)
development = configuration["dependency-groups"]["dev"]
package_names = {requirement.split(">=", 1)[0] for requirement in development}
assert {"build", "pytest", "ruff"} <= package_names
assert (
"src/gyxx_flow/modules/*/**"
in configuration["tool"]["ruff"]["extend-exclude"]
)
assert configuration["tool"]["pytest"]["ini_options"]["testpaths"] == ["tests"]
def test_gitlab_ci_runs_lock_lint_tests_and_build() -> None:
pipeline = (PROJECT_ROOT / ".gitlab-ci.yml").read_text(encoding="utf-8")
assert "uv sync --frozen --group dev" in pipeline
assert "uv run ruff check src tests" in pipeline
assert "uv run ruff check src/gyxx_flow/modules/content_marketing/daily_creator_exposure_scope.py" in pipeline
assert "src/gyxx_flow/modules/product_commerce/market_rank_product_import.py" in pipeline
assert "uv run pytest" in pipeline
assert "test_daily_creator_exposure_scope.py" in pipeline
assert "test_chanmama_refresh_before_export.py" in pipeline
assert "test_daily_exposure_fields.py" in pipeline
assert "test_market_rank_limits.py" in pipeline
assert "test_market_rank_product_import.py" in pipeline
assert "uv build" in pipeline