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

Restore SmokeTestsDecoratorTest #3811

Merged
merged 6 commits into from
Sep 4, 2024

Conversation

ysaito1001
Copy link
Contributor

@ysaito1001 ysaito1001 commented Aug 30, 2024

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 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 that in turn loaded predefined decorators 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.

@ysaito1001 ysaito1001 marked this pull request as ready for review August 30, 2024 16:31
@ysaito1001 ysaito1001 requested review from a team as code owners August 30, 2024 16:31
Copy link

A new generated diff is ready to view.

  • No codegen difference in the AWS SDK
  • No codegen difference in the Client Test
  • No codegen difference in the Server Test
  • No codegen difference in the Server Test Python
  • No codegen difference in the Server Test Typescript

A new doc preview is ready to view.

Copy link

github-actions bot commented Sep 3, 2024

A new generated diff is ready to view.

  • No codegen difference in the AWS SDK
  • No codegen difference in the Client Test
  • No codegen difference in the Server Test
  • No codegen difference in the Server Test Python
  • No codegen difference in the Server Test Typescript

A new doc preview is ready to view.

This commit addresses #3811 (comment)
Copy link

github-actions bot commented Sep 3, 2024

A new generated diff is ready to view.

  • AWS SDK (ignoring whitespace)
  • No codegen difference in the Client Test
  • No codegen difference in the Server Test
  • No codegen difference in the Server Test Python
  • No codegen difference in the Server Test Typescript

A new doc preview is ready to view.

@ysaito1001 ysaito1001 added this pull request to the merge queue Sep 4, 2024
Merged via the queue into main with commit ed7f7e6 Sep 4, 2024
44 checks passed
@ysaito1001 ysaito1001 deleted the ysaito/restore-smoke-tests-decorator-test branch September 4, 2024 16:44
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.

3 participants