同步 agent/project context 基线测试到 runtime/workspaces 根路径约定。

将测试样例路径从旧的 oclaw/runtime/workspaces 迁移到当前 PROJECT_ROOT/runtime/workspaces,保持 bootstrap 与 role context 读取断言与实现一致。

Made-with: Cursor
This commit is contained in:
oliver 2026-04-27 16:12:20 +08:00
parent 24bf6e8eaf
commit 09836dddfa
2 changed files with 8 additions and 8 deletions

View file

@ -13,7 +13,7 @@ def _set_project_root(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None:
def test_build_role_system_context_reads_runtime_workspaces(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None:
_set_project_root(monkeypatch, tmp_path)
ws = tmp_path / "oclaw" / "runtime" / "workspaces" / "main"
ws = tmp_path / "runtime" / "workspaces" / "main"
ws.mkdir(parents=True, exist_ok=True)
(ws / "SOUL.md").write_text("main soul", encoding="utf-8")
(ws / "ROLE_SYSTEM.md").write_text("main role system", encoding="utf-8")
@ -28,7 +28,7 @@ def test_build_role_system_context_cache_invalidates_on_file_change(
monkeypatch: pytest.MonkeyPatch, tmp_path: Path
) -> None:
_set_project_root(monkeypatch, tmp_path)
ws = tmp_path / "oclaw" / "runtime" / "workspaces" / "ops"
ws = tmp_path / "runtime" / "workspaces" / "ops"
ws.mkdir(parents=True, exist_ok=True)
role_file = ws / "ROLE_SYSTEM.md"
role_file.write_text("v1", encoding="utf-8")
@ -41,7 +41,7 @@ def test_build_role_system_context_cache_invalidates_on_file_change(
def test_build_role_system_context_renders_template_vars(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None:
_set_project_root(monkeypatch, tmp_path)
ws = tmp_path / "oclaw" / "runtime" / "workspaces" / "ops"
ws = tmp_path / "runtime" / "workspaces" / "ops"
ws.mkdir(parents=True, exist_ok=True)
(ws / "ROLE_SYSTEM.md").write_text("experts={{EXPERTS_HINT}}", encoding="utf-8")
out = loader_mod.build_role_system_context("ops", template_vars={"EXPERTS_HINT": "ops,generalist"})
@ -52,7 +52,7 @@ def test_build_role_system_context_template_var_isolated_by_cache_key(
monkeypatch: pytest.MonkeyPatch, tmp_path: Path
) -> None:
_set_project_root(monkeypatch, tmp_path)
ws = tmp_path / "oclaw" / "runtime" / "workspaces" / "ops"
ws = tmp_path / "runtime" / "workspaces" / "ops"
ws.mkdir(parents=True, exist_ok=True)
(ws / "ROLE_SYSTEM.md").write_text("x={{A}}", encoding="utf-8")
a = loader_mod.build_role_system_context("ops", template_vars={"A": "one"})