Skip to content

Commit d50ae2a

Browse files
Smithy 1.17.0 update and server protocol test workaround (#3288)
* chore(codegen): update to Smithy-1.17.0 * fix(codegen): workaround server protocol tests
1 parent eece76f commit d50ae2a

File tree

5 files changed

+27
-4
lines changed

5 files changed

+27
-4
lines changed

Diff for: codegen/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ allprojects {
3131
version = "0.8.0"
3232
}
3333

34-
extra["smithyVersion"] = "[1.16.3,1.17.0["
34+
extra["smithyVersion"] = "[1.17.0,1.18.0["
3535

3636
// The root project doesn't produce a JAR.
3737
tasks["jar"].enabled = false

Diff for: codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsProtocolUtils.java

+6
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,12 @@ private static boolean filterProtocolTests(
314314
return true;
315315
}
316316

317+
// TODO remove after 1.17.1 or later
318+
// https://github.com/awslabs/smithy/pull/1084
319+
if (testCase.getId().equals("RestJsonOutputUnionWithUnitMember")) {
320+
return true;
321+
}
322+
317323
return false;
318324
}
319325

Diff for: private/aws-protocoltests-restjson/src/models/models_0.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1435,7 +1435,7 @@ export namespace PlayerAction {
14351435
}
14361436

14371437
export interface PostPlayerActionInput {
1438-
action: PlayerAction | undefined;
1438+
action?: PlayerAction;
14391439
}
14401440

14411441
export namespace PostPlayerActionInput {

Diff for: private/aws-protocoltests-restxml/test/functional/restxml.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6473,7 +6473,7 @@ it("XmlUnionsWithBooleanMember:Request", async () => {
64736473
});
64746474

64756475
/**
6476-
* Serializes union union member
6476+
* Serializes union member
64776477
*/
64786478
it("XmlUnionsWithUnionMember:Request", async () => {
64796479
const client = new RestXmlProtocolClient({
@@ -6680,7 +6680,7 @@ it("XmlUnionsWithBooleanMember:Response", async () => {
66806680
});
66816681

66826682
/**
6683-
* Serializes union union member
6683+
* Serializes union member
66846684
*/
66856685
it("XmlUnionsWithUnionMember:Response", async () => {
66866686
const client = new RestXmlProtocolClient({

Diff for: scripts/generate-clients/copy-to-clients.js

+17
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,30 @@ const copyServerTests = async (sourceDir, destinationDir) => {
177177
directory: `private/${testName}`,
178178
},
179179
};
180+
if (!mergedManifest.scripts.test) {
181+
mergedManifest.scripts.test = "jest --coverage --passWithNoTests";
182+
}
180183
writeFileSync(destSubPath, JSON.stringify(mergedManifest, null, 2).concat(`\n`));
181184
} else if (overWritableSubs.includes(packageSub) || !existsSync(destSubPath)) {
182185
if (lstatSync(packageSubPath).isDirectory()) removeSync(destSubPath);
183186
copySync(packageSubPath, destSubPath, {
184187
overwrite: true,
185188
});
186189
}
190+
const jestConfigPath = join(destPath, "jest.config.js");
191+
writeFileSync(
192+
jestConfigPath,
193+
'const base = require("../../jest.config.base.js");\n' +
194+
"\n" +
195+
"module.exports = {\n" +
196+
" ...base,\n" +
197+
" globals: {\n" +
198+
" 'ts-jest': {\n" +
199+
" isolatedModules: true\n" +
200+
" }\n" +
201+
" }\n" +
202+
"};\n"
203+
);
187204
}
188205
}
189206
};

0 commit comments

Comments
 (0)