Skip to content

Commit d0e5e1e

Browse files
committed
chore: re-enable ignored Kotlin/Native tests
1 parent e425de3 commit d0e5e1e

File tree

4 files changed

+38
-31
lines changed

4 files changed

+38
-31
lines changed

runtime/auth/aws-signing-default/common/test/aws/smithy/kotlin/runtime/auth/awssigning/SigV4aSignatureCalculatorTest.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*/
55
package aws.smithy.kotlin.runtime.auth.awssigning
66

7-
import aws.smithy.kotlin.runtime.IgnoreNative
87
import aws.smithy.kotlin.runtime.auth.awscredentials.Credentials
98
import aws.smithy.kotlin.runtime.time.Instant
109
import aws.smithy.kotlin.runtime.util.PlatformProvider
@@ -69,7 +68,6 @@ private val TESTS = listOf(
6968
* Tests for [SigV4aSignatureCalculator]. Currently only tests forming the string-to-sign.
7069
*/
7170
class SigV4aSignatureCalculatorTest {
72-
@IgnoreNative // FIXME test resources are not loadable on iOS: https://youtrack.jetbrains.com/issue/KT-49981/
7371
@Test
7472
fun testStringToSign() = TESTS.forEach { testId ->
7573
runTest {

runtime/auth/http-auth-aws/common/test/aws/smithy/kotlin/runtime/http/auth/AwsHttpSignerTestBase.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*/
55
package aws.smithy.kotlin.runtime.http.auth
66

7-
import aws.smithy.kotlin.runtime.IgnoreNative
87
import aws.smithy.kotlin.runtime.auth.awscredentials.Credentials
98
import aws.smithy.kotlin.runtime.auth.awscredentials.CredentialsProvider
109
import aws.smithy.kotlin.runtime.auth.awssigning.AwsSigner
@@ -127,7 +126,6 @@ public abstract class AwsHttpSignerTestBase(
127126
assertEquals(expectedSig, signed.headers["Authorization"])
128127
}
129128

130-
@IgnoreNative // FIXME Our JVM implementation does not sign `transfer-encoding`, but CRT does, causing a signature mismatch. Upgrade to latest version of aws-c-auth to get the fix.
131129
@Test
132130
public fun testSignAwsChunkedStreamNonReplayable(): TestResult = runTest {
133131
val op = buildOperation(streaming = true, replayable = false, requestBody = "a".repeat(AWS_CHUNKED_THRESHOLD + 1))
@@ -141,7 +139,6 @@ public abstract class AwsHttpSignerTestBase(
141139
assertEquals(expectedSig, signed.headers["Authorization"])
142140
}
143141

144-
@IgnoreNative // FIXME Our JVM implementation does not sign `transfer-encoding`, but CRT does, causing a signature mismatch. Upgrade to latest version of aws-c-auth to get the fix.
145142
@Test
146143
public fun testSignAwsChunkedStreamReplayable(): TestResult = runTest {
147144
val op = buildOperation(streaming = true, replayable = true, requestBody = "a".repeat(AWS_CHUNKED_THRESHOLD + 1))
@@ -155,7 +152,6 @@ public abstract class AwsHttpSignerTestBase(
155152
assertEquals(expectedSig, signed.headers["Authorization"])
156153
}
157154

158-
@IgnoreNative // FIXME Our JVM implementation does not sign `transfer-encoding`, but CRT does, causing a signature mismatch. Upgrade to latest version of aws-c-auth to get the fix.
159155
@Test
160156
public fun testSignOneShotStream(): TestResult = runTest {
161157
val op = buildOperation(streaming = true, replayable = false)

runtime/build.gradle.kts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55
import aws.sdk.kotlin.gradle.dsl.configurePublishing
6-
import aws.sdk.kotlin.gradle.kmp.*
7-
import org.gradle.kotlin.dsl.apply
8-
import org.gradle.kotlin.dsl.withType
6+
import aws.sdk.kotlin.gradle.kmp.configureKmpTargets
7+
import aws.sdk.kotlin.gradle.kmp.kotlin
8+
import aws.sdk.kotlin.gradle.kmp.needsKmpConfigured
99
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
1010
import org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeSimulatorTest
1111

@@ -118,6 +118,18 @@ subprojects {
118118
tasks.withType<KotlinNativeSimulatorTest> {
119119
enabled = false
120120
}
121+
122+
tasks.withType<AbstractTestTask> {
123+
if (this is Test) useJUnitPlatform()
124+
125+
testLogging {
126+
events("passed", "skipped", "failed")
127+
showStandardStreams = true
128+
showStackTraces = true
129+
showExceptions = true
130+
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
131+
}
132+
}
121133
}
122134

123135
// configureIosSimulatorTasks()

runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt/AsyncStressTest.kt

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55

66
package aws.smithy.kotlin.runtime.http.engine.crt
77

8-
import aws.smithy.kotlin.runtime.IgnoreNative
98
import aws.smithy.kotlin.runtime.http.HttpMethod
109
import aws.smithy.kotlin.runtime.http.SdkHttpClient
1110
import aws.smithy.kotlin.runtime.http.complete
1211
import aws.smithy.kotlin.runtime.http.request.HttpRequestBuilder
1312
import aws.smithy.kotlin.runtime.http.request.url
1413
import aws.smithy.kotlin.runtime.httptest.TestWithLocalServer
14+
import aws.smithy.kotlin.runtime.io.use
1515
import aws.smithy.kotlin.runtime.net.Host
1616
import aws.smithy.kotlin.runtime.net.Scheme
1717
import io.ktor.server.cio.*
@@ -37,37 +37,38 @@ class AsyncStressTest : TestWithLocalServer() {
3737
}
3838
}.start()
3939

40-
@IgnoreNative // FIXME TlsContext needs to initialize CRT. Segmentation fault.
4140
@Test
4241
fun testStreamNotConsumed() = runBlocking {
4342
// test that filling the stream window and not consuming the body stream still cleans up resources
4443
// appropriately and allows requests to proceed (a stream that isn't consumed will be in a stuck state
4544
// if the window is full and never incremented again, this can lead to all connections being consumed
4645
// and the engine to no longer make further requests)
47-
val client = SdkHttpClient(CrtHttpEngine())
48-
val request = HttpRequestBuilder().apply {
49-
url {
50-
scheme = Scheme.HTTP
51-
method = HttpMethod.GET
52-
host = Host.Domain(testHost)
53-
port = serverPort
54-
path.decoded = "/largeResponse"
46+
CrtHttpEngine().use { engine ->
47+
val client = SdkHttpClient(engine)
48+
val request = HttpRequestBuilder().apply {
49+
url {
50+
scheme = Scheme.HTTP
51+
method = HttpMethod.GET
52+
host = Host.Domain(testHost)
53+
port = serverPort
54+
path.decoded = "/largeResponse"
55+
}
5556
}
56-
}
5757

58-
withTimeout(10.seconds) {
59-
repeat(1_000) {
60-
async {
61-
try {
62-
val call = client.call(request)
63-
yield()
64-
call.complete()
65-
} catch (ex: Exception) {
66-
println("exception on $it: $ex")
67-
throw ex
58+
withTimeout(10.seconds) {
59+
repeat(1_000) {
60+
async {
61+
try {
62+
val call = client.call(request)
63+
yield()
64+
call.complete()
65+
} catch (ex: Exception) {
66+
println("exception on $it: $ex")
67+
throw ex
68+
}
6869
}
70+
yield()
6971
}
70-
yield()
7172
}
7273
}
7374
}

0 commit comments

Comments
 (0)