Skip to content

Commit

Permalink
Restructuring
Browse files Browse the repository at this point in the history
Signed-off-by: noopur <[email protected]>
  • Loading branch information
noopurintel committed Nov 8, 2024
1 parent 371ef8e commit 1eab094
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions tests/openfl_e2e/utils/xml_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def get_test_status(result):
status of the test status
"""
status = "FAILED"
if "failure" in result.tag:
if "failure" in result.tag or "error" in result.tag:
# If the result has a tag "failure", set status as "FAIL"
status = "FAILED"
elif "skipped" in result.tag:
Expand All @@ -41,21 +41,22 @@ def get_testcase_result():
# Populate testcase details in a dictionary
for testcase in testsuite:
database_dict = {}
database_dict["name"] = testcase.attrib.get("name")
database_dict["time"] = testcase.attrib.get("time")
if testcase.attrib.get("name"):
database_dict["name"] = testcase.attrib.get("name")
database_dict["time"] = testcase.attrib.get("time")

# Successful test won't have any result/subtag
if len(testcase) == 0:
database_dict["result"] = "PASSED"
# Successful test won't have any result/subtag
if len(testcase) == 0:
database_dict["result"] = "PASSED"

# Iterate over each result in testsuite
for result in testcase:
status = get_test_status(result)
database_dict["result"] = status
# Iterate over each result in testsuite
for result in testcase:
status = get_test_status(result)
database_dict["result"] = status

# Append the dictionary to database_list
database_list.append(database_dict)
status = None
# Append the dictionary to database_list
database_list.append(database_dict)
status = None

print(f"Database list = {database_list}")
return database_list
Expand Down

0 comments on commit 1eab094

Please sign in to comment.