Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:

- os: windows-latest
job-name: "Windows Tests"
gradle-tasks: "jvmTest"
gradle-tasks: "jvmTest -x :integration-test:jvmTest"
max-workers: 3

- os: macos-latest
Expand All @@ -64,6 +64,11 @@ jobs:
with:
node-version: 'lts/*'

- name: Set up Node Packages
if: matrix.os == 'ubuntu-latest'
working-directory: integration-test/src/jvmTest/typescript
run: npm ci

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
with:
Expand All @@ -75,7 +80,7 @@ jobs:
caches
notifications
sdks
.konan/**
../.konan/**

- name: ${{ matrix.job-name }}
run: |-
Expand Down Expand Up @@ -144,6 +149,11 @@ jobs:
with:
add-job-summary: 'always'
cache-read-only: true
gradle-home-cache-includes: |
caches
notifications
sdks
../.konan/**

- name: Download Maven Local Repository
uses: actions/download-artifact@v7
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,24 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24.11.1'
node-version: 'lts/*'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
with:
add-job-summary: 'always'
cache-read-only: true
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
gradle-home-cache-includes: |
caches
notifications
sdks
../.konan/**

- name: Run Conformance Tests
run: ./gradlew --no-daemon :conformance-test:test

- name: Upload Conformance Results
if: ${{ !cancelled() }}
if: always()
uses: actions/upload-artifact@v6
with:
name: conformance-results
Expand Down
2 changes: 1 addition & 1 deletion conformance-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ plugins {

dependencies {
testImplementation(project(":kotlin-sdk"))
testImplementation(kotlin("test"))
testImplementation(project(":test-utils"))
testImplementation(kotlin("test"))
testImplementation(libs.kotlin.logging)
testImplementation(libs.ktor.client.cio)
testImplementation(libs.ktor.server.cio)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.modelcontextprotocol.kotlin.sdk.conformance

import io.github.oshai.kotlinlogging.KotlinLogging
import io.modelcontextprotocol.kotlin.test.utils.findFreePort
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.DynamicTest
Expand All @@ -10,7 +11,6 @@ import java.io.BufferedReader
import java.io.InputStreamReader
import java.lang.management.ManagementFactory
import java.net.HttpURLConnection
import java.net.ServerSocket
import java.net.URI
import java.util.concurrent.TimeUnit
import kotlin.properties.Delegates
Expand Down Expand Up @@ -70,8 +70,6 @@ class ConformanceTest {
private const val GRACEFUL_SHUTDOWN_SECONDS = 5L
private const val FORCE_SHUTDOWN_SECONDS = 2L

private fun findFreePort(): Int = ServerSocket(0).use { it.localPort }

private fun getRuntimeClasspath(): String = ManagementFactory.getRuntimeMXBean().classPath

private fun getTestClasspath(): String = System.getProperty("test.classpath") ?: getRuntimeClasspath()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ abstract class AbstractKotlinClientTsServerTest : TsTestBase() {
protected abstract suspend fun <T> useClient(block: suspend (Client) -> T): T

@Test
@Timeout(30, unit = TimeUnit.SECONDS)
@Timeout(20, unit = TimeUnit.SECONDS)
fun connectsAndPings() = runBlocking(Dispatchers.IO) {
useClient { client ->
assertNotNull(client, "Client should be initialized")
Expand All @@ -30,7 +30,7 @@ abstract class AbstractKotlinClientTsServerTest : TsTestBase() {
}

@Test
@Timeout(30, unit = TimeUnit.SECONDS)
@Timeout(20, unit = TimeUnit.SECONDS)
fun listsTools() = runBlocking(Dispatchers.IO) {
useClient { client ->
val result = client.listTools()
Expand All @@ -44,7 +44,7 @@ abstract class AbstractKotlinClientTsServerTest : TsTestBase() {
}

@Test
@Timeout(30, unit = TimeUnit.SECONDS)
@Timeout(20, unit = TimeUnit.SECONDS)
fun callGreet() = runBlocking(Dispatchers.IO) {
useClient { client ->
val testName = "TestUser"
Expand All @@ -59,7 +59,7 @@ abstract class AbstractKotlinClientTsServerTest : TsTestBase() {
}

@Test
@Timeout(30, unit = TimeUnit.SECONDS)
@Timeout(20, unit = TimeUnit.SECONDS)
fun multipleClients() = runBlocking(Dispatchers.IO) {
useClient { client1 ->
useClient { client2 ->
Expand Down
Loading
Loading