Skip to content

Commit

Permalink
misc: cleanup miscellaneous TODOs and FIXMEs (#1021)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianbotsf authored Aug 18, 2023
1 parent 2e62bb7 commit 7e01857
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 30 deletions.
3 changes: 3 additions & 0 deletions aws-runtime/aws-config/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ kotlin {

// atomics
implementation("org.jetbrains.kotlinx:atomicfu:$atomicFuVersion")

// coroutines
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
}
}
commonTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"name": "web identity profile no env",
"docs": "web identity is configured in environment but profile should take precedence. Profile has incomplete configuration though and should result in an error. Web identity should not be tried",
"result": {
"ErrorContains": "provider was not enabled"
"ErrorContains": "No identity could be resolved from the chain"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,8 @@ class DefaultChainCredentialsProviderTest {
@Test
fun testProfileName() = executeTest("profile_name")

// FIXME - need to discuss desired behavior. This tests precedence and assumes that if a provider
// is configured that any errors should surface and no further providers tried. Not all SDKs do this
// though (e.g. Java keeps trying until all providers are exhausted).
// @Test
// fun testProfileOverridesWebIdentity() = executeTest("profile_overrides_web_identity")
@Test
fun testProfileOverridesWebIdentity() = executeTest("profile_overrides_web_identity")

@Test
fun testProfileStaticKeys() = executeTest("profile_static_keys")
Expand Down
8 changes: 0 additions & 8 deletions aws-runtime/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ plugins {

val sdkVersion: String by project

val coroutinesVersion: String by project
val kotestVersion: String by project
val slf4jVersion: String by project

Expand All @@ -37,12 +36,6 @@ subprojects {

sourceSets {
// dependencies available for all subprojects
named("commonMain") {
dependencies {
// FIXME - refactor to only projects that need this
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
}
}

named("commonTest") {
dependencies {
Expand All @@ -52,7 +45,6 @@ subprojects {

named("jvmTest") {
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-debug:$coroutinesVersion")
implementation("io.kotest:kotest-assertions-core-jvm:$kotestVersion")
implementation("org.slf4j:slf4j-simple:$slf4jVersion")
}
Expand Down
24 changes: 8 additions & 16 deletions services/s3/e2eTest/src/S3TestUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,9 @@
*/
package aws.sdk.kotlin.e2etest

import aws.sdk.kotlin.services.s3.S3Client
import aws.sdk.kotlin.services.s3.createBucket
import aws.sdk.kotlin.services.s3.deleteBucket
import aws.sdk.kotlin.services.s3.deleteObject
import aws.sdk.kotlin.services.s3.model.BucketLocationConstraint
import aws.sdk.kotlin.services.s3.model.ExpirationStatus
import aws.sdk.kotlin.services.s3.model.LifecycleRule
import aws.sdk.kotlin.services.s3.model.LifecycleRuleFilter
import aws.sdk.kotlin.services.s3.*
import aws.sdk.kotlin.services.s3.model.*
import aws.sdk.kotlin.services.s3.paginators.listObjectsV2Paginated
import aws.sdk.kotlin.services.s3.putBucketLifecycleConfiguration
import aws.sdk.kotlin.services.s3.waiters.waitUntilBucketExists
import aws.smithy.kotlin.runtime.http.request.HttpRequest
import kotlinx.coroutines.*
Expand Down Expand Up @@ -80,16 +73,15 @@ object S3TestUtils {
val dispatcher = Dispatchers.Default.limitedParallelism(64)
val jobs = mutableListOf<Job>()

// FIXME - this should use the batch `DeleteObjects` request and delete by page rather than individual key
// However the current XML serializer chokes on the BLNS keys used by the presign tests. Update after
// new XML implementation is available
client.listObjectsV2Paginated { bucket = bucketName }
.flatMapConcat { it.contents?.asFlow() ?: flowOf() }
.collect { obj ->
.mapNotNull { it.contents }
.collect { contents ->
val job = scope.launch(dispatcher) {
client.deleteObject {
client.deleteObjects {
bucket = bucketName
key = obj.key
delete {
objects = contents.mapNotNull(Object::key).map { ObjectIdentifier { key = it } }
}
}
}
jobs.add(job)
Expand Down

0 comments on commit 7e01857

Please sign in to comment.