Skip to content

Conversation

@devcrocod
Copy link
Contributor

Add tests with new schema types

Motivation and Context

How Has This Been Tested?

The repository currently contains duplicated tests:

  • tests using the new schema
  • tests using the old schema for compatibility checks. they will be removed once the deprecation level is raised

Breaking Changes

No

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Testing

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

@devcrocod devcrocod requested a review from kpavlov November 11, 2025 13:51
@kpavlov kpavlov force-pushed the devcrocod/polish-mcp-schema branch from b05232b to 8e689e7 Compare November 11, 2025 13:56
Copy link
Contributor

@kpavlov kpavlov left a comment

Choose a reason for hiding this comment

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

Let's keep those tests till 0.9, when old models will be removed entirely:

  1. OldSchemaPromptIntegrationTestSse.kt
  2. OldSchemaResourceIntegrationTestSse.kt
  3. OldSchemaToolIntegrationTestSse.kt
  4. OldSchemaPromptIntegrationTestStdio.kt
  5. OldSchemaResourceIntegrationTestStdio.kt
  6. OldSchemaToolIntegrationTestStdio.kt

@devcrocod devcrocod marked this pull request as ready for review November 11, 2025 16:03
Copilot AI review requested due to automatic review settings November 11, 2025 16:03
Copilot finished reviewing on behalf of devcrocod November 11, 2025 16:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request adds comprehensive test coverage with new schema types while maintaining backwards compatibility through old schema tests. The changes focus on duplicating existing tests to support both the new and old schema implementations during a transition period.

Key Changes:

  • Addition of new schema tests for server features (tools, resources, prompts, instructions)
  • Renaming of existing tests to "OldSchema" variants for backwards compatibility
  • Update of import statements from io.modelcontextprotocol.kotlin.sdk.* to io.modelcontextprotocol.kotlin.sdk.types.*
  • Creation of abstract base test classes for better code organization

Reviewed Changes

Copilot reviewed 64 out of 64 changed files in this pull request and generated no comments.

Show a summary per file
File Description
ServerToolsTest.kt New tests for tool management with new schema types
ServerResourcesTest.kt New tests for resource management with new schema types
ServerPromptsTest.kt New tests for prompt management with new schema types
ServerInstructionsTest.kt Updated imports to use new schema types
OldSchemaServerInstructionsTest.kt Backwards compatibility tests using old schema
AbstractServerFeaturesTest.kt Base class for server feature tests
KotlinClientTsServerTestStdio.kt New integration tests with TypeScript server via stdio
KotlinClientTsServerEdgeCasesTestStdio.kt Edge case tests for stdio transport
OldSchemaKotlinClientTsServerTestStdio.kt Old schema tests for stdio transport
OldSchemaKotlinClientTsServerEdgeCasesTestStdio.kt Old schema edge case tests
KotlinServerForTsClientSse.kt New SSE server implementation for TypeScript client tests
OldSchemaKotlinServerForTsClientSse.kt Old schema SSE server implementation
KotlinClientTsServerTestSse.kt New SSE transport tests
OldSchemaKotlinClientTsServerTestSse.kt Old schema SSE transport tests
TsTestBase.kt Updated base class with new schema imports
OldSchemaTsTestBase.kt Base class for old schema TypeScript tests
AbstractKotlinClientTsServerTest.kt Abstract test class for Kotlin-TypeScript integration
OldSchemaAbstractKotlinClientTsServerTest.kt Old schema abstract test class
SseIntegrationTest.kt New SSE integration tests
AbstractSseIntegrationTest.kt Base class for SSE integration tests
WebSocketIntegrationTest.kt WebSocket integration tests
ToolIntegrationTestStdio.kt Tool integration tests via stdio
ResourceIntegrationTestStdio.kt Resource integration tests via stdio
PromptIntegrationTestStdio.kt Prompt integration tests via stdio
KotlinTestBase.kt Base class for Kotlin integration tests
AbstractToolIntegrationTest.kt Abstract base for tool integration tests
AbstractResourceIntegrationTest.kt Abstract base for resource integration tests
AbstractPromptIntegrationTest.kt Abstract base for prompt integration tests
InMemoryTransport.kt Updated imports to new schema types
OldSchemaInMemoryTransport.kt Old schema in-memory transport implementation
BaseTransportTest.kt Updated imports to new schema types
OldSchemaBaseTransportTest.kt Old schema transport tests
InMemoryTransportTest.kt Updated imports to new schema types
OldSchemaInMemoryTransportTest.kt Old schema in-memory transport tests
SseTransportTest.kt Updated imports to new schema types
OldSchemaSseTransportTest.kt Old schema SSE transport tests
ClientTest.kt Comprehensive client tests with new schema
StdioServerTransportTest.kt Updated imports to new schema types
OldSchemaStdioServerTransportTest.kt Old schema stdio server transport tests
ReadBufferTest.kt Updated imports to new schema types
OldSchemaReadBufferTest.kt Old schema read buffer tests
ProgressNotificationsTest.kt Tests for progress notifications
OldSchemaAudioContentSerializationTest.kt Renamed old schema audio content tests
StreamableHttpClientTest.kt New streamable HTTP client tests
MockMcp.kt New mock MCP server implementation
OldSchemaMockMcp.kt Old schema mock MCP server
AbstractStreamableHttpClientTest.kt Updated to use old schema mock
StreamableHttpClientTransportTest.kt Updated imports to new schema types
OldSchemaStreamableHttpClientTransportTest.kt Old schema streamable HTTP transport tests
MockTransport.kt Updated imports to new schema types
OldSchemaMockTransport.kt Old schema mock transport
ClientMetaParameterTest.kt Updated imports to new schema types
OldSchemaClientMetaParameterTest.kt Old schema client meta parameter tests

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@devcrocod
Copy link
Contributor Author

@kpavlov

  • OldSchemaPromptIntegrationTestSse.kt
  • OldSchemaResourceIntegrationTestSse.kt
  • OldSchemaToolIntegrationTestSse.kt
  • OldSchemaPromptIntegrationTestStdio.kt
  • OldSchemaResourceIntegrationTestStdio.kt
  • OldSchemaToolIntegrationTestStdio.kt

These tests were renamed after refactoring in last pr.
there’s nothing specifically related to the schema in them.
I reverted them back, but they got indexed as new ones(
These tests look like:

package io.modelcontextprotocol.kotlin.sdk.integration.kotlin.sse

import io.modelcontextprotocol.kotlin.sdk.integration.kotlin.AbstractToolIntegrationTest

class ToolIntegrationTestSse : AbstractToolIntegrationTest() {
    override val transportKind: TransportKind = TransportKind.SSE
}

@kpavlov
Copy link
Contributor

kpavlov commented Nov 11, 2025

Let it go after #376, since 376 catches a regression

@kpavlov kpavlov added the question Further information is requested label Nov 11, 2025
@devcrocod devcrocod force-pushed the devcrocod/polish-mcp-schema branch from 8e689e7 to a8ac111 Compare November 13, 2025 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

question Further information is requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants