Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update to Smithy 1.37.0, disable selected protocol tests #1123

Merged
merged 6 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ abstract class AWSHttpBindingProtocolGenerator : HttpBindingProtocolGenerator()
val requestTestBuilder = HttpProtocolUnitTestRequestGenerator.Builder()
val responseTestBuilder = HttpProtocolUnitTestResponseGenerator.Builder()
val errorTestBuilder = HttpProtocolUnitTestErrorGenerator.Builder()
open val testsToIgnore: Set<String> = setOf()

override val shouldRenderDecodableBodyStructForInputShapes = true
override val shouldRenderCodingKeysForEncodable = true
Expand All @@ -68,6 +69,7 @@ abstract class AWSHttpBindingProtocolGenerator : HttpBindingProtocolGenerator()
getProtocolHttpBindingResolver(ctx, defaultContentType),
serdeContext,
imports,
testsToIgnore
).generateProtocolTests() + renderEndpointsTests(ctx)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ open class AwsJson1_0_ProtocolGenerator : AWSHttpBindingProtocolGenerator() {
override val serdeContext = serdeContextJSON
override val shouldRenderEncodableConformance: Boolean = true
override val shouldRenderDecodableBodyStructForInputShapes: Boolean = true
override val testsToIgnore = setOf(
"SDKAppliedContentEncoding_awsJson1_0",
"SDKAppendsGzipAndIgnoresHttpProvidedEncoding_awsJson1_0"
)
override fun getProtocolHttpBindingResolver(ctx: ProtocolGenerator.GenerationContext, defaultContentType: String):
HttpBindingResolver = AwsJsonHttpBindingResolver(ctx, defaultContentType)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ class AwsJson1_1_ProtocolGenerator : AWSHttpBindingProtocolGenerator() {
override val serdeContext = serdeContextJSON
override val shouldRenderEncodableConformance: Boolean = true
override val shouldRenderDecodableBodyStructForInputShapes: Boolean = true
override val testsToIgnore = setOf(
"SDKAppliedContentEncoding_awsJson1_1",
"SDKAppendsGzipAndIgnoresHttpProvidedEncoding_awsJson1_1"
)
override fun getProtocolHttpBindingResolver(ctx: ProtocolGenerator.GenerationContext, defaultContentType: String):
HttpBindingResolver = AwsJsonHttpBindingResolver(ctx, defaultContentType)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ open class AwsQueryProtocolGenerator : AWSHttpBindingProtocolGenerator() {
override val shouldRenderDecodableBodyStructForInputShapes = false
override val shouldRenderCodingKeysForEncodable = false
override val shouldRenderEncodableConformance = true
override val testsToIgnore = setOf(
"SDKAppliedContentEncoding_awsQuery",
"SDKAppendsGzipAndIgnoresHttpProvidedEncoding_awsQuery"
)
override fun renderStructEncode(
ctx: ProtocolGenerator.GenerationContext,
shapeContainingMembers: Shape,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ class Ec2QueryProtocolGenerator : AWSHttpBindingProtocolGenerator() {
override val shouldRenderDecodableBodyStructForInputShapes = false
override val shouldRenderCodingKeysForEncodable = false
override val shouldRenderEncodableConformance = true
override val testsToIgnore = setOf(
"SDKAppliedContentEncoding_ec2Query",
"SDKAppendsGzipAndIgnoresHttpProvidedEncoding_ec2Query"
)
override fun renderStructEncode(
ctx: ProtocolGenerator.GenerationContext,
shapeContainingMembers: Shape,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ class AWSRestJson1ProtocolGenerator : AWSHttpBindingProtocolGenerator() {
AWSRestJson1HttpResponseBindingErrorGeneratable()
)
override val serdeContext = serdeContextJSON
override val testsToIgnore = setOf(
"SDKAppliedContentEncoding_restJson1",
"SDKAppendedGzipAfterProvidedEncoding_restJson1"
)

override fun generateMessageMarshallable(ctx: ProtocolGenerator.GenerationContext) {
var streamingShapes = outputStreamingShapes(ctx)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import software.amazon.smithy.model.shapes.Shape
import software.amazon.smithy.model.shapes.ShapeId
import software.amazon.smithy.model.traits.TimestampFormatTrait
import software.amazon.smithy.swift.codegen.SwiftWriter
import software.amazon.smithy.swift.codegen.integration.HttpProtocolTestGenerator
import software.amazon.smithy.swift.codegen.integration.ProtocolGenerator
import software.amazon.smithy.swift.codegen.integration.codingKeys.CodingKeysCustomizationXmlName
import software.amazon.smithy.swift.codegen.integration.codingKeys.CodingKeysGenerator
Expand All @@ -35,6 +34,19 @@ class RestXmlProtocolGenerator : AWSHttpBindingProtocolGenerator() {
AWSXMLHttpResponseBindingErrorInitGeneratorFactory()
)
override val serdeContext = serdeContextXML
override val testsToIgnore = setOf(
"S3DefaultAddressing",
"S3VirtualHostAddressing",
"S3PathAddressing",
"S3VirtualHostDualstackAddressing",
"S3VirtualHostAccelerateAddressing",
"S3VirtualHostDualstackAccelerateAddressing",
"S3OperationAddressingPreferred",
"S3EscapeObjectKeyInUriLabel",
"S3EscapePathObjectKeyInUriLabel",
"SDKAppliedContentEncoding_restXml",
"SDKAppendedGzipAfterProvidedEncoding_restXml"
)

override fun renderStructEncode(
ctx: ProtocolGenerator.GenerationContext,
Expand Down Expand Up @@ -64,28 +76,4 @@ class RestXmlProtocolGenerator : AWSHttpBindingProtocolGenerator() {
val decoder = RestXmlStructDecodeXMLGenerator(ctx, members, shapeMetadata, writer, defaultTimestampFormat)
decoder.render()
}

override fun generateProtocolUnitTests(ctx: ProtocolGenerator.GenerationContext): Int {
val testsToIgnore = setOf(
"S3DefaultAddressing",
"S3VirtualHostAddressing",
"S3PathAddressing",
"S3VirtualHostDualstackAddressing",
"S3VirtualHostAccelerateAddressing",
"S3VirtualHostDualstackAccelerateAddressing",
"S3OperationAddressingPreferred"
)
return HttpProtocolTestGenerator(
ctx,
requestTestBuilder,
responseTestBuilder,
errorTestBuilder,
httpProtocolCustomizable,
operationMiddleware,
getProtocolHttpBindingResolver(ctx, defaultContentType),
serdeContext,
listOf(),
testsToIgnore
).generateProtocolTests() + renderEndpointsTests(ctx)
}
}
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
kotlin.code.style=official

org.gradle.jvmargs=-Xmx4096M

# codegen
smithyVersion=1.30.0
smithyVersion=1.37.0
smithyGradleVersion=0.6.0

smithySwiftVersion = 0.1.0
Expand Down
2 changes: 1 addition & 1 deletion sdk.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
excludeModels=kinesis-video-archived-media.2017-09-30
# No excluded models
Loading