Skip to content

Commit

Permalink
Only run MRAP e2e tests if s3control and sts are also present
Browse files Browse the repository at this point in the history
  • Loading branch information
lauzadis committed Jun 20, 2024
1 parent d6c6258 commit e5912b1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
17 changes: 6 additions & 11 deletions services/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,14 @@ subprojects {

if (project.name == "s3") {
dependencies {
val enableMrapTestsProp = "aws.sdk.kotlin.e2etest.enableMrapTest"
val services = project.parent?.subprojects

if (services?.any { it.name == "s3control" } == true) {
implementation(project(":services:s3control"))
} else {
implementation("aws.sdk.kotlin:s3control:+")
}

if (services?.any { it.name == "sts" } == true) {
implementation(project(":services:sts"))
} else {
implementation("aws.sdk.kotlin:sts:+")
}
val s3Control = services?.singleOrNull { it.name == "s3control" }
val sts = services?.singleOrNull { it.name == "sts" }

val shouldRunMrapTests = s3Control != null && sts != null
systemProperty("aws.sdk.kotlin.e2etest.enableMrapTest", System.getProperties().getOrDefault(enableMrapTestsProp, shouldRunMrapTests))

implementation(libs.smithy.kotlin.aws.signing.crt)
}
Expand Down
2 changes: 2 additions & 0 deletions services/s3/e2eTest/src/MutliRegionAccessPointTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ import kotlinx.coroutines.runBlocking
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.TestInstance
import org.junit.jupiter.api.condition.EnabledIfSystemProperty
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFailsWith

@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@EnabledIfSystemProperty(named = "aws.sdk.kotlin.e2etest.enableMrapTest", matches = "true")
class MutliRegionAccessPointTest {
private val s3West = S3Client { region = "us-west-2" }
private val s3East = s3West.withConfig { region = "us-east-2" }
Expand Down

0 comments on commit e5912b1

Please sign in to comment.