Skip to content

Commit

Permalink
misc: enable smoke tests (#1477)
Browse files Browse the repository at this point in the history
  • Loading branch information
0marperez authored Dec 12, 2024
1 parent d886580 commit 6c085df
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package aws.sdk.kotlin.codegen.smoketests

import software.amazon.smithy.kotlin.codegen.KotlinSettings
import software.amazon.smithy.kotlin.codegen.integration.KotlinIntegration
import software.amazon.smithy.kotlin.codegen.integration.SectionWriterBinding
import software.amazon.smithy.kotlin.codegen.rendering.smoketests.SmokeTestSectionIds.SmokeTestsFile
import software.amazon.smithy.model.Model

/**
* SDK ID's of services that are deny listed from smoke test code generation.
*/
val smokeTestDenyList = setOf(
"S3Tables",
)

/**
* Will wipe the smoke test runner file for services that are deny listed.
* Some services model smoke tests incorrectly and the code generated file will not compile.
*/
class SmokeTestsDenyListIntegration : KotlinIntegration {
override fun enabledForService(model: Model, settings: KotlinSettings): Boolean =
settings.sdkId in smokeTestDenyList

override val sectionWriters: List<SectionWriterBinding>
get() = listOf(
SectionWriterBinding(
SmokeTestsFile,
) { writer, _ ->
writer.write("// Smoke tests for service are deny listed")
},
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ aws.sdk.kotlin.codegen.customization.s3.express.S3ExpressIntegration
aws.sdk.kotlin.codegen.customization.s3.S3ExpiresIntegration
aws.sdk.kotlin.codegen.BusinessMetricsIntegration
aws.sdk.kotlin.codegen.smoketests.AwsSmokeTestsRunnerGeneratorIntegration
aws.sdk.kotlin.codegen.smoketests.SmokeTestsDenyListIntegration
aws.sdk.kotlin.codegen.smoketests.testing.SmokeTestSuccessHttpEngineIntegration
aws.sdk.kotlin.codegen.smoketests.testing.SmokeTestFailHttpEngineIntegration
aws.sdk.kotlin.codegen.customization.AwsQueryModeCustomization
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ coroutines-version = "1.9.0"
atomicfu-version = "0.25.0"

# smithy-kotlin codegen and runtime are versioned separately
smithy-kotlin-runtime-version = "1.3.28"
smithy-kotlin-codegen-version = "0.33.28"
smithy-kotlin-runtime-version = "1.3.29"
smithy-kotlin-codegen-version = "0.33.29"

# codegen
smithy-version = "1.51.0"
Expand Down
6 changes: 0 additions & 6 deletions tests/codegen/smoke-tests/src/test/kotlin/SmokeTestE2ETest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import org.gradle.testkit.runner.GradleRunner
import java.io.File
import kotlin.test.*

// FIXME: Enable smoke test E2E tests
class SmokeTestE2ETest {
@Ignore
@Test
fun successService() {
val smokeTestRunnerOutput = runSmokeTests("successService")
Expand All @@ -15,15 +13,13 @@ class SmokeTestE2ETest {
assertContains(smokeTestRunnerOutput, "ok SuccessService SuccessTestWithTags - no error expected from service")
}

@Ignore
@Test
fun failureService() {
val smokeTestRunnerOutput = runSmokeTests("failureService")

assertContains(smokeTestRunnerOutput, "ok FailureService FailuresTest - error expected from service")
}

@Ignore
@Test
fun exceptionService() {
val smokeTestRunnerOutput = runSmokeTests("exceptionService", expectingFailure = true)
Expand All @@ -34,7 +30,6 @@ class SmokeTestE2ETest {
assertContains(smokeTestRunnerOutput, "#\tat aws.smithy.kotlin.runtime.http.interceptors.InterceptorExecutor.readBeforeDeserialization(InterceptorExecutor.kt:252)")
}

@Ignore
@Test
fun successServiceSkipTags() {
val envVars = mapOf(AWS_SKIP_TAGS to "success")
Expand All @@ -44,7 +39,6 @@ class SmokeTestE2ETest {
assertContains(smokeTestRunnerOutput, "ok SuccessService SuccessTestWithTags - no error expected from service # skip")
}

@Ignore
@Test
fun successServiceServiceFilter() {
val envVars = mapOf(AWS_SERVICE_FILTER to "Failure") // Only run tests for services with this SDK ID
Expand Down

0 comments on commit 6c085df

Please sign in to comment.