Skip to content

Commit

Permalink
Handle empty summaries in ssystem-report
Browse files Browse the repository at this point in the history
  • Loading branch information
jmichalski-ant committed Dec 4, 2023
1 parent ba14803 commit 35bfdd5
Showing 1 changed file with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,18 +124,23 @@ def run_command(config):
out = get_cmd_output(f"sh -c '{config.script}'")
summaries = []
for summary_config in config.summary_configs:
summary_content = subprocess.check_output(
f"sh -c '{summary_config.script}'",
shell=True,
text=True,
stderr=subprocess.STDOUT,
env=os.environ | {
"PROTOPLASTER_SCRIPTS":
f"{os.path.dirname(__file__)}/scripts"
},
input=out)
summaries.append(
SubReportSummary(summary_config.title, summary_content))
try:
summary_content = subprocess.check_output(
f"sh -c '{summary_config.script}'",
shell=True,
text=True,
stderr=subprocess.STDOUT,
env=os.environ | {
"PROTOPLASTER_SCRIPTS":
f"{os.path.dirname(__file__)}/scripts"
},
input=out)
summaries.append(
SubReportSummary(summary_config.title, summary_content))
except:
summaries.append(
SubReportSummary(summary_config.title,
"this summary is empty"))
return SubReportResult(config.name, out, config.output_file, summaries)
except:
if config.on_fail:
Expand Down

0 comments on commit 35bfdd5

Please sign in to comment.