Skip to content

tests: refactor HTTP JSON client and streaming tests to extract helpers and constants - #258

Merged
MisterVVP merged 1 commit into
mainfrom
dev-refactor-integration-tests-to-remove-nolint-suppressions
Oct 1, 2026
Merged

MisterVVP merged 1 commit into
mainfrom
dev-refactor-integration-tests-to-remove-nolint-suppressions

Conversation

@MisterVVP

@MisterVVP MisterVVP commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

Motivation

  • Reduce duplication and improve readability across HTTP JSON client and streaming integration tests by centralizing repeated logic and constants.
  • Make test intent clearer by moving request/response validations and stream behaviors into named helpers.

Description

  • Introduce shared constants kTaskId, kPushConfigId, and kStreamCompletionTimeout and helper builders like MakeOkResponse and MakeCallOptions to consolidate common setup.
  • Extract request/response validation helpers for message sending (ExpectSendMessageRequest, ExpectSendMessageHeadersAndBody) and for task/list/push-config handling (HandleGetAndCancelRequest, HandleListTasksRequest, HandlePushConfigRequest) and add VerifyPushConfigCrud/VerifyPushConfigListAndDelete to reuse CRUD assertions.
  • Factor streaming test utilities including MakeStreamingMessageRequest, ValidateSendRequestAndEmitChunks, EmitUntilCancelled, ExpectFragmentedEvents, ExpectRemoteProtocolError, and EmitJsonErrorResponse to centralize SSE emission and observer validations.
  • Small API/test adjustments: change ReadFromResponse parameter to std::string_view and normalize protocol_code checks with value_or in McpClientTest.

@MisterVVP MisterVVP added the codex Automatic label added by codex agent. Should not be used label Oct 1, 2026 — with ChatGPT Codex Connector
@MisterVVP MisterVVP self-assigned this Oct 1, 2026
@MisterVVP MisterVVP added AI agent AI agent contribution and removed codex Automatic label added by codex agent. Should not be used labels Oct 1, 2026
@MisterVVP MisterVVP added refactoring Constant technical improvements which are not necessarily related to any issue. maintenance labels Oct 1, 2026
@MisterVVP
MisterVVP merged commit 76c677d into main Oct 1, 2026
19 checks passed
@MisterVVP
MisterVVP deleted the dev-refactor-integration-tests-to-remove-nolint-suppressions branch October 1, 2026 19:19
@MisterVVP MisterVVP mentioned this pull request Oct 8, 2026
4 of 5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI agent AI agent contribution maintenance refactoring Constant technical improvements which are not necessarily related to any issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Task]: Refactor tests with suppressed clang-tidy cognitive-complexity findings

1 participant