Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check whether includes_advisories exists before accessing #438

Closed
BenjaminPelletier opened this issue Dec 21, 2023 · 0 comments · Fixed by #439
Closed

Check whether includes_advisories exists before accessing #438

BenjaminPelletier opened this issue Dec 21, 2023 · 0 comments · Fixed by #439
Labels
automated-testing Related to automated testing tools bug Something isn't working P0 Highest priority; blocking usage or development

Comments

@BenjaminPelletier
Copy link
Member

report.json is not attached because
Relevant stacktrace:

Traceback (most recent call last):
  File "/app/monitoring/monitoring/uss_qualifier/suites/suite.py", line 150, in _run_test_scenario
    scenario.run(context)
  File "/app/monitoring/monitoring/uss_qualifier/scenarios/astm/utm/nominal_planning/conflict_equal_priority_not_permitted/conflict_equal_priority_not_permitted.py", line 186, in run
    _ = self._attempt_plan_flight_conflict()
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/monitoring/monitoring/uss_qualifier/scenarios/astm/utm/nominal_planning/conflict_equal_priority_not_permitted/conflict_equal_priority_not_permitted.py", line 210, in _attempt_plan_flight_conflict
    with OpIntentValidator(
  File "/app/monitoring/monitoring/uss_qualifier/scenarios/astm/utm/test_steps.py", line 93, in __exit__
    raise exc_val
  File "/app/monitoring/monitoring/uss_qualifier/scenarios/astm/utm/nominal_planning/conflict_equal_priority_not_permitted/conflict_equal_priority_not_permitted.py", line 218, in _attempt_plan_flight_conflict
    _, self.flight2_id, _ = plan_flight_intent(
                            ^^^^^^^^^^^^^^^^^^^
  File "/app/monitoring/monitoring/uss_qualifier/scenarios/flight_planning/test_steps.py", line 67, in plan_flight_intent
    resp, flight_id, advisories = submit_flight_intent(
                                  ^^^^^^^^^^^^^^^^^^^^^
  File "/app/monitoring/monitoring/uss_qualifier/scenarios/flight_planning/test_steps.py", line 247, in submit_flight_intent
    resp, query, flight_id, advisories = flight_planner.request_flight(
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/monitoring/monitoring/uss_qualifier/resources/flight_planning/flight_planner.py", line 172, in request_flight
    resp = self.client.try_plan_flight(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/monitoring/monitoring/monitorlib/clients/flight_planning/client_v1.py", line 107, in try_plan_flight
    return self._inject(
           ^^^^^^^^^^^^^
  File "/app/monitoring/monitoring/monitorlib/clients/flight_planning/client_v1.py", line 96, in _inject
    includes_advisories=resp.includes_advisories,
                        ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/uss_qualifier_venv/lib/python3.11/site-packages/implicitdict/__init__.py", line 155, in __getattribute__
    return self[item]
           ~~~~^^^^^^
KeyError: 'includes_advisories'

Test check
N/A; uss_qualifier crashes

Difference from expected behavior
includes_advisories is an optional field in the flight_planning API and is rendered to an Optional field in the API object, but #422 accesses the field without checking if it is present. We need to check if the field is present before accessing it.

@BenjaminPelletier BenjaminPelletier added bug Something isn't working automated-testing Related to automated testing tools P0 Highest priority; blocking usage or development labels Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automated-testing Related to automated testing tools bug Something isn't working P0 Highest priority; blocking usage or development
Projects
None yet
1 participant