fix(api-tests): use asyncio run in cs1 tests
All checks were successful
CD Pipeline / tests (push) Successful in 1m23s
Code Review / ai-code-review (push) Successful in 11s
CD Pipeline / build-and-deploy (push) Successful in 7m29s
CD Pipeline / post-deploy-checks (push) Successful in 2m34s

This commit is contained in:
Your Name
2026-05-31 12:30:09 +08:00
parent a192e5f56b
commit 514c201ff4
2 changed files with 3 additions and 4 deletions

View File

@@ -104,9 +104,7 @@ def _run_cs1_block(
_cs1_auto_approval = MagicMock()
_cs1_executor = ApprovalExecutionService()
asyncio.get_event_loop().run_until_complete(
_cs1_executor.execute_approved_action(_cs1_auto_approval)
)
asyncio.run(_cs1_executor.execute_approved_action(_cs1_auto_approval))
return mock_executor_cls, mock_exec_instance
@@ -217,7 +215,7 @@ class TestCS1AutoExecuteFailureDegradation:
except Exception:
pass # 降級:維持 PENDING
asyncio.get_event_loop().run_until_complete(_simulate())
asyncio.run(_simulate())
except Exception:
raised = True

View File

@@ -10,6 +10,7 @@
- `/zh-TW/iwooos` 階段完成回報的正式證據改為 `deploy marker`
- 文案改成以「最新 Gitea main deploy marker + post-deploy success」作為正式部署證據而不是綁死單一舊 CD run。
- `security-mirror-progress-guard.py` 新增防退化檢查,若 IwoooS stage report 頁面或 message 再出現 `CD 3261`guard 會阻擋。
- Gitea CD run `3297` 在既有 `tests/test_cs1_auto_execute.py` 同步測試遇到 Python 3.11 無預設 event loop 而失敗;補成 `asyncio.run(...)`,只修測試相容性,不更動 CS1 runtime 判斷或自動執行條件。
**目前邊界**