8000 Test against JSON summaries (and bugfixes) by ConorMacBride · Pull Request #134 · matplotlib/pytest-mpl · GitHub
[go: up one dir, main page]

Skip to content

Test against JSON summaries (and bugfixes) #134

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Feb 9, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improved support for hash comparison only HTML summary
  • Loading branch information
ConorMacBride committed Feb 6, 2022
commit 1cb3d4e3be89c27f73d74342a47379bc8b717f13
4 changes: 4 additions & 0 deletions pytest_mpl/summary/templates/filter.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ <h5>Sort tests by...</h5>
{{ sort_option('status-sort', 'status', 'desc', default=true) }}
{{ sort_option('collected-sort', 'collected', 'asc') }}
{{ sort_option('test-name', 'name') }}
{% if results.warn_missing['baseline_image'] -%}
{{ sort_option('rms-sort', 'RMS', 'desc') }}
{%- endif %}
</div>
<form id="filterForm" onsubmit="return false;">
<h5>Show tests which have...</h5>
Expand All @@ -32,11 +34,13 @@ <h5>Show tests which have...</h5>
{{ filter_option('overall-failed', 'failed') }}
{{ filter_option('overall-skipped', 'skipped') }}
</div>
{% if results.warn_missing['baseline_image'] -%}
<div class="list-group m-2">
{{ filter_option('image-match', 'matching images') }}
{{ filter_option('image-diff', 'differing images') }}
{{ filter_option('image-missing', 'no baseline image') }}
</div>
{%- endif %}
{% if results.warn_missing['baseline_hash'] -%}
<div class="list-group m-2 mpl-hash">
{{ filter_option('hash-match', 'matching hashes') }}
Expand Down
18 changes: 12 additions & 6 deletions pytest_mpl/summary/templates/result_images.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ <h6><small class="text-muted">{{ r.module }}</small></h6>
</div>
<div class="offcanvas-body">
<h5 class="card-title">{{ r.name }}</h5>
{% if results.warn_missing['baseline_image'] -%}
<div class="row row-cols-1 row-cols-md-3 g-4 mt-3">
{% macro image_card(file, name) -%}
<div class="col py-3 m-0">
Expand All @@ -21,6 +22,7 @@ <h5 class="card-title">{{ r.name }}</h5>
{{ image_card(r.diff_image, 'Diff') }}
{{ image_card(r.result_image, 'Result') }}
</div>
{%- endif %}
<div class="row row-cols-1 row-cols-md-2 g-4">
<div class="col">
<div class="card text-white bg-{{ r.status | status_class }}">
Expand All @@ -31,19 +33,23 @@ <h5 class="card-title">{{ r.name }}</h5>
</div>
</div>
<div class="col">
{% macro pre_data(id, value, name) -%}
{% filter indent(width=8) -%}
<div class="mb-3 {{ id | replace('_', '-') }}">
<label for="{{ id }}" class="form-label">{{ name }}</label>
<pre class="form-control {{ id | replace('_', '-') }}-value" id="{{ id }}">{{ value }}</pre>
</div>
{%- endfilter %}
{%- endmacro -%}
{% if results.warn_missing['baseline_image'] -%}
8000 <div class="card text-white bg-{{ r.image_status | status_class }} mb-3 mpl-image">
<div class="card-header">{{ r.image_status | image_status_msg }}</div>
<div class="card-body">
{% macro pre_data(id, value, name) -%}
<div class="mb-3 {{ id | replace('_', '-') }}">
<label for="{{ id }}" class="form-label">{{ name }}</label>
<pre class="form-control {{ id | replace('_', '-') }}-value" id="{{ id }}">{{ value }}</pre>
</div>
{%- endmacro -%}
{{ pre_data('rms', r.rms_str, 'RMS') }}
{{ pre_data('tolerance', r.tolerance, 'Tolerance') }}
</div>
</div>
{%- endif %}
{% if results.warn_missing['baseline_hash'] -%}
<div class="card text-white bg-{{ r.hash_status | status_class }} mb-3 mpl-hash">
<div class="card-header">{{ r.hash_status | hash_status_msg }}</div>
Expand Down
2 changes: 1 addition & 1 deletion pytest_mpl/summary/templates/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ body.no-hash-test .mpl-hash {
display: none;
}
pre {
white-space: pre-wrap;
white-space: pre-line;
}
div.result div.status-badge button img {
vertical-align: sub;
Expand Down
0