<commit_before>{% extends "layouts/content-bootstrap.html" %}
{% load i18n %}
{% load humanize %}

{% block content %}
<h2 class="modal-header">Test Result: {{ test_result.test_case|default:"<i>unknown test case</i>" }}</h2>
<p>Each test result is part of a test run and multiple test runs can be part of the same test job.
In the <i>"You are here"</i> breadcrumb list above, click the Run link to go up to the test run detail page to see
full details of the test job which generated this test result.</p>
<p>If the test result output was captured as an attachment of the test run, the attachment name and line number will be
shown as links. The same output can also be viewed in the attachments of the test run itself.</p>

<div class="row">
  <div class="col-md-4">
    <h4 class="modal-header">Metadata</h4>
    <dl class="horizontal">
      <dt>ID</dt>
      <dd>
        <small><span style="white-space:nowrap">{{ test_result.test_run.analyzer_assigned_uuid }}/{{ test_result.relative_index }}</span> (<a href="{{ test_result.get_permalink }}">{% trans "permalink" %}</a>)</small>
      </dd>
      <dt>Test Case</dt>
      <dd>
    {% if test_result.test_case %}
      <b>{{ test_result.test_case }}</b>
    {% else %}
      <i>{% trans "unknown test case" %}</i>
    {% endif %}
      {% trans "from test" %} <b><a href="{{ test_result.test_run.test.get_absolute_url }}">{{ test_result.test_run.test }}</a></b></dd>
    </dl>
  </div>

  <div class="col-md-4">
    <h4 class="modal-header">Run Attributes</h4>
  {% with test_result.test_run.attributes.values as attrs %}
    <ul class="attributes">
    {% for item in attrs|dictsort:"name" %}
      <li>{{ item.name }}&nbsp;=&nbsp;{{ item.value }}</li>
    {% empty %}
      <i>none</i>
    {% endfor %}
    </ul>
  {% endwith %}
  </div>

  <div class="col-md-4">
    <h4 class="modal-header">Result Attributes</h4>
  {% with test_result.attributes.values as attrs %}
    <ul class="attributes">
    {% for item in attrs|dictsort:"name" %}
      <li>{{ item.name }}&nbsp;=&nbsp;{{ item.value }}</li>
    {% empty %}
      <i>none</i>
    {% endfor %}
    </ul>
  {% endwith %}
  </div>
</div>

<div class="row">
  <div class="col-md-6">
    <h3 class="modal-header">Test result details</h3>
    <dl class="dl-horizontal">
      <dt>{% trans "Outcome" %}</dt>
      <dd>
        <img src="{{ STATIC_URL }}dashboard_app/images/icon-{{ test_result.result_code }}.png"
             alt="{{ test_result.result_code }}" width="16" height="16" border="0"/>
        {{ test_result.result_code }}
      </dd>
      <dt>{% trans "Measurement" %}</dt>
      <dd>
      {% if test_result.measurement != None %}
        {{ test_result.measurement }} {{ test_result.test_case.units }}
      {% else %}
        <i>{% trans "no measurement taken" %}</i>
      {% endif %}
      </dd>
      <dt>{% trans "output file/location" %}</dt>
      <dd>
        {% if test_result.filename %}
            {% if test_result.related_attachment_available and test_result.related_attachment.is_viewable %}
            {% with test_result.related_attachment as attachment %}<commit_msg>Use <dl> for lists and not <ul><commit_after>{% extends "layouts/content-bootstrap.html" %}
{% load i18n %}
{% load humanize %}

{% block content %}
<h2 class="modal-header">Test Result: {{ test_result.test_case|default:"<i>unknown test case</i>" }}</h2>
<p>Each test result is part of a test run and multiple test runs can be part of the same test job.
In the <i>"You are here"</i> breadcrumb list above, click the Run link to go up to the test run detail page to see
full details of the test job which generated this test result.</p>
<p>If the test result output was captured as an attachment of the test run, the attachment name and line number will be
shown as links. The same output can also be viewed in the attachments of the test run itself.</p>

<div class="row">
  <div class="col-md-4">
    <h4 class="modal-header">Metadata</h4>
    <dl class="horizontal">
      <dt>ID</dt>
      <dd>
        <small><span style="white-space:nowrap">{{ test_result.test_run.analyzer_assigned_uuid }}/{{ test_result.relative_index }}</span> (<a href="{{ test_result.get_permalink }}">{% trans "permalink" %}</a>)</small>
      </dd>
      <dt>Test Case</dt>
      <dd>
    {% if test_result.test_case %}
      <b>{{ test_result.test_case }}</b>
    {% else %}
      <i>{% trans "unknown test case" %}</i>
    {% endif %}
      {% trans "from test" %} <b><a href="{{ test_result.test_run.test.get_absolute_url }}">{{ test_result.test_run.test }}</a></b></dd>
    </dl>
  </div>

  <div class="col-md-4">
    <h4 class="modal-header">Run Attributes</h4>
  {% with test_result.test_run.attributes.values as attrs %}
    <dl class="dl-horizontal">
    {% for item in attrs|dictsort:"name" %}
      <dt>{{ item.name }}</dt>
      <dd>{{ item.value }}</dd>
    {% empty %}
      <i>none</i>
    {% endfor %}
    </dl>
  {% endwith %}
  </div>

  <div class="col-md-4">
    <h4 class="modal-header">Result Attributes</h4>
  {% with test_result.attributes.values as attrs %}
    <dl class="dl-horizontal">
    {% for item in attrs|dictsort:"name" %}
      <dt>{{ item.name }}</dt>
      <dd>{{ item.value }}</dt>
    {% empty %}
      <i>none</i>
    {% endfor %}
    </dl>
  {% endwith %}
  </div>
</div>

<div class="row">
  <div class="col-md-6">
    <h3 class="modal-header">Test result details</h3>
    <dl class="dl-horizontal">
      <dt>{% trans "Outcome" %}</dt>
      <dd>
        <img src="{{ STATIC_URL }}dashboard_app/images/icon-{{ test_result.result_code }}.png"
             alt="{{ test_result.result_code }}" width="16" height="16" border="0"/>
        {{ test_result.result_code }}
      </dd>
      <dt>{% trans "Measurement" %}</dt>
      <dd>
      {% if test_result.measurement != None %}
        {{ test_result.measurement }} {{ test_result.test_case.units }}
      {% else %}
        <i>{% trans "no measurement taken" %}</i>
      {% endif %}
      </dd>
      <dt>{% trans "output file/location" %}</dt>
      <dd>
        {% if test_result.filename %}
            {% if test_result.related_attachment_available and test_result.related_attachment.is_viewable %}
            {% with test_result.related_attachment as attachment %}
{'fraction_non_alphanumeric': 0.1815856777493606, 'fraction_numerical': 0.006713554987212276, 'mean_word_length': 3.039380245319561, 'pattern_counts': {'":': 0, '<': 167, '<?xml version=': 0, '>': 167, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4891305', 'n_tokens_mistral': 2192, 'n_tokens_neox': 2073, 'n_words': 558}