ag-ui-protocol / ag-ui-protocol/ag-ui
test: migrate release-note Anthropic mocks to aimock
- 主要言語
- Python
- スター
- 15.9k
- フォーク
- 1.4k
- 平均マージ
- 1日 17時間
- マージ済み PR(30日)
- 163
説明
## Context
The retired-Anthropic-model audit exposed test-hygiene debt in `scripts/release/generate-ai-release-notes.test.ts`. The audit-remediation PR intentionally keeps its scope to updating model references; this issue tracks the test cleanup separately.
## Problem
The Anthropic request-path tests currently use hand-written HTTP servers instead of the repository's preferred aimock fixtures. In the affected test regions this also leaves:
- a dynamic `await import("node:http")` inside a test callback;
- type and non-null assertions such as `server!`, `server.address() as { port: number }`, and `receivedBody.messages!`;
- duplicated HTTP-server setup across multiple tests;
- a bespoke Anthropic response stub that can drift from provider request and response shapes.
## Proposed remediation
- Migrate the release-note Anthropic integration tests to Vitest with `@copilotkit/aimock/vitest` in strict replay mode.
- Add deterministic fixtures and assert the request journal, including method, path, headers, selected model, token limit, and prompt content.
- Replace dynamic imports, casts, non-null assertions, and duplicated server setup with typed file-local helpers.
- Keep the existing success, transport-failure, and non-2xx fail-soft coverage.
- Update the release-script CI workflow and package dependencies as required by the isolated migration.
## Acceptance criteria
- All existing release-note test behaviors remain covered.
- No live Anthropic request or credential is required.
- Unmatched model requests fail loudly in CI.
- The migrated test passes formatting, lint, explicit typecheck, and the full release-script test workflow.
コントリビューションガイド
評価
この issue はまだ評価されていません。