Skip to content

Smithy 1.17.0 update and server protocol test workaround #3288

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

Merged
merged 2 commits into from
Feb 14, 2022
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
2 changes: 1 addition & 1 deletion codegen/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ allprojects {
version = "0.8.0"
}

extra["smithyVersion"] = "[1.16.3,1.17.0["
extra["smithyVersion"] = "[1.17.0,1.18.0["

// The root project doesn't produce a JAR.
tasks["jar"].enabled = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,12 @@ private static boolean filterProtocolTests(
return true;
}

// TODO remove after 1.17.1 or later
// https://github.com/awslabs/smithy/pull/1084
if (testCase.getId().equals("RestJsonOutputUnionWithUnitMember")) {
return true;
}

return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1435,7 +1435,7 @@ export namespace PlayerAction {
}

export interface PostPlayerActionInput {
action: PlayerAction | undefined;
action?: PlayerAction;
}

export namespace PostPlayerActionInput {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6473,7 +6473,7 @@ it("XmlUnionsWithBooleanMember:Request", async () => {
});

/**
* Serializes union union member
* Serializes union member
*/
it("XmlUnionsWithUnionMember:Request", async () => {
const client = new RestXmlProtocolClient({
Expand Down Expand Up @@ -6680,7 +6680,7 @@ it("XmlUnionsWithBooleanMember:Response", async () => {
});

/**
* Serializes union union member
* Serializes union member
*/
it("XmlUnionsWithUnionMember:Response", async () => {
const client = new RestXmlProtocolClient({
Expand Down
17 changes: 17 additions & 0 deletions scripts/generate-clients/copy-to-clients.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,30 @@ const copyServerTests = async (sourceDir, destinationDir) => {
directory: `private/${testName}`,
},
};
if (!mergedManifest.scripts.test) {
mergedManifest.scripts.test = "jest --coverage --passWithNoTests";
}
writeFileSync(destSubPath, JSON.stringify(mergedManifest, null, 2).concat(`\n`));
} else if (overWritableSubs.includes(packageSub) || !existsSync(destSubPath)) {
if (lstatSync(packageSubPath).isDirectory()) removeSync(destSubPath);
copySync(packageSubPath, destSubPath, {
overwrite: true,
});
}
const jestConfigPath = join(destPath, "jest.config.js");
writeFileSync(
jestConfigPath,
'const base = require("../../jest.config.base.js");\n' +
"\n" +
"module.exports = {\n" +
" ...base,\n" +
" globals: {\n" +
" 'ts-jest': {\n" +
" isolatedModules: true\n" +
" }\n" +
" }\n" +
"};\n"
);
}
}
};
Expand Down