-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Protocol test clients generation #3247
Conversation
29178c7
to
dabab16
Compare
dabab16
to
5ea3ad1
Compare
5ea3ad1
to
c237e79
Compare
...java/com/amazonaws/util/awsclientgenerator/domainmodels/c2j/C2jXmlNamespaceDeserializer.java
Outdated
Show resolved
Hide resolved
d47996e
to
4596bfd
Compare
86bad5d
to
90f1bf6
Compare
@@ -43,4 +43,4 @@ dependencyResolutionManagement { | |||
library("junit-jupiter-engine", "org.junit.jupiter", "junit-jupiter-engine").versionRef("junit") | |||
} | |||
} | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file can be excluded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch! thank you for noticing this.
@@ -0,0 +1,4 @@ | |||
#!/usr/bin/env python3 | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this file needed? Usually this is for python packages (though not needed for 3.3 onwards)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is a good question.
I'm just used to create a python init.py file when I want to create a python sub-package.
according to the spec and stackoverflow:
Keep on adding empty init.py to your directories because 99% of the time you just want to create regular packages. Also, Python tools out there such as mypy and pytest require empty init.py files to interpret the code structure accordingly. This can lead to weird errors if not done with care.
I'm not sure if empty means literally empty, or shebang + license is still okay.
I only checked on py 3.7 and 3.9 and on our CI that it works.
:return: | ||
""" | ||
return self._generate_test_clients(executor, max_workers) | ||
# TODO: self._generate_tests() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this still to do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is work in progress, I will submit a following PR soon, just splitting the work into sub-parts.
pathlib.Path(f"{sdk_root_dir}/{PROTOCOL_TESTS_BASE_DIR}").resolve()) | ||
self.c2j_client_generator.output_location = PROTOCOL_TESTS_GENERATED_CLIENTS_DIR | ||
|
||
def generate(self, executor: ProcessPoolExecutor, max_workers: int): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Food for thought: This is great and we can add to this more abstraction to simplify the main runner. We can perhaps use a generator base class with generate() and other relevant methods abstracted (can use builder design patter for example to build the generator class) and implement the different methods and from the main script just instantiate the appropriate class based upon args and invoke generate of one or more codegen objects (client, smoke, protocol)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with minor and good to have comments.
4beec94
to
99c034e
Compare
99c034e
to
1f69e3f
Compare
Issue #, if available:
WIP for protocol tests for this SDK
Description of changes:
These clients should look, act, and behave just like any regular generated SDK client but are used for SDK testing only.
Tested by generating all and observing that no unexpected difference is generated.
The only difference is
Check all that applies:
Check which platforms you have built SDK on to verify the correctness of this PR.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.