Skip to content

Commit acb4198

Browse files
authored
chore: generate test targets if needed (#297)
1 parent 57e4409 commit acb4198

File tree

5 files changed

+6
-11
lines changed

5 files changed

+6
-11
lines changed

codegen/protocol-test-codegen-local/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ fun generateSmithyBuild(tests: List<CodegenTest>): String {
4646
"author": "Amazon Web Services",
4747
"homepage": "https://docs.amplify.aws/",
4848
"swiftVersion": "5.4.0",
49-
"shouldGenerateUnitTestTarget": true,
5049
"build": {
5150
"rootProject": true
5251
}

codegen/protocol-test-codegen/build.gradle.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@ fun generateSmithyBuild(tests: List<ProtocolTest>): String {
111111
"gitRepo": "https://github.com/aws-amplify/smithy-swift.git",
112112
"author": "Amazon Web Services",
113113
"homepage": "https://docs.amplify.aws/",
114-
"swiftVersion": "5.4.0",
115-
"shouldGenerateUnitTestTarget": true
114+
"swiftVersion": "5.4.0"
116115
}
117116
}
118117
}"""

codegen/sdk-codegen/build.gradle.kts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ data class AwsService(
7070
val modelFile: File,
7171
val projectionName: String,
7272
val gitRepo: String,
73-
val shouldGenerateUnitTestTarget: Boolean,
7473
val sdkId: String
7574
)
7675

@@ -103,7 +102,6 @@ fun generateSmithyBuild(services: List<AwsService>): String {
103102
"author": "Amazon Web Services",
104103
"gitRepo": "${service.gitRepo}",
105104
"swiftVersion": "5.3.0",
106-
"shouldGenerateUnitTestTarget": false,
107105
"build": {
108106
"rootProject": $buildStandaloneSdk
109107
}
@@ -162,8 +160,7 @@ fun discoverServices(): List<AwsService> {
162160
modelFile = file,
163161
projectionName = name + "." + version.toLowerCase(),
164162
sdkId = serviceApi.sdkId,
165-
gitRepo = "https://github.com/aws-amplify/aws-sdk-swift.git",
166-
shouldGenerateUnitTestTarget = false)
163+
gitRepo = "https://github.com/aws-amplify/aws-sdk-swift.git")
167164
}
168165
}
169166
val discoveredServices: List<AwsService> by lazy { discoverServices() }

codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/AWSHttpBindingProtocolGenerator.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ abstract class AWSHttpBindingProtocolGenerator : HttpBindingProtocolGenerator()
4545
override val shouldRenderDecodableBodyStructForInputShapes = true
4646
override val shouldRenderCodingKeysForEncodable = true
4747

48-
override fun generateProtocolUnitTests(ctx: ProtocolGenerator.GenerationContext) {
49-
HttpProtocolTestGenerator(
48+
override fun generateProtocolUnitTests(ctx: ProtocolGenerator.GenerationContext): Int {
49+
return HttpProtocolTestGenerator(
5050
ctx,
5151
requestTestBuilder,
5252
responseTestBuilder,

codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/restxml/RestXmlProtocolGenerator.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ class RestXmlProtocolGenerator : AWSHttpBindingProtocolGenerator() {
6262
decoder.render()
6363
}
6464

65-
override fun generateProtocolUnitTests(ctx: ProtocolGenerator.GenerationContext) {
65+
override fun generateProtocolUnitTests(ctx: ProtocolGenerator.GenerationContext): Int {
6666
val ignoredTests = setOf(
6767
// FIXME - escaped strings not fully supported in rest xml
6868
"SimpleScalarPropertiesComplexEscapes"
6969
)
70-
HttpProtocolTestGenerator(
70+
return HttpProtocolTestGenerator(
7171
ctx,
7272
requestTestBuilder,
7373
responseTestBuilder,

0 commit comments

Comments
 (0)