Skip to content

Refactor StreamableHttp Server tests #316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 15, 2025
Merged

Conversation

ihrpr
Copy link
Contributor

@ihrpr ihrpr commented Apr 11, 2025

It's becoming very complex to add more tests to the StreamableHttp Server, hence refactoring.

  • less mocks
  • helper functions
  • simplify and remove some tests
  • realised server close didn't have standalone clean up while refactoring tests

Note to the reviewer: it's probably easier to look at a new tests and not try to compare, as most of the things changed

@ihrpr ihrpr changed the title Refactor StreamableHttp Server tests to use server and call do the direct calls Refactor StreamableHttp Server tests Apr 14, 2025
Copy link
Contributor

@jerome3o-anthropic jerome3o-anthropic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

});
expect(response.status).toBe(400);
const errorData = await response.json();
expectErrorResponse(errorData, -32600, /Only one initialization request is allowed/);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[non blocking q] even if it's a single message?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An initialization request is not allowed to be batched with anything else, so we should enforce that there's only one message if initializing.

@ihrpr ihrpr merged commit dd254f9 into main Apr 15, 2025
4 checks passed
@ihrpr ihrpr deleted the streamablehttp-server-tests branch April 15, 2025 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants