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

Add SSDK codegen test #825

Merged
merged 1 commit into from
Jul 12, 2023
Merged

Conversation

srchase
Copy link
Contributor

@srchase srchase commented Jul 12, 2023

This PR adds testing of the typescript-ssdk-codegen plugin.

It adds the non-published software.amazon.smithy.typescript.ssdk.codegen.test.utils package, which includes an empty FakeProtocolGenerator which enables SSDK codegen to succeed since a protocol is required for an SSDK.

Currently, SSDK validation for @streaming union shapes is not supported, so the GetCityAnnouncements is removed from the generated SSDK since it uses the @streaming union Announcements shape in its output. Once support for this is added, the operation can be added back to the model.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@srchase srchase requested review from a team as code owners July 12, 2023 16:28
@srchase srchase force-pushed the test-generated-ssdk branch 2 times, most recently from c4f2d0b to 7e28c12 Compare July 12, 2023 17:05
@@ -0,0 +1,32 @@
extra["displayName"] = "Smithy :: Typescript :: SSDK :: Codegen :: Test :: Utils"
extra["moduleName"] = "software.amazon.smithy.typescript.ssdk.codegen.test.utils"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds the TestProtocolGenerator as a separate package. With work on the build-script, this could get added to the existing smithy-typescript-codegen-test package, but I think it makes more sense to keep that implementation separated into its own package. Implementations like protocol generators should generally end up in their own package for re-use outside of a single service model.

dependencies {
implementation(project(":smithy-typescript-codegen"))
implementation("software.amazon.smithy:smithy-model:$smithyVersion")
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: add newlines

@srchase srchase force-pushed the test-generated-ssdk branch from 7e28c12 to fbd7b07 Compare July 12, 2023 18:25
@srchase srchase merged commit c80e42b into smithy-lang:main Jul 12, 2023
@srchase srchase deleted the test-generated-ssdk branch July 12, 2023 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants