Skip to content

Commit

Permalink
codegen: Remove protocol test skipping for supported features.
Browse files Browse the repository at this point in the history
Updates the SDK's code generation of protocol test to no longer skip
tests for features that are supported by the SDK.
  • Loading branch information
jasdel committed Mar 17, 2022
1 parent f716a2e commit fd84503
Showing 1 changed file with 18 additions and 48 deletions.
Expand Up @@ -104,12 +104,8 @@ static void generateHttpProtocolTests(GenerationContext context) {
.build());

Set<HttpProtocolUnitTestGenerator.SkipTest> inputSkipTests = new TreeSet<>(SetUtils.of(
// Smithy 1.6 changed unit tests that the SDK codegen don't support or are opinionated.
HttpProtocolUnitTestGenerator.SkipTest.builder()
.service(ShapeId.from("aws.protocoltests.restjson#RestJson"))
.operation(ShapeId.from("aws.protocoltests.restjson#EmptyInputAndEmptyOutput"))
.addTestName("RestJsonEmptyInputAndEmptyOutputWithJson")
.build(),
// Endpoint prefix serialization doesn't work with test runner's handling of request URLs.
// e.g. http://foo.127.0.0.1:59850/ dial fail
HttpProtocolUnitTestGenerator.SkipTest.builder()
.service(ShapeId.from("aws.protocoltests.restjson#RestJson"))
.operation(ShapeId.from("aws.protocoltests.restjson#EndpointOperation"))
Expand All @@ -120,6 +116,9 @@ static void generateHttpProtocolTests(GenerationContext context) {
.operation(ShapeId.from("aws.protocoltests.restjson#EndpointWithHostLabelOperation"))
.addTestName("RestJsonEndpointTraitWithHostLabel")
.build(),

// Endpoint prefix serialization doesn't work with test runner's handling of request URLs.
// e.g. http://foo.127.0.0.1:59850/ dial fail
HttpProtocolUnitTestGenerator.SkipTest.builder()
.service(ShapeId.from("aws.protocoltests.ec2#AwsEc2"))
.operation(ShapeId.from("aws.protocoltests.ec2#EndpointOperation"))
Expand All @@ -130,11 +129,9 @@ static void generateHttpProtocolTests(GenerationContext context) {
.operation(ShapeId.from("aws.protocoltests.ec2#EndpointWithHostLabelOperation"))
.addTestName("Ec2QueryEndpointTraitWithHostLabel")
.build(),
HttpProtocolUnitTestGenerator.SkipTest.builder()
.service(ShapeId.from("aws.protocoltests.json#JsonProtocol"))
.operation(ShapeId.from("aws.protocoltests.json#EmptyOperation"))
.addTestName("json_1_1_service_supports_empty_payload_for_no_input_shape")
.build(),

// Endpoint prefix serialization doesn't work with test runner's handling of request URLs.
// e.g. http://foo.127.0.0.1:59850/ dial fail
HttpProtocolUnitTestGenerator.SkipTest.builder()
.service(ShapeId.from("aws.protocoltests.json#JsonProtocol"))
.operation(ShapeId.from("aws.protocoltests.json#EndpointOperation"))
Expand All @@ -145,11 +142,9 @@ static void generateHttpProtocolTests(GenerationContext context) {
.operation(ShapeId.from("aws.protocoltests.json#EndpointWithHostLabelOperation"))
.addTestName("AwsJson11EndpointTraitWithHostLabel")
.build(),
HttpProtocolUnitTestGenerator.SkipTest.builder()
.service(ShapeId.from("aws.protocoltests.json10#JsonRpc10"))
.operation(ShapeId.from("aws.protocoltests.json10#NoInputAndNoOutput"))
.addTestName("AwsJson10ServiceSupportsNoPayloadForNoInput")
.build(),

// Endpoint prefix serialization doesn't work with test runner's handling of request URLs.
// e.g. http://foo.127.0.0.1:59850/ dial fail
HttpProtocolUnitTestGenerator.SkipTest.builder()
.service(ShapeId.from("aws.protocoltests.json10#JsonRpc10"))
.operation(ShapeId.from("aws.protocoltests.json10#EndpointOperation"))
Expand All @@ -160,6 +155,9 @@ static void generateHttpProtocolTests(GenerationContext context) {
.operation(ShapeId.from("aws.protocoltests.json10#EndpointWithHostLabelOperation"))
.addTestName("AwsJson10EndpointTraitWithHostLabel")
.build(),

// Endpoint prefix serialization doesn't work with test runner's handling of request URLs.
// e.g. http://foo.127.0.0.1:59850/ dial fail
HttpProtocolUnitTestGenerator.SkipTest.builder()
.service(ShapeId.from("aws.protocoltests.query#AwsQuery"))
.operation(ShapeId.from("aws.protocoltests.query#EndpointOperation"))
Expand All @@ -170,6 +168,9 @@ static void generateHttpProtocolTests(GenerationContext context) {
.operation(ShapeId.from("aws.protocoltests.query#EndpointWithHostLabelOperation"))
.addTestName("AwsQueryEndpointTraitWithHostLabel")
.build(),

// Endpoint prefix serialization doesn't work with test runner's handling of request URLs.
// e.g. http://foo.127.0.0.1:59850/ dial fail
HttpProtocolUnitTestGenerator.SkipTest.builder()
.service(ShapeId.from("aws.protocoltests.restxml#RestXml"))
.operation(ShapeId.from("aws.protocoltests.restxml#EndpointOperation"))
Expand All @@ -184,39 +185,8 @@ static void generateHttpProtocolTests(GenerationContext context) {
.service(ShapeId.from("aws.protocoltests.restxml#RestXml"))
.operation(ShapeId.from("aws.protocoltests.restxml#EndpointWithHostLabelOperation"))
.addTestName("RestXmlEndpointTraitWithHostLabel")
.build(),

// Null lists/maps without sparse tag
HttpProtocolUnitTestGenerator.SkipTest.builder()
.service(ShapeId.from("aws.protocoltests.restjson#RestJson"))
.operation(ShapeId.from("aws.protocoltests.restjson#JsonLists"))
.addTestName("RestJsonListsSerializeNull")
.build(),
HttpProtocolUnitTestGenerator.SkipTest.builder()
.service(ShapeId.from("aws.protocoltests.restjson#RestJson"))
.operation(ShapeId.from("aws.protocoltests.restjson#JsonMaps"))
.addTestName("RestJsonSerializesNullMapValues")
.build(),
HttpProtocolUnitTestGenerator.SkipTest.builder()
.service(ShapeId.from("aws.protocoltests.json#JsonProtocol"))
.operation(ShapeId.from("aws.protocoltests.json#NullOperation"))
.addTestName("AwsJson11MapsSerializeNullValues")
.addTestName("AwsJson11ListsSerializeNull")
.build(),

// JSON RPC serialize empty modeled input should always serialize something
HttpProtocolUnitTestGenerator.SkipTest.builder()
.service(ShapeId.from("aws.protocoltests.json10#JsonRpc10"))
.operation(ShapeId.from("aws.protocoltests.json10#EmptyInputAndEmptyOutput"))
.addTestName("AwsJson10EmptyInputAndEmptyOutput")
.build(),

// HTTP Payload Values that are unset vs set by the customer and how content-type should be handled.
HttpProtocolUnitTestGenerator.SkipTest.builder()
.service(ShapeId.from("aws.protocoltests.restjson#RestJson"))
.operation(ShapeId.from("aws.protocoltests.restjson#TestPayloadBlob"))
.addTestName("RestJsonHttpWithEmptyBlobPayload")
.build()

));

Set<HttpProtocolUnitTestGenerator.SkipTest> outputSkipTests = new TreeSet<>(SetUtils.of(
Expand Down

0 comments on commit fd84503

Please sign in to comment.