feat(shipping-notice): 收敛阶段能力投影并修复库存 RPA 运行链路
下发 preparation capabilities 并与右卡展示同源授权; 库存 RPA 运行态请求内 memo;取消会话 Profile 本地 TTL; 并为 shipping-worker 挂载共享盘。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
f773237226
commit
a6edc4fe61
16 files changed
+433
-179
No files matched your search
@@ -1483,8 +1483,8 @@ def test_open_browser_reuses_dsv_session_profile_only_when_explicitly_enabled(mo
|
||||
assert worker._should_cleanup_browser_profile(profile_dir) is False
|
||||
|
||||
|
||||
def test_prepare_reusable_session_profile_expires_after_ttl(monkeypatch, tmp_path):
|
||||
"""超过 TTL 的持久 Profile 应被清空重建,迫使重新登录。"""
|
||||
def test_prepare_reusable_session_profile_keeps_existing_dir(tmp_path):
|
||||
"""持久 Profile 不按本地时间清空;已有内容应保留供站点会话继续复用。"""
|
||||
worker = _load_freight_rpa_worker()
|
||||
profile_dir = tmp_path / "dsv360__OLD_session"
|
||||
profile_dir.mkdir(parents=True)
|
||||
@@ -1495,7 +1495,6 @@ def test_prepare_reusable_session_profile_expires_after_ttl(monkeypatch, tmp_pat
|
||||
json.dumps({"created_at_unix": created, "connector_type": "dsv360", "profile_code": "OLD"}),
|
||||
encoding="utf-8",
|
||||
)
|
||||
monkeypatch.setenv("SHIPPING_NOTICE_RPA_WORKER_SESSION_REUSE_TTL_HOURS", "24")
|
||||
|
||||
prepared = worker._prepare_reusable_session_profile(
|
||||
profile_dir,
|
||||
@@ -1504,9 +1503,11 @@ def test_prepare_reusable_session_profile_expires_after_ttl(monkeypatch, tmp_pat
|
||||
)
|
||||
|
||||
assert prepared == profile_dir
|
||||
assert not stale_marker.exists()
|
||||
assert stale_marker.exists()
|
||||
meta = json.loads((profile_dir / ".hxops_rpa_session_meta.json").read_text(encoding="utf-8"))
|
||||
assert float(meta["created_at_unix"]) > created
|
||||
assert float(meta["created_at_unix"]) == created
|
||||
assert "ttl_hours" not in meta
|
||||
|
||||
|
||||
def test_is_dsv_username_page_ignores_login_method_page_text():
|
||||
"""第二步方法选择页即使残留第一步文案,也不应被误判为邮箱页。"""
|
||||
|
||||
Reference in new issue
Block a user