Merge pull request #4 from xmindlab-heicode/fix/ci-all-suites
CI:7 套测试全部纳入 gate + 修复 e2e 退出竞态(非验收)
This commit is contained in:
@@ -54,3 +54,19 @@ jobs:
|
||||
- name: End-to-end workflow test
|
||||
env: { REDIS_FAKE: "1" }
|
||||
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
|
||||
|
||||
@@ -68,7 +68,8 @@ async def main():
|
||||
config = uvicorn.Config(orch.app, host="127.0.0.1", port=PORT, log_level="warning")
|
||||
server = uvicorn.Server(config)
|
||||
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", [
|
||||
"python", "code_generation", "testing", "pytest", "technical-writing", "general",
|
||||
@@ -78,7 +79,7 @@ async def main():
|
||||
async with httpx.AsyncClient(timeout=10) as client:
|
||||
if not await wait_health(client):
|
||||
check("orchestrator started", False)
|
||||
return
|
||||
return 1
|
||||
|
||||
agent_task = asyncio.create_task(agent.run())
|
||||
await asyncio.sleep(0.5) # let the agent register
|
||||
@@ -120,13 +121,20 @@ async def main():
|
||||
if agent_task:
|
||||
agent_task.cancel()
|
||||
server.should_exit = True
|
||||
server_thread.join(timeout=5) # let uvicorn stop so no daemon thread lingers at exit
|
||||
|
||||
print()
|
||||
if 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")
|
||||
return 0
|
||||
|
||||
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user