Repository navigation
[uss_qualifier/conflict_equal_priority] Test conflicts with planned flight #1854
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
Open
the-glu
wants to merge
1
commit into
interuss:main
Choose a base branch
from
Orbitalize:fix_1836
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+162
−27
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -151,19 +151,59 @@ def __init__( | |
| ) | ||
|
|
||
| def run_planning_sequence(self, context: ExecutionContext): | ||
| self.begin_test_case("Attempt to plan flight into conflict") | ||
| self._attempt_plan_flight_conflict() | ||
| self.begin_test_case("Attempt to plan flight into conflict with planned flight") | ||
| self._attempt_plan_flight_conflict(activate_flight2=False) | ||
| self.end_test_case() | ||
|
|
||
| self.begin_test_case("Attempt to activate flight into conflict") | ||
| self.begin_test_case( | ||
| "Attempt to activate flight into conflict with planned flight" | ||
| ) | ||
| self._attempt_activate_flight_conflict() | ||
| self.end_test_case() | ||
|
|
||
| self.begin_test_case( | ||
| "Attempt to modify planned flight into conflict with planned flight" | ||
| ) | ||
| flight_1_oi_ref = self._attempt_modify_planned_flight_conflict() | ||
| self.end_test_case() | ||
|
|
||
| self.begin_test_case( | ||
| "Attempt to modify activated flight into conflict with planned flight" | ||
| ) | ||
| self._attempt_modify_activated_flight_conflict(flight_1_oi_ref) | ||
| if self.flight1_id is not None: | ||
| self.begin_test_step("Delete Flight 1c") | ||
| delete_flight( | ||
| self, | ||
| self.tested_uss, | ||
| self.flight1_id, | ||
| flight_planning_state=self.flight_planning_state, | ||
| ) | ||
| self.flight1_id = None | ||
| self.end_test_step() | ||
| self.end_test_case() | ||
|
|
||
| self.begin_test_case( | ||
| "Attempt to plan flight into conflict with activated flight" | ||
| ) | ||
| self._attempt_plan_flight_conflict(activate_flight2=True) | ||
| self.end_test_case() | ||
|
|
||
| self.begin_test_case( | ||
| "Attempt to activate flight into conflict with activated flight" | ||
| ) | ||
| self._attempt_activate_flight_conflict() | ||
| self.end_test_case() | ||
|
|
||
| self.begin_test_case("Attempt to modify planned flight into conflict") | ||
| self.begin_test_case( | ||
| "Attempt to modify planned flight into conflict with activated flight" | ||
| ) | ||
| flight_1_oi_ref = self._attempt_modify_planned_flight_conflict() | ||
| self.end_test_case() | ||
|
|
||
| self.begin_test_case("Attempt to modify activated flight into conflict") | ||
| self.begin_test_case( | ||
| "Attempt to modify activated flight into conflict with activated flight" | ||
| ) | ||
| flight_1_oi_ref = self._attempt_modify_activated_flight_conflict( | ||
| flight_1_oi_ref | ||
| ) | ||
|
|
@@ -173,7 +213,8 @@ def run_planning_sequence(self, context: ExecutionContext): | |
| self._modify_activated_flight_preexisting_conflict(flight_1_oi_ref) | ||
| self.end_test_case() | ||
|
|
||
| def _attempt_plan_flight_conflict(self): | ||
| def _attempt_plan_flight_conflict(self, activate_flight2: bool): | ||
|
|
||
| self.begin_test_step("Plan Flight 2") | ||
| flight2_planned = self.resolve_flight(self.equal_prio_flight2_planned) | ||
|
|
||
|
|
@@ -194,27 +235,28 @@ def _attempt_plan_flight_conflict(self): | |
| flight_2_oi_ref = validator.expect_shared(flight2_planned) | ||
| self.end_test_step() | ||
|
|
||
| self.begin_test_step("Activate Flight 2") | ||
| flight2_activated = self.resolve_flight(self.equal_prio_flight2_activated) | ||
| if activate_flight2: | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note to reviewers: the diff is strange but that only a tabulated block for the if. |
||
| self.begin_test_step("Activate Flight 2") | ||
| flight2_activated = self.resolve_flight(self.equal_prio_flight2_activated) | ||
|
|
||
| with OpIntentValidator( | ||
| self, | ||
| self.control_uss, | ||
| self.dss, | ||
| flight2_activated, | ||
| flight_2_oi_ref, | ||
| ) as validator: | ||
| _, _, as_planned = activate_flight( | ||
| with OpIntentValidator( | ||
| self, | ||
| self.control_uss, | ||
| self.dss, | ||
| flight2_activated, | ||
| self.flight2_id, | ||
| flight_planning_state=self.flight_planning_state, | ||
| ) | ||
| # TODO(#1326): Validate that flight as planned still allows this scenario to proceed | ||
| flight2_activated = as_planned | ||
| validator.expect_shared(flight2_activated) | ||
| self.end_test_step() | ||
| flight_2_oi_ref, | ||
| ) as validator: | ||
| _, _, as_planned = activate_flight( | ||
| self, | ||
| self.control_uss, | ||
| flight2_activated, | ||
| self.flight2_id, | ||
| flight_planning_state=self.flight_planning_state, | ||
| ) | ||
| # TODO(#1326): Validate that flight as planned still allows this scenario to proceed | ||
| flight2_activated = as_planned | ||
| validator.expect_shared(flight2_activated) | ||
| self.end_test_step() | ||
|
|
||
| self.begin_test_step("Attempt to plan Flight 1") | ||
| flight1_planned = self.resolve_flight(self.flight1_planned) | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of the subtle distinctions between different cases/steps are hard to keep track of or understand, so I think the accuracy of the pictures is very important. The convention for the pictures is that a planned/Accepted flight is colored gray while an Activated flight is colored green. So, most of the pictures in the additions of this PR should be new ones with Flight 2 as gray.