-
Notifications
You must be signed in to change notification settings - Fork 14
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
02 - Script to parser SDK python tests #144
base: 01_evaluation_test_info_pull_sdk_docker_image
Are you sure you want to change the base?
02 - Script to parser SDK python tests #144
Conversation
test_collections/matter/sdk_tests/support/python_testing/list_python_tests_classes.py
Outdated
Show resolved
Hide resolved
...collections/matter/sdk_tests/support/python_testing/models/rpc_client/test_harness_client.py
Outdated
Show resolved
Hide resolved
test_collections/matter/sdk_tests/support/python_testing/list_python_tests_classes.py
Outdated
Show resolved
Hide resolved
test_collections/matter/sdk_tests/support/python_testing/list_python_tests_classes.py
Outdated
Show resolved
Hide resolved
...collections/matter/sdk_tests/support/python_testing/models/rpc_client/test_harness_client.py
Outdated
Show resolved
Hide resolved
c5f9de9
to
c52f447
Compare
0c6f9b1
to
c09cbc6
Compare
# collection = PythonCollectionDeclaration( | ||
# name="Custom SDK Python Tests", folder=python_test_folder | ||
# ) | ||
|
||
# suites = __parse_python_tests( | ||
# python_test_version="custom", | ||
# mandatory=False, | ||
# ) | ||
|
||
# for suite in suites: | ||
# if not suite.test_cases: | ||
# continue | ||
# suite.sort_test_cases() | ||
# collection.add_test_suite(suite) | ||
|
||
# if not collection.test_suites: | ||
# return None | ||
|
||
# return collection |
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.
TODO: After PoC Validation
|
||
with open(JSON_OUTPUT_FILE_PATH, "r") as json_file: | ||
json_data = json.load(json_file) | ||
json_file.close() |
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.
json_file.close() | |
I think when using with
statement, it not necessary to close the file. Please check this information.
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.
You're correct Romulo, it's not necessary to close.
It's the purpose of the with
statement indeed.
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.
What's our end goal here? Let's clearly state our goals for the PRs we open. It may be obvious for the author but not so for the reviewers.
c52f447
to
d3e5599
Compare
dbcd83f
to
1a3fccc
Compare
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.
Please remember to fix the CI issues
print(f">>>>>>>> Total of test functions: {test_function_count}") | ||
print( | ||
( | ||
">>>>>>>> Total of test functions (doesn't start with 'test_TC_'): " |
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.
">>>>>>>> Total of test functions (doesn't start with 'test_TC_'): " | |
">>>>>>>> Total of test functions that don't start with 'test_TC_': " |
or maybe
">>>>>>>> Total of test functions (doesn't start with 'test_TC_'): " | |
">>>>>>>> Total of invalid test functions (don't start with 'test_TC_'): " |
?
@@ -119,24 +171,20 @@ def __test_methods(class_def: ast.ClassDef) -> list[FunctionDefType]: | |||
return all_methods | |||
|
|||
|
|||
def __test_case_names(methods: list[FunctionDefType]) -> list[str]: | |||
def __test_case_name(function_name: str) -> Optional[str]: | |||
"""Extract test case names from methods that match the pattern "test_TC_[\\S]+". |
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.
"""Extract test case names from methods that match the pattern "test_TC_[\\S]+". | |
"""Extract test case name from methods that match the pattern "test_TC_[\\S]+". |
test_collections/matter/sdk_tests/support/python_testing/list_python_tests_classes.py
Show resolved
Hide resolved
test_collections/matter/sdk_tests/support/python_testing/sdk_python_tests.py
Show resolved
Hide resolved
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.
Good job.
d3e5599
to
48f5e00
Compare
1a3fccc
to
a79a5fd
Compare
The purpose of this PR is to resolve the display of the names of the python test steps.
Now we will leave it up to the SDK to deliver the information for each test. The backend will only pass the name of the test to the frontend.
The information is obtained by calling the get_test_info() method. Here is an example of the information for the
TC_ACE_1_2
test:Issue
project-chip/certification-tool#306
With this change no changes to the frontend will be necessary. And we can close this issue.
Code changes
Output report