Skip to content

The agent that grows with you

test(kanban): harden cross-platform assertions

Jakub Wolniewiczfdda104f1333
diff --git a/tests/hermes_cli/test_kanban_review_surfaces.py b/tests/hermes_cli/test_kanban_review_surfaces.py
index f9efc150690..ff716b9ab7a 100644
--- a/tests/hermes_cli/test_kanban_review_surfaces.py
+++ b/tests/hermes_cli/test_kanban_review_surfaces.py
@@ -174,7 +174,7 @@ def test_worker_guidance_distinguishes_same_card_and_downstream_review() -> None
repo_root = Path(__file__).resolve().parents[2]
review_skill = repo_root / "skills" / "devops" / "sdlc-review" / "SKILL.md"
- skill_text = review_skill.read_text()
+ skill_text = review_skill.read_text(encoding="utf-8")
assert "kanban_request_changes" in skill_text
assert "approve" in skill_text.lower()
assert "escalate" in skill_text.lower()
diff --git a/tests/hermes_cli/test_kanban_swarm.py b/tests/hermes_cli/test_kanban_swarm.py
index 6832942f6ef..c4acf57928e 100644
--- a/tests/hermes_cli/test_kanban_swarm.py
+++ b/tests/hermes_cli/test_kanban_swarm.py
@@ -30,6 +30,11 @@ def test_create_swarm_builds_parallel_workers_verifier_and_synthesizer(tmp_path)
verifier = kb.get_task(conn, created.verifier_id)
synthesizer = kb.get_task(conn, created.synthesizer_id)
+ assert root is not None
+ assert all(task is not None for task in workers)
+ workers = [task for task in workers if task is not None]
+ assert verifier is not None
+ assert synthesizer is not None
assert root.status == "done"
assert root.assignee == "orchestrator"
assert [task.status for task in workers] == ["ready", "ready"]
@@ -140,13 +145,21 @@ def test_swarm_verifier_and_synthesis_are_dependency_gated(tmp_path):
metadata={"confidence": 0.8},
)
kb.recompute_ready(conn)
- assert kb.get_task(conn, created.verifier_id).status == "todo"
- assert kb.get_task(conn, created.synthesizer_id).status == "todo"
+ verifier = kb.get_task(conn, created.verifier_id)
+ synthesizer = kb.get_task(conn, created.synthesizer_id)
+ assert verifier is not None
+ assert synthesizer is not None
+ assert verifier.status == "todo"
+ assert synthesizer.status == "todo"
kb.complete_task(conn, created.worker_ids[1], summary="B done")
kb.recompute_ready(conn)
- assert kb.get_task(conn, created.verifier_id).status == "ready"
- assert kb.get_task(conn, created.synthesizer_id).status == "todo"
+ verifier = kb.get_task(conn, created.verifier_id)
+ synthesizer = kb.get_task(conn, created.synthesizer_id)
+ assert verifier is not None
+ assert synthesizer is not None
+ assert verifier.status == "ready"
+ assert synthesizer.status == "todo"
kb.complete_task(
conn,
@@ -155,6 +168,8 @@ def test_swarm_verifier_and_synthesis_are_dependency_gated(tmp_path):
metadata={"gate": "pass"},
)
kb.recompute_ready(conn)
- assert kb.get_task(conn, created.synthesizer_id).status == "ready"
+ synthesizer = kb.get_task(conn, created.synthesizer_id)
+ assert synthesizer is not None
+ assert synthesizer.status == "ready"
finally:
conn.close()
diff --git a/tests/plugins/test_kanban_dashboard_plugin.py b/tests/plugins/test_kanban_dashboard_plugin.py
index 692aaa722b7..7a8b56ef0bd 100644
--- a/tests/plugins/test_kanban_dashboard_plugin.py
+++ b/tests/plugins/test_kanban_dashboard_plugin.py
@@ -181,7 +181,7 @@ def test_dashboard_markdown_html_is_sanitized_before_render():
repo_root = Path(__file__).resolve().parents[2]
bundle = repo_root / "plugins" / "kanban" / "dashboard" / "dist" / "index.js"
- js = bundle.read_text()
+ js = bundle.read_text(encoding="utf-8")
assert "function sanitizeMarkdownHtml(html)" in js
assert "MARKDOWN_ALLOWED_TAGS" in js