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

Smoke Tests Codegen Working #3155

Merged
merged 51 commits into from
Oct 30, 2024
Merged

Smoke Tests Codegen Working #3155

merged 51 commits into from
Oct 30, 2024

Conversation

sbera87
Copy link
Contributor

@sbera87 sbera87 commented Oct 18, 2024

Issue #, if available:

Description of changes:

Check all that applies:

  • Did a review by yourself.
  • Added proper tests to cover this PR. (If tests are not applicable, explain.)
  • Checked if this PR is a breaking (APIs have been changed) change.
  • Checked if this PR will not introduce cross-platform inconsistent behavior.
  • Checked if this PR would require a ReadMe/Wiki update.

Check which platforms you have built SDK on to verify the correctness of this PR.

  • Linux
  • Windows
  • Android
  • MacOS
  • IOS
  • Other Platforms

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

@sbera87 sbera87 closed this Oct 18, 2024
@sbera87 sbera87 reopened this Oct 18, 2024
aws-sdk-cpp-automation and others added 10 commits October 20, 2024 00:32
…ibeIntegrations and ModifyIntegration APIs to create and manage Amazon Redshift Zero-ETL Integrations.

Amazon Q Business now supports embedding the Amazon Q Business web experience on third-party websites.
On a channel that you own, you can now replace an ongoing stream with a new stream by streaming up with the priority parameter appended to the stream key.
This release adds support for email maximum delivery seconds that allows senders to control the time within which their emails are attempted for delivery.
Enable proxy for reserved capacity fleet.
Added sourceUrlType field to StartDeployment request
Documentation update for AWS CloudFormation API Reference.
AWS Resilience Hub now integrates with the myApplications platform, enabling customers to easily assess the resilience of applications defined in myApplications. The new Resiliency widget provides visibility into application resilience and actionable recommendations for improvement.
We are expanding support for 40 new locales in AWS Transcribe Streaming.
…eters in the ListBuckets API. For ListBuckets requests that express pagination, Amazon S3 will now return both the bucket names and associated AWS regions in the response.
Updates Amazon RDS documentation for TAZ IAM support
Add StartDashboardSnapshotJobSchedule API. RestoreAnalysis now supports restoring analysis to folders.
This release adds validation to require specifying a SecurityGroup and Subnets in the Vpc object under PipesSourceSelfManagedKafkaParameters. It also adds support for iso-e, iso-f, and other non-commercial partitions in ARN parameters.
This release adds Data Grant support, through which customers can programmatically create data grants to share with other AWS accounts and accept data grants from other AWS accounts.
Added the registrations status of REQUIRES_AUTHENTICATION
Updated the DomainName pattern for Active Directory
Removing support for topK property in PromptModelInferenceConfiguration object, Making PromptTemplateConfiguration property as required, Limiting the maximum PromptVariant to 1
RequestSpotInstances and RequestSpotFleet feature release.
Adding converse support to CMI API's
Removing FEDERATED from Create/List/Delete/GetDataCatalog API
Adding the following project member designations: PROJECT_CATALOG_VIEWER, PROJECT_CATALOG_CONSUMER and PROJECT_CATALOG_STEWARD in the CreateProjectMembership API and PROJECT_CATALOG_STEWARD designation in the AddPolicyGrant API.
…ibeIntegrations and ModifyIntegration APIs to create and manage Amazon Redshift Zero-ETL Integrations.

Amazon Q Business now supports embedding the Amazon Q Business web experience on third-party websites.
On a channel that you own, you can now replace an ongoing stream with a new stream by streaming up with the priority parameter appended to the stream key.
This release adds support for email maximum delivery seconds that allows senders to control the time within which their emails are attempted for delivery.
Enable proxy for reserved capacity fleet.
Added sourceUrlType field to StartDeployment request
Documentation update for AWS CloudFormation API Reference.
AWS Resilience Hub now integrates with the myApplications platform, enabling customers to easily assess the resilience of applications defined in myApplications. The new Resiliency widget provides visibility into application resilience and actionable recommendations for improvement.
We are expanding support for 40 new locales in AWS Transcribe Streaming.
cmake/sdks.cmake Outdated
@@ -162,7 +162,6 @@ if(BUILD_ONLY)
else()
set(SDK_DIR "generated/src/aws-cpp-sdk-${SDK}")
endif()

Copy link
Contributor

Choose a reason for hiding this comment

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

still has white space change

"algorithm"
);

this.unitTestHeaders = new HashSet<>();
Copy link
Contributor

Choose a reason for hiding this comment

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

dont create a new hash set and add to it, use ImmtuableList.of

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this case, it's a set .So I will just use Set.of()

import software.amazon.smithy.aws.smoketests.model.S3VendorParams;

public final class ClientConfiguration {
private final AwsVendorParams awsParams;
Copy link
Contributor

Choose a reason for hiding this comment

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

AwsVendorParams and S3VendorParams both extend BaseAwsVendorParams, this is a anti pattern to access through a boolean "has type" pattern. the member variable should be of BaseAwsVendorParams, and when you build it assign it a concrete type then just refer to the configuration through the abstract type

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ack. changed to base class and use instance of.

{
if(shape == null)
{
throw new Exception("Invalid shape found");
Copy link
Contributor

Choose a reason for hiding this comment

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

dont throw a Exception, it makes everyone up chain check it, either throw a generic RuntimeException or create a class that subclasses RuntimeException

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ack

throw new Exception(String.format("No service trait detected in service shape with name=%s",serviceShape.getId().getName()));
}

//this.model.getShape(serviceShapeId)
Copy link
Contributor

Choose a reason for hiding this comment

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

still commented out

{
write("${L|}",

"#include <aws/testing/AwsCppSdkGTestSuite.h>\n" + //
Copy link
Contributor

Choose a reason for hiding this comment

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

still here in latest commit, at least the function at least,if its unused, remove it

@Override
public Symbol enumShape(EnumShape shape) {

// return ShapeVisitor.super.enumShape(shape);
Copy link
Contributor

Choose a reason for hiding this comment

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

commented out code, inconsistent spacing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ack. oversight

{
if(!serviceShape.getTrait(ServiceTrait.class).isPresent())
{
throw new Exception(String.format("No service trait detected in service shape with name=%s",serviceShape.getId().getName()));
Copy link
Contributor

Choose a reason for hiding this comment

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

dont throw exception, everyon up chain has to check it, never throw or check Exception, subclass or throw a RuntimeException

Copy link
Contributor Author

@sbera87 sbera87 Oct 25, 2024

Choose a reason for hiding this comment

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

What is your recommendation how I should handle this? I understand that stack unwinding will happen on exception but what do i return when service trait is missing. I can throw a Runtimeexception

Copy link
Contributor

Choose a reason for hiding this comment

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

they have a concept of "checked and unchecked exceptions" in java.
additionally, simple regular Exception is too broad and the exception handling error code must catch it and do it's logic accordingly to the exception string message (vs simply type of the exception).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ack. I will switch to runtime exception as it is one of those cases where I have to throw if service trait not found

@sbera87 sbera87 requested a review from sbiscigl October 25, 2024 18:53
@sbera87
Copy link
Contributor Author

sbera87 commented Oct 25, 2024

Left some comments, have some concerns around exception handling and the structure of some of the operations. but overall the execution pattern looks good, just need to refactor some things.

also in the future make sure to remove commented code, system outs, and white space changes before marking the PR as ready to review

Addressed all the comments that were brought up. If there are some things missed, I will address

@sbera87 sbera87 requested a review from sbiscigl October 25, 2024 20:14
public boolean expectSuccess;
public Optional<String> errorShapeId;
//capture auth scheme as that decides the client constructor
String auth;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: why is this member the only one with a comment and the only one without access modifier?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ack. missed the specifier, shall add . The comment for this field is because this is a derived field, not parsed directly from the smoke test trait in model since its available in the service trait

} catch (Exception e) {
// Handle the exception
System.err.println("An error occurred while running the smoke tests: " + e.getMessage());
e.printStackTrace();
Copy link
Contributor

Choose a reason for hiding this comment

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

the generation should fail. whatever invokes the generation in CI, should not fail. making it the callers responsibility to decide.

@sbera87 sbera87 requested a review from sbiscigl October 28, 2024 18:05
@sbera87 sbera87 merged commit 153e258 into main Oct 30, 2024
4 checks passed
@sbera87 sbera87 deleted the smoke-test-gen2 branch October 30, 2024 13: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.

4 participants