Skip to content

Protocol tests parsed response validation #3414

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

SergeyRyabinin
Copy link
Contributor

@SergeyRyabinin SergeyRyabinin commented May 8, 2025

Issue #, if available:
Protocol tests
Description of changes:
Generate parsed response structure validation
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.

else: # Unix-like
self.process.send_signal(signal.SIGINT)

time.sleep(0.5)
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need static sleep? what are we waiting for?

def wait(self):
"""Wait for the subprocess to complete."""
if self.process:
return self.process.wait()
Copy link
Contributor

Choose a reason for hiding this comment

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

waits without timeouts have heavily traumatized my up to this point, lets add a reasonable timeout to prevent zombie hosts

.collect(Collectors.toSet());
// include the request shapes
Set<String> requestShapes = testSuite.getCases().stream()
.map(entry -> {
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like we only ever add one item to the set ever, simplified this could just be

testSuite.getCases().stream()
  .map(entry -> { return String.format("<aws/%s/model/%s.h>", 
      serviceModel.getMetadata().getProjectName(),
      entry.getGiven().getName() + "Request")})
  .collect(Collectors.toSet());

to avoid creating a extra set per test case

#if(!$expectedResult.isEmpty())
const ${responseShape.name}& result = outcome.GetResult();
#end
/* expectedResult = R"( ${expectedResult} )" */
Copy link
Contributor

Choose a reason for hiding this comment

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

love the debug comment

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