Skip to content

Commit

Permalink
Add tested_requirements artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminPelletier committed Sep 15, 2023
1 parent ce65353 commit 77be89f
Show file tree
Hide file tree
Showing 14 changed files with 595 additions and 76 deletions.
10 changes: 9 additions & 1 deletion monitoring/uss_qualifier/configurations/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ class TestConfiguration(ImplicitDict):

class TestedRolesConfiguration(ImplicitDict):
report_path: str
"""Path of HTML file to contain a fulfilled-requirements-based view of the test report"""
"""Path of folder to write HTML files containing a fulfilled-requirements-based view of the test report"""


class TestedRequirementsConfiguration(ImplicitDict):
output_path: str
"""Path of a folder into which report HTML files should be written"""


class ReportHTMLConfiguration(ImplicitDict):
Expand Down Expand Up @@ -79,6 +84,9 @@ class ArtifactsConfiguration(ImplicitDict):
tested_roles: Optional[TestedRolesConfiguration] = None
"""If specified, configuration describing a desired report summarizing tested requirements for each specified participant and role"""

tested_requirements: Optional[TestedRequirementsConfiguration] = None
"""If specified, configuration describing a desired report summarizing all tested requirements for each participant"""


class USSQualifierConfigurationV1(ImplicitDict):
test_run: Optional[TestConfiguration] = None
Expand Down
2 changes: 2 additions & 0 deletions monitoring/uss_qualifier/configurations/dev/f3548.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ v1:
report_path: output/tested_roles_f3548
report:
report_path: output/report_f3548.json
tested_requirements:
output_path: output/tested_requirements_f3548
2 changes: 2 additions & 0 deletions monitoring/uss_qualifier/configurations/dev/netrid_v22a.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ v1:
report_path: output/report_netrid_v22a.json
tested_roles:
report_path: output/tested_roles_netrid_v22a
tested_requirements:
output_path: output/tested_requirements_f3411v22a
2 changes: 2 additions & 0 deletions monitoring/uss_qualifier/configurations/dev/uspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ v1:
templated_reports:
- template_url: https://github.com/Orbitalize/reports/releases/download/v0.0.17/app-v0.0.17.zip
output_path: output/capabilities_uspace.html
tested_requirements:
output_path: output/tested_requirements_uspace
8 changes: 8 additions & 0 deletions monitoring/uss_qualifier/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
)
from monitoring.uss_qualifier.fileio import load_dict_with_references
from monitoring.uss_qualifier.reports.documents import make_report_html
from monitoring.uss_qualifier.reports.tested_requirements import (
generate_tested_requirements,
)
from monitoring.uss_qualifier.reports.tested_roles import generate_tested_roles
from monitoring.uss_qualifier.reports.graphs import make_graph
from monitoring.uss_qualifier.reports.report import TestRunReport, redact_access_tokens
Expand Down Expand Up @@ -196,6 +199,11 @@ def main() -> int:
logger.info("Writing tested roles view to {}", path)
generate_tested_roles(report, path)

if config.artifacts.tested_requirements:
path = config.artifacts.tested_requirements.output_path
logger.info(f"Writing tested requirements view to {path}")
generate_tested_requirements(report, path)

return os.EX_OK


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<html>
<head>
<style>
table, th, td {
border: 1px solid;
}
td {
vertical-align: top;
}
th {
background-color: rgb(230, 230, 230);
}
.pass_result {
background-color: rgb(192, 255, 192);
}
.fail_result {
background-color: rgb(255, 192, 192);
}
.not_tested {
background-color: rgb(192, 192, 192);
}
</style>
</head>
<body>
<div>
<h2>{{ participant_id }} tested requirements</h2>
<table>
<tr>
<th>Package</th>
<th>Requirement</th>
<th>Result</th>
<th>Scenario</th>
<th>Case</th>
<th>Step</th>
<th>Check</th>
</tr>

{% set first_row = namespace(package=True, requirement=True, scenario=True, case=True, step=True) %}
{% for package in breakdown.packages %}
{% set first_row.package = True %}
{% for requirement in package.requirements %}
{% set first_row.requirement = True %}
{% for test_scenario in requirement.scenarios %}
{% set first_row.scenario = True %}
{% for test_case in test_scenario.cases %}
{% set first_row.case = True %}
{% for test_step in test_case.steps %}
{% set first_row.step = True %}
{% for check in test_step.checks %}
<tr>
{% if first_row.package %}
<td rowspan="{{ package.rows }}">{{ package.name }}</td>
{% endif %}
{% if first_row.requirement %}
<td rowspan="{{ requirement.rows }}" class="{{ requirement.classname }}">{{ requirement.id }}</td>
{% endif %}
<td class="{{ check.classname }}">{{ check.result }}</td>
{% if first_row.scenario %}
<td rowspan="{{ test_scenario.rows }}">
{% if test_scenario.url %}
<a href="{{ test_scenario.url }}">{{ test_scenario.name }}</a>
{% else %}
{{ test_scenario.name }}
{% endif %}
</td>
{% endif %}
{% if first_row.case %}
<td rowspan="{{ test_case.rows }}">
{% if test_case.url %}
<a href="{{ test_case.url }}">{{ test_case.name }}</a>
{% else %}
{{ test_case.name }}
{% endif %}
</td>
{% endif %}
{% if first_row.step %}
<td rowspan="{{ test_step.rows }}">
{% if test_step.url %}
<a href="{{ test_step.url }}">{{ test_step.name }}</a>
{% else %}
{{ test_step.name }}
{% endif %}
</td>
{% endif %}
<td class="{{ check.classname }}">
{% if check.url %}
<a href="{{ check.url }}">{{ check.name }}</a>
{% else %}
{{ check.name }}
{% endif %}
{% if check.successes + check.failures > 1 %}
({{ check.successes + check.failures }}x)
{% endif %}
</td>
</tr>

{% set first_row.package = False %}
{% set first_row.requirement = False %}
{% set first_row.scenario = False %}
{% set first_row.case = False %}
{% set first_row.step = False %}
{% endfor %}
{% endfor %}
{% endfor %}
{% endfor %}
{% endfor %}
{% endfor %}
</table>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<html>
<body>
<div>
<h2>Participants</h2>
<ul>
{% for participant_id in participant_ids %}
<li><a href="./{{ participant_id }}.html">{{ participant_id }}</a></li>
{% endfor %}
</ul>
</div>
</body>
</html>
Loading

0 comments on commit 77be89f

Please sign in to comment.