-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EVA-3275: Improvements to validation report (#9)
* update tests * various updates to validation report
- Loading branch information
1 parent
966ae9d
commit 550c293
Showing
14 changed files
with
248 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,3 +127,6 @@ dmypy.json | |
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# PyCharm | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,73 @@ | ||
|
||
{% macro file_validation_report(validation_results, file_name) -%} | ||
<ul> | ||
{% for check_type, check_per_file in validation_results.items() %} | ||
{% set result = check_per_file.get(file_name, {}) %} | ||
{% if check_type == "assembly_check" %} | ||
{% set nb_match = result.get("match", 0) %} | ||
{% set nb_total = result.get("total", 0) %} | ||
{% set match_percentage = nb_match / nb_total * 100 %} | ||
{% if result.get("nb_mismatch", 0) > 0 %} | ||
{% set icon = "❌" %} | ||
{% set row_class = "fail collapsible" %} | ||
{% else %} | ||
{% set icon = "✔" %} | ||
{% set row_class = "pass" %} | ||
{% endif %} | ||
<li class='{{ row_class }}'>{{ icon }} Assembly check: {{ nb_match }}/{{ nb_total }} ({{ match_percentage|round(2) }}%)</li> | ||
{% set mismatch_list = result.get("mismatch_list") %} | ||
{% if mismatch_list %} | ||
<div class='error-list'> | ||
<ul> | ||
{% for error in mismatch_list %} | ||
<li><strong>{{ check_type }} error:</strong> {{ error }}</li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
{% endif %} | ||
{% elif check_type == "vcf_check" %} | ||
{% set critical_count = result.get("critical_count", 0) %} | ||
{% set error_count = result.get("error_count", 0) %} | ||
{% set warning_count = result.get("warning_count", 0) %} | ||
{% if critical_count > 0 %} | ||
{% set icon = "❌" %} | ||
{% set row_class = "fail collapsible" %} | ||
{% elif error_count > 0 %} | ||
{% set icon = "❌" %} | ||
{% set row_class = "warn collapsible" %} | ||
{% else %} | ||
{% set icon = "✔" %} | ||
{% set row_class = "pass" %} | ||
{% endif %} | ||
<li class='{{ row_class }}'>{{ icon }} VCF check: {{ critical_count }} critical errors {{ error_count }} non critical error {{ warning_count }} warning </li> | ||
{% set critical_list = result.get("critical_list") %} | ||
{% set error_list = result.get("error_list") %} | ||
{% for check_type, check_per_file in validation_results.items() %} | ||
{% set result = check_per_file.get(file_name, {}) %} | ||
{% if check_type == "assembly_check" %} | ||
{% set nb_match = result.get("match", 0) %} | ||
{% set nb_total = result.get("total", 0) %} | ||
{% set match_percentage = nb_match / nb_total * 100 %} | ||
{% if result.get("nb_mismatch", 0) > 0 %} | ||
{% set icon = "❌" %} | ||
{% set row_class = "report-section fail collapsible" %} | ||
{% else %} | ||
{% set icon = "✔" %} | ||
{% set row_class = "report-section pass" %} | ||
{% endif %} | ||
<div class='{{ row_class }}'>{{ icon }} Assembly check: {{ nb_match }}/{{ nb_total }} ({{ match_percentage|round(2) }}%)</div> | ||
{% set mismatch_list = result.get("mismatch_list") %} | ||
{% if mismatch_list %} | ||
<div class="error-list"> | ||
<div class="error-description">First 10 errors per category are below. <strong>Full report:</strong> {{ result.get('report_path', '') }}</div> | ||
<table> | ||
<tr> | ||
<th>Category</th><th>Error</th> | ||
</tr> | ||
{% for error in mismatch_list[:10] %} | ||
<tr> | ||
<td><strong>mismatch error</strong></td><td> {{ error }}</td> | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
</div> | ||
{% endif %} | ||
{% elif check_type == "vcf_check" %} | ||
{% set critical_count = result.get("critical_count", 0) %} | ||
{% set error_count = result.get("error_count", 0) %} | ||
{% set warning_count = result.get("warning_count", 0) %} | ||
{% if critical_count > 0 %} | ||
{% set icon = "❌" %} | ||
{% set row_class = "report-section fail collapsible" %} | ||
{% elif error_count > 0 %} | ||
{% set icon = "❌" %} | ||
{% set row_class = "report-section warn collapsible" %} | ||
{% else %} | ||
{% set icon = "✔" %} | ||
{% set row_class = "report-section pass" %} | ||
{% endif %} | ||
<div class='{{ row_class }}'>{{ icon }} VCF check: {{ critical_count }} critical errors, {{ error_count }} non-critical errors, {{ warning_count }} warnings </div> | ||
{% set critical_list = result.get("critical_list") %} | ||
{% set error_list = result.get("error_list") %} | ||
|
||
{% if critical_list or error_list %} | ||
<div class='error-list'> | ||
<ul> | ||
{% for error in critical_list %} | ||
<li><strong>{{ check_type }} error:</strong> {{ error }}</li> | ||
{% endfor %} | ||
{% for error in error_list %} | ||
<li><strong>{{ check_type }} error:</strong> {{ error }}</li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
{% endif %} | ||
{% if critical_list or error_list%} | ||
<div class="error-list"> | ||
<div class="error-description">First 10 errors per category are below. <strong>Full report:</strong> {{ result.get('report_path', '') }}</div> | ||
<table> | ||
<tr> | ||
<th>Category</th><th>Error</th> | ||
</tr> | ||
{% for error in critical_list[:10] %} | ||
<tr> | ||
<td><strong>critical error</strong></td><td> {{ error }}</td> | ||
</tr> | ||
{% endfor %} | ||
{% for error in error_list[:10] %} | ||
<tr> | ||
<td><strong>non-critical error</strong></td><td> {{ error }}</td> | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
</div> | ||
{% endif %} | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
{% endfor %} | ||
{%- endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,28 @@ | ||
|
||
{% macro metadata_validation_report(validation_results) -%} | ||
{% set json_errors = validation_results.get('metadata_check', {}).get('json_errors', []) %} | ||
{% set results = validation_results.get('metadata_check', {}) %} | ||
{% set json_errors = results.get('json_errors', []) %} | ||
{% if json_errors %} | ||
{% set icon = "❌" %} | ||
{% set row_class = "fail collapsible" %} | ||
{% set row_class = "report-section fail collapsible" %} | ||
{% else %} | ||
{% set icon = "✔" %} | ||
{% set row_class = "pass" %} | ||
{% set row_class = "report-section pass" %} | ||
{% endif %} | ||
<li class='{{ row_class }}'>{{ icon }} Metadata validation check </li> | ||
<div class='{{ row_class }}'>{{ icon }} Metadata validation check </div> | ||
{% if json_errors %} | ||
<div class='error-list'> | ||
<ul> | ||
{% for error in json_errors %} | ||
<li><strong> {{ error.get('property') }} : {{ error.get('description') }} </strong></li> | ||
{% endfor %} | ||
</ul> | ||
<div class="error-list"> | ||
<div class="error-description"><strong>Full report:</strong> {{ results.get('report_path', '') }}</div> | ||
<table> | ||
<tr> | ||
<th>Property</th><th>Error</th> | ||
</tr> | ||
{% for error in json_errors %} | ||
<tr> | ||
<td><strong>{{ error.get('property') }}</strong></td><td> {{ error.get('description') }}</td> | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
</div> | ||
{% endif %} | ||
{%- endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.