Skip to content

Commit

Permalink
Use WinHttp engine instead of Curl in tests to avoid libcurl setup
Browse files Browse the repository at this point in the history
  • Loading branch information
joffrey-bion committed Aug 9, 2023
1 parent 7318109 commit 6a8dab6
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 102 deletions.
2 changes: 1 addition & 1 deletion autobahn-test-suite/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ kotlin {
val mingwX64Main by getting {
dependsOn(nativeMain)
dependencies {
implementation(libs.ktor.client.curl)
implementation(libs.ktor.client.winhttp)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.hildan.krossbow.websocket.test.autobahn

import io.ktor.client.engine.*
import io.ktor.client.engine.curl.*
import io.ktor.client.engine.winhttp.*

actual fun ktorEngine(): HttpClientEngineFactory<*> = Curl
actual fun ktorEngine(): HttpClientEngineFactory<*> = WinHttp
4 changes: 1 addition & 3 deletions autobahn-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ kotlin {
attributes.attribute(websocketEngineAttribute, "builtin-darwin")
}

setupMingwLibcurlFor(targetName = "mingwX64Ktor", project)

sourceSets {
val commonTest by getting {
dependencies {
Expand Down Expand Up @@ -115,7 +113,7 @@ kotlin {
val mingwX64KtorTest by getting {
dependencies {
implementation(projects.krossbowWebsocketKtor)
implementation(libs.ktor.client.curl)
implementation(libs.ktor.client.winhttp)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package org.hildan.krossbow.websocket.test.autobahn

import io.ktor.client.*
import io.ktor.client.engine.curl.*
import io.ktor.client.engine.winhttp.*
import io.ktor.client.plugins.websocket.*
import org.hildan.krossbow.websocket.WebSocketClient
import org.hildan.krossbow.websocket.ktor.KtorWebSocketClient

class KtorCurlWebSocketAutobahnTest : AutobahnClientTestSuite(
agentUnderTest = "krossbow-ktor-curl-client-${Platform.osFamily.name.lowercase()}",
class KtorWinHttpWebSocketAutobahnTest : AutobahnClientTestSuite(
agentUnderTest = "krossbow-ktor-winhttp-client-${Platform.osFamily.name.lowercase()}",
) {
override fun provideClient(): WebSocketClient = KtorWebSocketClient(HttpClient(Curl) { install(WebSockets) })
override fun provideClient(): WebSocketClient = KtorWebSocketClient(HttpClient(WinHttp) { install(WebSockets) })
}
89 changes: 0 additions & 89 deletions buildSrc/src/main/kotlin/LibcurlSetup.kt

This file was deleted.

Binary file removed cygwin-lib/libcurl.dll.a
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serializa
ktor-client-contentNegotiation = { module = "io.ktor:ktor-client-content-negotiation", version.ref = "ktor" }
ktor-client-cio = { module = "io.ktor:ktor-client-cio", version.ref = "ktor" }
ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" }
ktor-client-curl = { module = "io.ktor:ktor-client-curl", version.ref = "ktor" }
ktor-client-darwin = { module = "io.ktor:ktor-client-darwin", version.ref = "ktor" }
ktor-client-java = { module = "io.ktor:ktor-client-java", version.ref = "ktor" }
ktor-client-js = { module = "io.ktor:ktor-client-js", version.ref = "ktor" }
ktor-client-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktor" }
ktor-client-websockets = { module = "io.ktor:ktor-client-websockets", version.ref = "ktor" }
ktor-client-winhttp = { module = "io.ktor:ktor-client-winhttp", version.ref = "ktor" }
ktor-serialization-kotlinx-json = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktor" }
moshi = { module = "com.squareup.moshi:moshi", version.ref = "moshi" }
moshiKotlin = { module = "com.squareup.moshi:moshi-kotlin", version.ref = "moshi" }
Expand Down
3 changes: 1 addition & 2 deletions krossbow-websocket-ktor/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ description = "Multiplatform implementation of Krossbow's WebSocket API using Kt

kotlin {
jsWithBigTimeouts()
setupMingwLibcurlFor(targetName = "mingwX64", project)

sourceSets {
val commonMain by getting {
Expand Down Expand Up @@ -39,7 +38,7 @@ kotlin {
}
val mingwX64Test by getting {
dependencies {
implementation(libs.ktor.client.curl)
implementation(libs.ktor.client.winhttp)
}
}
val darwinTest by getting {
Expand Down

0 comments on commit 6a8dab6

Please sign in to comment.