-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve usability: add report view (#799)
Signed-off-by: Matthias Büchse <[email protected]> Signed-off-by: Kurt Garloff <[email protected]> Co-authored-by: Kurt Garloff <[email protected]>
- Loading branch information
Showing
4 changed files
with
107 additions
and
8 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
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,16 +1,18 @@ | ||
<!DOCTYPE html> | ||
<html lang="en" dir="ltr"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>{{ title or 'SCS compliance overview' }}</title> | ||
</head> | ||
<body> | ||
<style type="text/css"> | ||
table {border-collapse:collapse;} | ||
table td, table th {vertical-align:top;padding:0.75rem;border:1px solid #dadde1;} | ||
table th {font-weight:700;background-color:#00000008;} | ||
html {text-rendering:optimizelegibility;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";} | ||
li {margin:0.33em 0;} | ||
pre.line {margin: 0;} | ||
</style> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>{{ title or 'SCS compliance overview' }}</title> | ||
</head> | ||
<body> | ||
{% if title %}<h1>{{title}}</h1> | ||
{% endif %}{{fragment}}</body> | ||
</html> |
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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
## General info | ||
|
||
- uuid: [{{ report.run.uuid }}]({{ report_url(report.run.uuid, download=True) }}) | ||
- subject: {{ report.subject }} | ||
- scope: [{{ report.spec.name }}]({{ scope_url(report.spec.uuid) }}) | ||
- checked at: {{ report.checked_at }} | ||
|
||
## Results | ||
|
||
{% for version, version_results in report.versions.items() %}{% if version_results %} | ||
### {{ version }} | ||
|
||
| test case | result | invocation | | ||
|---|---|---| | ||
{% for testcase_id, result_data in version_results.items() -%} | ||
| {{ testcase_id }} {: #{{ version + '_' + testcase_id }} } | {{ result_data.result | verdict_check }} | [{{ result_data.invocation }}](#{{ result_data.invocation }}) | | ||
{% endfor %} | ||
{% endif %}{% endfor %} | ||
|
||
## Run | ||
|
||
### Variable assignment | ||
|
||
| key | value | | ||
|---|---| | ||
{% for key, value in report.run.assignment.items() -%} | ||
| `{{ key }}` | `{{ value }}` | | ||
{% endfor %} | ||
|
||
### Check tool invocations | ||
|
||
{% for invid, invdata in report.run.invocations.items() %} | ||
#### Invocation {{invid}} {: #{{ invid }} } | ||
|
||
- cmd: `{{ invdata.cmd }}` | ||
- rc: {{ invdata.rc }} | ||
- channel summary | ||
{%- for channel in ('critical', 'error', 'warning') %} | ||
{%- if invdata[channel] %} | ||
- **{{ channel }}: {{ invdata[channel] }}** | ||
{%- else %} | ||
- {{ channel }}: – | ||
{%- endif %} | ||
{%- endfor %} | ||
- results | ||
{%- for resultid, result in invdata.results.items() %} | ||
- {{ resultid }}: {{ result | verdict_check }} | ||
{%- endfor %} | ||
|
||
{% if invdata.stdout -%} | ||
<details><summary>Captured stdout</summary> | ||
```text | ||
{{ '\n'.join(invdata.stdout) }} | ||
``` | ||
</details> | ||
{%- endif %} | ||
|
||
{% if invdata.stderr -%} | ||
<details {% if invdata.warning or invdata.error or invdata.critical %}open{% endif %}><summary>Captured stderr</summary> | ||
{%- for line in invdata.stderr %} | ||
<pre class="line">{% if line.split(':', 1)[0].lower() in ('warning', 'error', 'critical') %}{{ '<strong>' + line + '</strong>' }}{% else %}{{ line }}{% endif %}</pre> | ||
{%- endfor %} | ||
</details> | ||
{%- endif %} | ||
|
||
{% endfor %} |