Merge pull request #4 from xmindlab-heicode/fix/ci-all-suites

CI:7 套测试全部纳入 gate + 修复 e2e 退出竞态(非验收)
This commit is contained in:
Fasthei
2026-06-09 17:50:58 +08:00
committed by GitHub
2 changed files with 28 additions and 4 deletions
+16
View File
@@ -54,3 +54,19 @@ jobs:
- name: End-to-end workflow test - name: End-to-end workflow test
env: { REDIS_FAKE: "1" } env: { REDIS_FAKE: "1" }
run: python scripts/test-workflow-e2e.py run: python scripts/test-workflow-e2e.py
- name: Manager event-contract test
env: { REDIS_FAKE: "1" }
run: python scripts/test-contract-events.py
- name: Benchmark metric formulas (v2.1)
env: { REDIS_FAKE: "1" }
run: python scripts/test-benchmark-metrics.py
- name: Benchmark collector
env: { REDIS_FAKE: "1" }
run: python scripts/test-benchmark-collector.py
- name: Baseline comparison
env: { REDIS_FAKE: "1" }
run: python scripts/test-baseline-comparison.py
+12 -4
View File
@@ -68,7 +68,8 @@ async def main():
config = uvicorn.Config(orch.app, host="127.0.0.1", port=PORT, log_level="warning") config = uvicorn.Config(orch.app, host="127.0.0.1", port=PORT, log_level="warning")
server = uvicorn.Server(config) server = uvicorn.Server(config)
server.install_signal_handlers = lambda: None # required when not on the main thread server.install_signal_handlers = lambda: None # required when not on the main thread
threading.Thread(target=server.run, daemon=True).start() server_thread = threading.Thread(target=server.run, daemon=True)
server_thread.start()
agent = StubAgent(WS, "stub-1", [ agent = StubAgent(WS, "stub-1", [
"python", "code_generation", "testing", "pytest", "technical-writing", "general", "python", "code_generation", "testing", "pytest", "technical-writing", "general",
@@ -78,7 +79,7 @@ async def main():
async with httpx.AsyncClient(timeout=10) as client: async with httpx.AsyncClient(timeout=10) as client:
if not await wait_health(client): if not await wait_health(client):
check("orchestrator started", False) check("orchestrator started", False)
return return 1
agent_task = asyncio.create_task(agent.run()) agent_task = asyncio.create_task(agent.run())
await asyncio.sleep(0.5) # let the agent register await asyncio.sleep(0.5) # let the agent register
@@ -120,13 +121,20 @@ async def main():
if agent_task: if agent_task:
agent_task.cancel() agent_task.cancel()
server.should_exit = True server.should_exit = True
server_thread.join(timeout=5) # let uvicorn stop so no daemon thread lingers at exit
print() print()
if failures: if failures:
print(f"{len(failures)} workflow check(s) FAILED: {failures}") print(f"{len(failures)} workflow check(s) FAILED: {failures}")
sys.exit(1) return 1
print("workflow follows the expected sequence: decompose -> dispatch -> execute -> review/iterate -> synthesize") print("workflow follows the expected sequence: decompose -> dispatch -> execute -> review/iterate -> synthesize")
return 0
if __name__ == "__main__": if __name__ == "__main__":
asyncio.run(main()) # os._exit after flushing avoids a Fatal Python error if the uvicorn daemon thread is still
# finalizing (writing to stderr) at interpreter shutdown — guarantees a deterministic exit code.
_code = asyncio.run(main())
sys.stdout.flush()
sys.stderr.flush()
os._exit(_code or 0)