Update pytest xml parser and markdown gist results#45
Merged
kimpaller merged 7 commits intosdgtt:masterfrom Jan 16, 2025
Merged
Update pytest xml parser and markdown gist results#45kimpaller merged 7 commits intosdgtt:masterfrom
kimpaller merged 7 commits intosdgtt:masterfrom
Conversation
cd93b12 to
87c22db
Compare
87c22db to
76b6669
Compare
jpineda3
reviewed
Jan 16, 2025
Comment on lines
+356
to
+362
| if test_function_module != "": | ||
| if test_name_function != "": | ||
| if test_function_module in test_links: | ||
| test_permalink = test_links[test_function_module] + "#" + test_function_module + "." + test_name_function | ||
| test_name_link = f"[{test_name}]({test_permalink})" | ||
| else: | ||
| if test_function_module in test_links: |
Contributor
There was a problem hiding this comment.
Checking if test_function_module is in test_links can be joined with the first check if the test_function_module != "".
Comment on lines
+291
to
+300
| # Convert remaining string to a dictionary | ||
| param_dict = ast.literal_eval(new_param) | ||
| if param_dict: | ||
| for key, value in param_dict.items(): | ||
| # Convert parameters back to string | ||
| new_updated = "'" + key + "'" + ": " + str(value) | ||
| param_list.append(new_updated) | ||
| insert_param_name = param_name + "=" | ||
| param_list.insert(0, insert_param_name) | ||
| param_list_string = " \n".join(param_list) |
Contributor
There was a problem hiding this comment.
Will .replace(", '", ",\n'") not work for this?
Comment on lines
+331
to
+340
| if len(prop_list) > 1: | ||
| for props in prop_list: | ||
| if len(props) > 0: | ||
| # Remove leading spaces | ||
| prop_strip = props.lstrip() | ||
| prop_list_updated.append(prop_strip) | ||
| if len(prop_list_updated) > 0: | ||
| new_props = " ".join(prop_list_updated) | ||
| # Combine exception type, message, and parameters | ||
| exctype_message = "\n" + " " + new_props + " ( " + exc_param_value + " )" |
Contributor
There was a problem hiding this comment.
What's an example of a property value that satisfies this condition and requires such parsing?
Comment on lines
+77
to
78
| pytest_failures_details = "No failures" | ||
| pytest_failures_details = "Invalid" if pytest_tests_status == "⛔" else pytest_failures_details |
Contributor
There was a problem hiding this comment.
Combine "No failures" after else instead
kimpaller
approved these changes
Jan 16, 2025
| payload_param = param | ||
| return (payload, payload_param) | ||
|
|
||
| class PytestFailure(xmlParser): |
Contributor
There was a problem hiding this comment.
Good use of inheritance for maintaining code structure and reusability
jpineda3
approved these changes
Jan 16, 2025
Contributor
jpineda3
left a comment
There was a problem hiding this comment.
This can be merged now. Mods can be done later.
This change adds a separate class for parsing pytest results xml Signed-off-by: Trisha De Vera <Trisha.Devera@analog.com>
This change updates the stucture of pytest results to gistfor markdown template Signed-off-by: Trisha De Vera <Trisha.Devera@analog.com>
Signed-off-by: Trisha De Vera <Trisha.Devera@analog.com>
Signed-off-by: Trisha De Vera <Trisha.Devera@analog.com>
Signed-off-by: Trisha De Vera <Trisha.Devera@analog.com>
Signed-off-by: Trisha De Vera <Trisha.Devera@analog.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change includes adding a class for parsing pytest xml, updating test artifacts, and adding a pytest_failure parameter for parser test. The parser class adds test details in gist results such as parameters used for the test, error message, and inline link for test description.