Skip to content

Commit

Permalink
add result status to all Built projects regardless if HW available or…
Browse files Browse the repository at this point in the history
… not

Signed-off-by: kimpaller <[email protected]>
  • Loading branch information
kimpaller committed Apr 23, 2024
1 parent 8c2da59 commit b85a962
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 19 deletions.
46 changes: 28 additions & 18 deletions telemetry/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,25 +217,35 @@ def create_results_gist(server, job_name, build_number, board_name, github_gist_
job_no = build_number,
artifact_info_type = "info_txt",
)
for bn, info in boot_test.items():
artifacts = tel.artifacts(board_name, job_name, build_number)
artifact_types = ["enumerated_devs", "missing_devs", "dmesg_err", "pytest_failure"]
for artifactory_type in artifact_types:
info[0].update({artifactory_type: []})
for artifact in artifacts:
if artifact["artifact_info_type"] == artifactory_type:
info[0][artifactory_type].append(artifact["payload"])

if artifacts_info_txt:
info[0]["info_txt"] = dict()
info[0]["info_txt"].update({"Built projects": list()})
for artifact in artifacts_info_txt:
if artifact["payload"] == "Built projects":
info[0]["info_txt"]["Built projects"].append(artifact["payload_param"])
continue
info[0]["info_txt"].update({artifact["payload"]:artifact["payload_param"]})
built_projects = list()
for artifact in artifacts_info_txt:
if artifact["payload"] == "Built projects":
built_projects.append(artifact["payload_param"])

for board in built_projects:
if not board in boot_test.keys():
data[board] = "NA"
else:
bn = board
info = boot_test[board]
artifacts = tel.artifacts(board, job_name, build_number)
artifact_types = ["enumerated_devs", "missing_devs", "dmesg_err", "pytest_failure"]
for artifactory_type in artifact_types:
info[0].update({artifactory_type: []})
for artifact in artifacts:
if artifact["artifact_info_type"] == artifactory_type:
info[0][artifactory_type].append(artifact["payload"])

if artifacts_info_txt:
info[0]["info_txt"] = dict()
info[0]["info_txt"].update({"Built projects": list()})
for artifact in artifacts_info_txt:
if artifact["payload"] == "Built projects":
info[0]["info_txt"]["Built projects"].append(artifact["payload_param"])
continue
info[0]["info_txt"].update({artifact["payload"]:artifact["payload_param"]})

data[bn] = info[0]
data[bn] = info[0]

m = telemetry.markdown.ResultsMarkdown(data)
m.generate_gist(github_gist_url, github_gist_token)
Expand Down
9 changes: 8 additions & 1 deletion telemetry/report/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ def __init__(self, data):
def generate_param(self,data):
param_dict = {}
for bn, info in data.items():
if info == "NA":
param_dict[bn] = None
continue
test_build_status = None
if str(info["last_failing_stage"]) in self.CRITICAL:
test_build_status = "FAILURE"
Expand Down Expand Up @@ -106,10 +109,14 @@ def generate_param(self,data):
return param_dict

def generate_gist(self, url, token):
print(f"========== Publish Results ==========")
for bn,param in self.param_dict.items():
if not param:
print(f'Result: {bn} | ---- | HW not available')
continue
outfile = self.generate(param, bn+".md")
gist = telemetry.gist.Gist(url, token)
gist_link = gist.create_gist(outfile, f'''Boardname: {param["board_name"]}\n
Branch: {param["branch"]}\nPR ID: {param["pr_id"]}\n
timestamp: {param["timestamp"]}''')
print(f'Gist created: {gist.gh_url}/{gist_link} - {param["test_status"]}')
print(f'Result: {bn} | {gist.gh_url}/{gist_link} | {param["test_status"]}')

0 comments on commit b85a962

Please sign in to comment.