Commit de72c51c authored by Luis Araujo's avatar Luis Araujo

Pass test case priority in the testcase_table

This commit passes the testcase priority in the testcase_table structure
and create a priority_color_table that can be used instead to select the
priority color during the report page rendering.
Signed-off-by: Luis Araujo's avatarLuis Araujo <luis.araujo@collabora.co.uk>
parent b3854f4b
......@@ -3,10 +3,10 @@
# This module contains the TestCasesTable object which represents the main
# test cases table with an internal structure of the form:
#
# [(test-case-name0, exect_type, priority_color,
# [(test-case-name0, exect_type, priority,
# [ deployment-type0, deployment-type1 ... ],
# [ image-type0, image-type1, image-type2 ... ]),
# (test-case-name1, exect_type, priority_color,
# (test-case-name1, exect_type, priority,
# [ deployment-type0, deployment-type1 ... ],
# [ image-type0, image-type1, image-type2 ... ]),
# ...
......@@ -43,13 +43,6 @@ from subprocess import run, SubprocessError
test_cases_repo = '/tmp/apertis-test-cases'
test_cases_files = os.path.join(test_cases_repo, 'test-cases')
priority_color = {
'low' : 'secondary',
'medium' : 'info',
'high' : 'warning',
'critical' : 'danger'
}
class TestCasesTable(object):
"""
......@@ -112,6 +105,6 @@ class TestCasesTable(object):
image_deployments = [ e.lower() for e in
tc_data['metadata']['image-deployment'] ]
self._tmp_table.append((tc_name, tc_data['metadata']['exec-type'],
priority_color[tc_data['metadata']['priority']],
tc_data['metadata']['priority'],
image_deployments,
image_type_platforms))
......@@ -26,6 +26,12 @@ from models import Job, TestCase
from config import config
from sqlalchemy import desc
priority_color_table = {
'low' : 'secondary',
'medium' : 'info',
'high' : 'warning',
'critical' : 'danger'
}
def generate_index(username=None):
jobs_versions = set()
......@@ -90,4 +96,5 @@ def generate_report(image_release, image_version,
image_urls=image_urls,
image_release=image_release,
image_version=image_version,
image_deployment=image_deployment)
image_deployment=image_deployment,
priority_color_table=priority_color_table)
......@@ -80,9 +80,9 @@
</tr>
</thead>
<tbody>
{% for suite, exec_type, priority_color, deployments, platforms in tc_table %}
{% for suite, exec_type, priority, deployments, platforms in tc_table %}
<tr>
<th scope="row" class="table-{{ priority_color }}"><a href="{{test_cases_url}}/{{ suite|e }}.html">{{ suite|e }}</a></th>
<th scope="row" class="table-{{ priority_color_table[priority] }}"><a href="{{test_cases_url}}/{{ suite|e }}.html">{{ suite|e }}</a></th>
{{ set_cell('minimal-armhf-internal', deployments, platforms, suite) }}
{{ set_cell('minimal-armhf-public', deployments, platforms, suite) }}
{{ set_cell('minimal-arm64-public', deployments, platforms, suite) }}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment