forked from interuss/dss
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[uss_qualifier] Add tested requirements table generator (interuss#865)
* Add tested requirements table generator * Ignore only files in uss_qualifier root, add missing file * Add configuration for out-of-Docker local_test * Fix always-successful check evaluation * Trivial change to force CI rerun * Add table content note
- Loading branch information
1 parent
9a4c078
commit 8709b45
Showing
15 changed files
with
455 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
config_run_locally.json | ||
config_test_fully_mocked_local_system.json | ||
report*.json | ||
/config_run_locally.json | ||
/config_test_fully_mocked_local_system.json | ||
/report*.json | ||
client_secret.json | ||
/tested_requirements.html | ||
/report.gv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
monitoring/uss_qualifier/configurations/dev/non_docker/local_test.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"resources": { | ||
"resource_declarations": { | ||
"$ref": "resources.yaml#/all" | ||
} | ||
}, | ||
"test_suite": { | ||
"suite_type": "suites.dev.local_test", | ||
"resources": { | ||
"adjacent_circular_flights_data": "adjacent_circular_flights_data", | ||
"adjacent_circular_storage_config": "adjacent_circular_storage_config", | ||
"kml_flights_data": "kml_flights_data", | ||
"kml_storage_config": "kml_storage_config", | ||
"service_providers": "netrid_service_providers", | ||
"observers": "netrid_observers", | ||
"evaluation_configuration": "netrid_observation_evaluation_configuration", | ||
"flight_planners": "flight_planners", | ||
"conflicting_flights": "conflicting_flights", | ||
"priority_preemption_flights": "priority_preemption_flights", | ||
"invalid_flight_auth_flights": "invalid_flight_auth_flights", | ||
"dss": "dss" | ||
} | ||
} | ||
} |
94 changes: 94 additions & 0 deletions
94
monitoring/uss_qualifier/configurations/dev/non_docker/resources.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
all: | ||
allOf: | ||
- $ref: '#/uspace' | ||
- $ref: '#/net_rid_sims' | ||
|
||
uspace: | ||
allOf: | ||
- $ref: '#/net_rid' | ||
- $ref: '#/flight_auth' | ||
|
||
net_rid: | ||
$ref: '#/common' | ||
netrid_service_providers: | ||
resource_type: resources.netrid.NetRIDServiceProviders | ||
dependencies: | ||
auth_adapter: utm_auth | ||
specification: | ||
service_providers: | ||
- participant_id: uss1 | ||
injection_base_url: http://localhost:8071/ridsp/injection | ||
netrid_observers: | ||
resource_type: resources.netrid.NetRIDObserversResource | ||
dependencies: | ||
auth_adapter: utm_auth | ||
specification: | ||
observers: | ||
- participant_id: uss2 | ||
observation_base_url: http://localhost:8073/riddp/observation | ||
netrid_observation_evaluation_configuration: | ||
resource_type: resources.netrid.EvaluationConfigurationResource | ||
specification: {} | ||
|
||
net_rid_sims: | ||
adjacent_circular_flights_data: | ||
resource_type: resources.netrid.FlightDataResource | ||
specification: | ||
adjacent_circular_flights_simulation_source: {} | ||
adjacent_circular_storage_config: | ||
resource_type: resources.netrid.FlightDataStorageResource | ||
specification: | ||
flight_record_collection_path: "./test_data/che/netrid/circular_flights.json" | ||
kml_flights_data: | ||
resource_type: resources.netrid.FlightDataResource | ||
specification: | ||
kml_source: | ||
kml_location: file://./test_data/usa/netrid/dcdemo.kml | ||
kml_storage_config: | ||
resource_type: resources.netrid.FlightDataStorageResource | ||
specification: | ||
flight_record_collection_path: "./test_data/usa/netrid/dcdemo_flights.json" | ||
|
||
flight_auth: | ||
$ref: '#/f3548' | ||
invalid_flight_auth_flights: | ||
resource_type: resources.flight_planning.FlightIntentsResource | ||
specification: | ||
planning_time: '0:05:00' | ||
file_source: file://./test_data/che/flight_intents/invalid_flight_auths.json | ||
|
||
f3548: | ||
$ref: '#/common' | ||
flight_planners: | ||
resource_type: resources.flight_planning.FlightPlannersResource | ||
dependencies: | ||
auth_adapter: utm_auth | ||
specification: | ||
flight_planners: | ||
- participant_id: uss1 | ||
injection_base_url: http://localhost:8074/scdsc | ||
- participant_id: uss2 | ||
injection_base_url: http://localhost:8074/scdsc | ||
conflicting_flights: | ||
resource_type: resources.flight_planning.FlightIntentsResource | ||
specification: | ||
planning_time: '0:05:00' | ||
file_source: file://./test_data/che/flight_intents/conflicting_flights.json | ||
priority_preemption_flights: | ||
resource_type: resources.flight_planning.FlightIntentsResource | ||
specification: | ||
planning_time: '0:05:00' | ||
file_source: test_data.che.flight_intents.priority_preemption | ||
dss: | ||
resource_type: resources.astm.f3548.v21.DSSInstanceResource | ||
dependencies: | ||
auth_adapter: utm_auth | ||
specification: | ||
participant_id: uss1 | ||
base_url: http://localhost:8082 | ||
|
||
common: | ||
utm_auth: | ||
resource_type: resources.communications.AuthAdapterResource | ||
specification: | ||
environment_variable_containing_auth_spec: AUTH_SPEC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from typing import List | ||
|
||
from jinja2 import Environment, PackageLoader | ||
|
||
from monitoring.uss_qualifier.reports.report import ParticipantID | ||
from monitoring.uss_qualifier.scenarios.documentation.requirements import Requirement | ||
|
||
|
||
def _all_participants(requirements: List[Requirement]) -> List[ParticipantID]: | ||
participants = set() | ||
for requirement in requirements: | ||
for participant_id in requirement.participant_performance: | ||
participants.add(participant_id) | ||
result = list(participants) | ||
result.sort() | ||
return result | ||
|
||
|
||
def render_requirement_table(requirements: List[Requirement]) -> str: | ||
all_participants = _all_participants(requirements) | ||
rows = [["Requirement"] + all_participants] | ||
for requirement in requirements: | ||
cols = [requirement.requirement_id] | ||
for participant in all_participants: | ||
performance = requirement.participant_performance.get(participant, None) | ||
if performance is None: | ||
cols.append("") | ||
else: | ||
n_total = len(performance.successes) + len(performance.failures) | ||
percentage_successful = 100 * len(performance.successes) / n_total | ||
cols.append("{:.0f}%".format(percentage_successful)) | ||
rows.append(cols) | ||
|
||
env = Environment(loader=PackageLoader(__name__)) | ||
template = env.get_template("tested_requirements.html") | ||
return template.render(rows=rows) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
monitoring/uss_qualifier/reports/templates/tested_requirements.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<html> | ||
<body> | ||
Note: Only requirements that were tested appear in the table below. If checks are skipped or otherwise not performed, they may not appear below. | ||
<table> | ||
{% for row in rows %} | ||
<tr> | ||
{% for cell in row %} | ||
<td> | ||
{{ cell }} | ||
</td> | ||
{% endfor %} | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.