qwen-code/integration-tests/sdk-typescript
易良 0c5a4deabd
test(integration): migrate flaky E2E tests to fake-openai-server (#7934)
* test(integration): migrate flaky E2E tests to fake-openai-server

Migrate 39 real-model test cases to use deterministic fake-openai-server
scripting, eliminating model output variance as a failure source.

- tool-control.test.ts: 23 cases migrated (tool filtering, permission
  denial, canUseTool routing, priority rules)
- abort-and-lifecycle.test.ts: 15 cases migrated (abort mechanics,
  lifecycle, cleanup, debug output)
- list_directory.test.ts: 1 case migrated (CLI TestRig with env injection)

channel-plugin.test.ts (3 cases) is intentionally left on real model —
it tests the full WebSocket→AcpBridge→model pipeline and belongs in the
nightly smoke layer per #7616.

Closes #7616

* test(ci): move channel-plugin to nightly + relax assertions

channel-plugin.test.ts tests the full WebSocket→AcpBridge→model pipeline
with real model inference. Its assertions on specific model output
('4', 'pineapple', '50') are inherently non-deterministic.

- Exclude from post-merge E2E jobs (Linux + macOS)
- Add dedicated nightly-only job with continue-on-error
- Relax assertions: verify response is non-empty rather than matching
  specific model output content
- Add retry: 2 to each test case

* fix(test): use streaming chunks for abort test, restore comment

- abort-and-lifecycle 'should handle abort during query execution':
  switch from non-streaming content to contentChunks so the abort
  signal reliably lands while the response is still streaming
- channel-plugin: restore existing comment per AGENTS.md convention

* test(integration): address fake server review feedback

* test(integration): trim fake server review assertions

* test(integration): tighten fake server cleanup

* test(integration): fix permanently-failing stdin-close case and harden list_directory against user settings

The stdin-close case's fake server needle contained a raw quote that
JSON.stringify-escaped transcripts can never match, and the scripted
write_file was rejected by prior-read enforcement; the script now keys
off a quote-free marker and reads before writing. list_directory now
pins auth via CLI flags so a developer's ~/.qwen/settings.json cannot
silently route the run to a real model endpoint.

* test(integration): tighten fake server review regressions

* test(integration): guard abort assertions

* test(integration): fix abort timer race and dead coreTools assertions

* test(integration): address fake server review findings

* test(integration): isolate fake fast model settings

* test(e2e): simplify isolated test setup

---------

Co-authored-by: qwen-code-dev-bot <qwen-code-dev-bot@users.noreply.github.com>
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Co-authored-by: Shaojin Wen <shaojin.wensj@alibaba-inc.com>
2026-07-29 11:42:32 +00:00
..
abort-and-lifecycle.test.ts test(integration): migrate flaky E2E tests to fake-openai-server (#7934) 2026-07-29 11:42:32 +00:00
configuration-options.test.ts Add chat recording toggle (CLI + settings) and disable recording in tests 2025-12-15 13:48:38 +08:00
mcp-server.test.ts ci(e2e): stabilize MCP/CLI flows and cancel stale main runs (#4039) 2026-05-12 16:09:30 +08:00
message-event-pairing.test.ts Fix SDK message event pairing and improve content block handling 2026-03-18 18:10:23 +08:00
multi-turn.test.ts test(sdk): simplify integration tests for reliability 2026-03-16 11:23:57 +08:00
permission-control.test.ts fix(test): widen model-response timeouts in SDK E2E tests for CI stability (#6979) (#6985) 2026-07-16 00:06:26 +00:00
sdk-mcp-server.test.ts fix: sdk mcp tests 2026-02-09 11:54:20 +08:00
session-id.test.ts fix: sandbox user permission in integration tests 2026-02-15 11:02:32 +08:00
single-turn.test.ts test: stabilize main e2e flakes (#3992) 2026-05-10 21:50:04 +08:00
subagents.test.ts test(e2e): stabilize tool control and subagent cases (#6803) 2026-07-13 07:47:41 +00:00
system-control.test.ts fix(test): count result messages instead of assistant messages in multi-model E2E test (#4341) 2026-05-20 10:42:51 +08:00
test-helper.ts fix(test): give every E2E case a clean directory again (#7811) 2026-07-27 07:52:29 +00:00
tool-control.test.ts test(integration): migrate flaky E2E tests to fake-openai-server (#7934) 2026-07-29 11:42:32 +00:00