refactor(rpa): 重构 scripts/rpa 目录结构与命名

按 common/connectors/inventory/receipt 分层并重命名

- common/: rpa_common, rpa_heartbeat, download_artifact_fallback,
  new_rpa_worker_secret
- connectors/dsv|crane/: 登录网站连接器,库存与收料共用
- inventory/: inventory_rpa_worker, run_inventory_batch_trigger,
  start_inventory_worker, register_inventory_worker_tasks
- receipt/: receipt_rpa_worker, receipt_crane/dbs_export,
  start_receipt_worker

保留裸 import + sys.path 引导;修正懒加载路径;
按范围命名 register_rpa_background_tasks -> register_inventory_worker_tasks;
同步 backend 测试、start_local.ps1、.env 注释、docs 与 README 路径。
This commit is contained in:
hugo committed 2026-08-28 17:12:33 +08:00
1 parent 09deada712
commit f3050164d0
40 files changed
+384 -172

No files matched your search

+2 -2
View File
@@ -8,7 +8,7 @@ from unittest.mock import MagicMock
def _load_crane_session():
module_path = Path(__file__).resolve().parents[2] / "scripts" / "rpa" / "crane_session.py"
module_path = Path(__file__).resolve().parents[2] / "scripts" / "rpa" / "connectors" / "crane" / "crane_session.py"
spec = importlib.util.spec_from_file_location("crane_session_test", module_path)
assert spec and spec.loader
module = importlib.util.module_from_spec(spec)
@@ -144,7 +144,7 @@ def test_find_crane_sign_in_button_waits_for_enabled_state(monkeypatch):
def test_ensure_crane_session_skips_login_when_session_active(monkeypatch):
"""batch 内 session 有效时不应重复 goto + login。"""
worker_path = Path(__file__).resolve().parents[2] / "scripts" / "rpa" / "freight_rpa_worker.py"
worker_path = Path(__file__).resolve().parents[2] / "scripts" / "rpa" / "inventory" / "inventory_rpa_worker.py"
spec = importlib.util.spec_from_file_location("freight_rpa_worker_crane_test", worker_path)
assert spec and spec.loader
worker = importlib.util.module_from_spec(spec)