-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restore
SmokeTestsDecoratorTest
(#3811)
## Motivation and Context Restores `SmokeTestsDecoratorTest` that was temporarily removed in #3808. ## Description The said test was temporarily removed because `SmokeTestsDecorator` is included in the [predefined decorators](https://github.com/smithy-lang/smithy-rs/blob/b38ccb969e09ae0856c235fcb496b3f3faf41c87/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsCodegenDecorator.kt#L35) and pulls-in the `aws-config` crate for code generation. The issue was conflicts between the runtime crates used by `aws-config` (located in the `aws/sdk/build` directory) and those brought-in by that predefined decorators used by `awsSdkIntegrationTest` (located in the `rust-runtime` and `aws/rust-runtime` directories). This PR addresses these conflicts and restores the test functionality. Given the challenges, the code changes are centered around the following ideas: - Focus solely on testing the core class, `SmokeTestsInstantiator`. By doing this, we avoid running `SmokeTestsDecorator`, which would otherwise pull in the `aws-config` crate. - Initializing a config builder in smoke tests needs to be parameterized depending on the environment; in production we use `aws_config::load_defaults` and in testing we avoid including `aws-config` by using a default-constructed config builder, which is sufficient for compile-only tests. - The generated smoke tests in `SmokeTestsDecoratorTest` require minimal runtime crates for compilation. We need the `CodegenVisitor` but with a different set of codegen decorators. Prior to this PR, `awsSdkIntegrationTest` used [RustClientCodegenPlugin](https://github.com/smithy-lang/smithy-rs/blob/b38ccb969e09ae0856c235fcb496b3f3faf41c87/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/RustClientCodegenPlugin.kt#L46) that in turn loaded [predefined decorators](https://github.com/smithy-lang/smithy-rs/blob/b38ccb969e09ae0856c235fcb496b3f3faf41c87/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsCodegenDecorator.kt#L35) on the classpath, which included `SmokeTestsDecorator`. In this PR, we work around this by defining a minimal set of codegen decorators and making them pluggable through `awsSdkIntegrationTest`. ## Testing Tests in CI ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._
- Loading branch information
1 parent
2c3a4c1
commit ed7f7e6
Showing
5 changed files
with
289 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.