Skip to content

Commit

Permalink
Merge pull request #520 from kids-first/fix-validation-test-summary
Browse files Browse the repository at this point in the history
🎨 Display test result summary as table
  • Loading branch information
znatty22 authored Oct 22, 2020
2 parents a453461 + 295793b commit d8346e8
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions kf_lib_data_ingest/validation/reporting/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,20 @@ def _tests_section_md(self, results, test_type):

# Add test section summary
test_order_by_outcome = [FAILED, PASSED, NA]
summary = " ".join(
[
f"`{code.title()}: {len(test_markdowns.get(code, []))}`"
for code in test_order_by_outcome
]
summary_md = self._df_to_markdown(
pandas.DataFrame(
[
{
"Result": f"**{RESULT_TO_EMOJI.get(error_code)} "
f"{error_code.title()}**",
"# of Tests": len(test_markdowns.get(error_code, [])),
}
for error_code in test_order_by_outcome
]
)
)
output.append(f"### {summary}")
output.append("### Result Summary")
output.append(summary_md)

# Add test markdowns
for result_code in test_order_by_outcome:
Expand Down

0 comments on commit d8346e8

Please sign in to comment.