Skip to content
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

v3.7.0-4826-g372b3a9b8da2: nxp weekly report #1888

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,254 changes: 1,254 additions & 0 deletions results/v3.7.0-4826-g372b3a9b8da2/lpcxpresso54114_lpc54114_m4.xml

Large diffs are not rendered by default.

57 changes: 57 additions & 0 deletions results/v3.7.0-4826-g372b3a9b8da2/mimxrt1015_evk.xml

Large diffs are not rendered by default.

20 changes: 17 additions & 3 deletions scripts/results_verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,22 @@ def check_file_size(file_path, max_size=5):
return bool(file_size <= max_size)


def escape_xml_illegal_chars(s):
return (s.replace(r" ", "")
.replace(r" ", ""))


def check_name(file_path):
"""
Check if the name of the file corresponds with the platform name in the report

:param file_path: path of junit xml report from twister to be checked
"""
platform = file_path.name[:-4]
summary = ET.parse(file_path).getroot()[0]
with open(file_path, 'r', encoding='utf-8') as file:
xml_string = file.read()
xml_string_escaped = escape_xml_illegal_chars(xml_string)
summary = ET.fromstring(xml_string_escaped)[0]
name_in_report = summary.attrib['name']
name_in_report_norm = "_".join(name_in_report.split('/'))
return bool(platform == name_in_report_norm)
Expand All @@ -57,7 +65,10 @@ def check_attribute_value(file_path=None, item=None, max_value=None):
:param item: attribute to be verified
:param max_value: max value of the given attribute
"""
summary = ET.parse(file_path).getroot()[0]
with open(file_path, 'r', encoding='utf-8') as file:
xml_string = file.read()
xml_string_escaped = escape_xml_illegal_chars(xml_string)
summary = ET.fromstring(xml_string_escaped)[0]
item_count = int(summary.attrib[item])
return bool(item_count <= max_value)

Expand All @@ -69,7 +80,10 @@ def check_version_consistent(file_path=None, version=None):
:param file_path: junit xml report from twister
:param version: expected version of zephyr
"""
testsuite = ET.parse(file_path).getroot()[0]
with open(file_path, 'r', encoding='utf-8') as file:
xml_string = file.read()
xml_string_escaped = escape_xml_illegal_chars(xml_string)
testsuite = ET.fromstring(xml_string_escaped)[0]
properties = testsuite[0]
for property in properties:
if property.attrib['name'] == "version":
Expand Down
Loading