From 10e515c1fd5f55b41984b69fdf7fa62af271bc6f Mon Sep 17 00:00:00 2001 From: Benjamin Pelletier Date: Sat, 14 Oct 2023 23:44:55 +0000 Subject: [PATCH] Add information to sequence view index page --- .../uss_qualifier/reports/sequence_view.py | 6 ++ .../templates/sequence_view/overview.html | 93 ++++++++++++++++++- .../reports/tested_requirements.py | 4 +- 3 files changed, 99 insertions(+), 4 deletions(-) diff --git a/monitoring/uss_qualifier/reports/sequence_view.py b/monitoring/uss_qualifier/reports/sequence_view.py index 40c19c774d..8ba9ca1c2e 100644 --- a/monitoring/uss_qualifier/reports/sequence_view.py +++ b/monitoring/uss_qualifier/reports/sequence_view.py @@ -11,6 +11,7 @@ from monitoring.uss_qualifier.configurations.configuration import ( ParticipantID, SequenceViewConfiguration, + TestConfiguration, ) from monitoring.uss_qualifier.reports import jinja_env from monitoring.uss_qualifier.reports.report import ( @@ -20,6 +21,9 @@ PassedCheck, FailedCheck, ) +from monitoring.uss_qualifier.reports.tested_requirements import ( + compute_test_run_information, +) from monitoring.uss_qualifier.scenarios.definitions import TestScenarioTypeName @@ -482,6 +486,8 @@ def generate_sequence_view( with open(overview_file, "w") as f: f.write( template.render( + report=report, + test_run=compute_test_run_information(report), overview_rows=overview_rows, max_suite_cols=max_suite_cols, all_participants=all_participants, diff --git a/monitoring/uss_qualifier/reports/templates/sequence_view/overview.html b/monitoring/uss_qualifier/reports/templates/sequence_view/overview.html index 963cda2fc5..5aeddf19ec 100644 --- a/monitoring/uss_qualifier/reports/templates/sequence_view/overview.html +++ b/monitoring/uss_qualifier/reports/templates/sequence_view/overview.html @@ -1,5 +1,8 @@ - + +{% from "explorer.html" import explorer_header, explorer_content, explorer_footer %} + + TR-{{ test_run.test_run_id[0:7] }} sequence view + {{ explorer_header() }} +{% set collapsible = namespace(queries=[]) %} + +

Sequence view of uss_qualifier test run

+ +
+

Test run

+
+ + + + + + + + + + {% if test_run.start_time %} + + + + + {% endif %} + {% if test_run.end_time %} + + + + + {% endif %} + + + + + + + + + + + + + + + + +
Test characteristicValue
Test run identifierTR-{{ test_run.test_run_id[0:7] }}
Start time{{ test_run.start_time }}
End time{{ test_run.end_time }}
Test baseline identifierTB-{{ test_run.baseline[0:7] }}
Environment identifierTE-{{ test_run.environment[0:7] }}
Codebase version{{ report.codebase_version }}
Commit hash{{ report.commit_hash }}
+
+
+ +
+

Configuration

+
+ {% for is_baseline in (True, False) %} +

{{ "Baseline" if is_baseline else "Environment" }}

+
    + {% set current = namespace(address="v1.test_run.resources.resource_declarations") %} + {% for resource_id, resource_dec in report.configuration.resources.resource_declarations.items() %} + {% set current.address = current.address + "." + resource_id %} + {% if (current.address in report.configuration.non_baseline_inputs) != is_baseline %} +
  • {{ resource_id }} ({{ resource_dec.resource_type }}) +
      + {% if resource_dec.dependencies %} + {% for local_name, source_name in resource_dec.dependencies.items() %} +
    • {{ local_name }}: From {{ source_name }} resource
    • + {% endfor %} + {% endif %} +
    • Specification: + {% set spec_id = "specification_" + resource_id %} + {{ explorer_content(spec_id, resource_dec.specification) }} + {% set collapsible.queries = collapsible.queries + [spec_id] %} +
    • +
    +
  • + {% endif %} + {% set current.address = ".".join(current.address.split(".")[0:-1]) %} + {% endfor %} +
+ {% endfor %} +
+
+
+

Scenarios executed

{% if max_suite_cols > 0 %} @@ -78,7 +163,7 @@ {% if suite_cell.node != None %} {% else %} - + {% endif %} {% endif %} {% endfor %} @@ -100,5 +185,9 @@ {% endfor %}
{{ suite_cell.node.name }}
+{{ explorer_footer(collapsible.queries) }} + diff --git a/monitoring/uss_qualifier/reports/tested_requirements.py b/monitoring/uss_qualifier/reports/tested_requirements.py index 6749d2f4ae..96879be6ac 100644 --- a/monitoring/uss_qualifier/reports/tested_requirements.py +++ b/monitoring/uss_qualifier/reports/tested_requirements.py @@ -245,12 +245,12 @@ def generate_tested_requirements( participant_id=participant_id, other_participants=other_participants, breakdown=participant_breakdown, - test_run=_compute_test_run_information(report), + test_run=compute_test_run_information(report), ) ) -def _compute_test_run_information(report: TestRunReport) -> TestRunInformation: +def compute_test_run_information(report: TestRunReport) -> TestRunInformation: def print_datetime(t: Optional[StringBasedDateTime]) -> Optional[str]: if t is None: return None