Restore `SmokeTestsDecoratorTest` (#3811)
## Motivation and Context Restores `SmokeTestsDecoratorTest` that was temporarily removed in https://github.com/smithy-lang/smithy-rs/pull/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
Please register or sign in to comment