File tree Expand file tree Collapse file tree 2 files changed +15
-12
lines changed
codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/smoketests Expand file tree Collapse file tree 2 files changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ import software.amazon.smithy.kotlin.codegen.core.CodegenContext
55import software.amazon.smithy.kotlin.codegen.core.DEFAULT_TEST_SOURCE_SET_ROOT
66import software.amazon.smithy.kotlin.codegen.core.KotlinDelegator
77import software.amazon.smithy.kotlin.codegen.integration.KotlinIntegration
8+ import software.amazon.smithy.kotlin.codegen.model.hasTrait
9+ import software.amazon.smithy.kotlin.codegen.utils.topDownOperations
810import software.amazon.smithy.model.Model
911import software.amazon.smithy.smoketests.traits.SmokeTestsTrait
1012
@@ -13,9 +15,7 @@ import software.amazon.smithy.smoketests.traits.SmokeTestsTrait
1315 */
1416class SmokeTestsIntegration : KotlinIntegration {
1517 override fun enabledForService (model : Model , settings : KotlinSettings ): Boolean =
16- false
17- // FIXME: Enable smoke tests again
18- // model.topDownOperations(settings.service).any { it.hasTrait<SmokeTestsTrait>() }
18+ model.topDownOperations(settings.service).any { it.hasTrait<SmokeTestsTrait >() }
1919
2020 override fun writeAdditionalFiles (ctx : CodegenContext , delegator : KotlinDelegator ) =
2121 delegator.useFileWriter(
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ object SmokeTestSectionIds {
3030 object HttpEngineOverride : SectionId
3131 object ServiceFilter : SectionId
3232 object SkipTags : SectionId
33+ object SmokeTestsFile : SectionId
3334 object ClientConfig : SectionId {
3435 val Name : SectionKey <String > = SectionKey (" aws.smithy.kotlin#SmokeTestClientConfigName" )
3536 val Value : SectionKey <String > = SectionKey (" aws.smithy.kotlin#SmokeTestClientConfigValue" )
@@ -59,16 +60,18 @@ class SmokeTestsRunnerGenerator(
5960 ctx : CodegenContext ,
6061) {
6162 internal fun render () {
62- writer.write(" private var exitCode = 0" )
63- renderEnvironmentVariables()
64- writer.declareSection(SmokeTestSectionIds .AdditionalEnvironmentVariables )
65- writer.write(" " )
66- writer.withBlock(" public suspend fun main() {" , " }" ) {
67- renderFunctionCalls()
68- write(" #T(exitCode)" , RuntimeTypes .Core .SmokeTests .exitProcess)
63+ writer.declareSection(SmokeTestSectionIds .SmokeTestsFile ) {
64+ writer.write(" private var exitCode = 0" )
65+ renderEnvironmentVariables()
66+ writer.declareSection(SmokeTestSectionIds .AdditionalEnvironmentVariables )
67+ writer.write(" " )
68+ writer.withBlock(" public suspend fun main() {" , " }" ) {
69+ renderFunctionCalls()
70+ write(" #T(exitCode)" , RuntimeTypes .Core .SmokeTests .exitProcess)
71+ }
72+ writer.write(" " )
73+ renderFunctions()
6974 }
70- writer.write(" " )
71- renderFunctions()
7275 }
7376
7477 private fun renderEnvironmentVariables () {
You can’t perform that action at this time.
0 commit comments