Skip to content

Commit

Permalink
regen final prototest
Browse files Browse the repository at this point in the history
  • Loading branch information
lucix-aws committed Mar 25, 2024
1 parent 7e54b97 commit 454d0c5
Show file tree
Hide file tree
Showing 15 changed files with 1,779 additions and 1,681 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ public static void generateHttpProtocolTests(GenerationContext context) {
Set<HttpProtocolUnitTestGenerator.SkipTest> inputSkipTests = new TreeSet<>(SetUtils.of(
// CBOR default value serialization (SHOULD)
HttpProtocolUnitTestGenerator.SkipTest.builder()
.service(ShapeId.from("aws.protocoltests.rpcv2Cbor#RpcV2Protocol"))
.operation(ShapeId.from("aws.protocoltests.rpcv2Cbor#OperationWithDefaults"))
.service(ShapeId.from("smithy.protocoltests.rpcv2Cbor#RpcV2Protocol"))
.operation(ShapeId.from("smithy.protocoltests.rpcv2Cbor#OperationWithDefaults"))
.addTestName("RpcV2CborClientPopulatesDefaultValuesInInput")
.addTestName("RpcV2CborClientSkipsTopLevelDefaultValuesInInput")
.addTestName("RpcV2CborClientUsesExplicitlyProvidedMemberValuesOverDefaults")
Expand Down Expand Up @@ -144,8 +144,8 @@ public static void generateHttpProtocolTests(GenerationContext context) {
Set<HttpProtocolUnitTestGenerator.SkipTest> outputSkipTests = new TreeSet<>(SetUtils.of(
// CBOR default value deserialization (SHOULD)
HttpProtocolUnitTestGenerator.SkipTest.builder()
.service(ShapeId.from("aws.protocoltests.rpcv2Cbor#RpcV2Protocol"))
.operation(ShapeId.from("aws.protocoltests.rpcv2Cbor#OperationWithDefaults"))
.service(ShapeId.from("smithy.protocoltests.rpcv2Cbor#RpcV2Protocol"))
.operation(ShapeId.from("smithy.protocoltests.rpcv2Cbor#OperationWithDefaults"))
.addTestName("RpcV2CborClientPopulatesDefaultsValuesWhenMissingInResponse")
.addTestName("RpcV2CborClientIgnoresDefaultValuesIfMemberValuesArePresentInResponse")
.build(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

package software.amazon.smithy.aws.go.codegen.customization;

import software.amazon.smithy.aws.traits.ServiceTrait;
import software.amazon.smithy.go.codegen.GoSettings;
import software.amazon.smithy.go.codegen.integration.GoIntegration;
import software.amazon.smithy.model.Model;

/**
* Backfills the AWS service trait onto smithy-namespaced protocol tests. Long-term these protocol tests should live in
* smithy-go instead but they're currently stuck here due to conflated codegen nonsense.
*/
public class BackfillProtocolTestServiceTrait implements GoIntegration {
@Override
public byte getOrder() {
return -128;
}

@Override
public Model preprocessModel(Model model, GoSettings settings) {
var service = settings.getService(model);
if (!service.getId().getNamespace().startsWith("smithy.protocoltests")) {
return model;
}

return model.toBuilder()
.addShape(
service.toBuilder()
.addTrait(
ServiceTrait.builder()
.sdkId("")
.arnNamespace("")
.cloudFormationName("")
.cloudTrailEventSource("")
.endpointPrefix("")
.build()
)
.build()
)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,5 @@ software.amazon.smithy.aws.go.codegen.customization.S3BucketContext
software.amazon.smithy.aws.go.codegen.customization.s3.ExpressDefaultChecksum
software.amazon.smithy.aws.go.codegen.customization.auth.GlobalAnonymousOption
software.amazon.smithy.aws.go.codegen.customization.CloudFrontKVSSigV4a
software.amazon.smithy.aws.go.codegen.customization.BackfillProtocolTestServiceTrait
software.amazon.smithy.go.codegen.integration.MiddlewareStackSnapshotTests
4 changes: 2 additions & 2 deletions internal/protocoltest/smithyrpcv2cbor/api_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 454d0c5

Please sign in to comment.