Add PX4 SITL integration wiring, scenario acceptance suite, and CI gate#15
Closed
EdersenC wants to merge 2 commits into
Closed
Add PX4 SITL integration wiring, scenario acceptance suite, and CI gate#15EdersenC wants to merge 2 commits into
EdersenC wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new PX4 SITL integration surface, deterministic SITL scenario tests, a runner script, and a GitHub Actions gate for SITL artifacts and test execution.
Changes:
- Added integration wiring and a scenario harness/result contract under
drone_toolkit.app. - Added a PX4 SITL shell runner with smoke/run modes and artifact output.
- Added SITL scenario tests and a CI workflow to run smoke plus pytest scenarios.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/sitl.yml |
Adds the PX4 SITL Gate workflow. |
scripts/sitl/run_px4_sitl.sh |
Adds SITL smoke/run script and artifact generation. |
src/drone_toolkit/app/integration_wiring.py |
Adds integration bundle construction and SITL scenario harness/result schema. |
tests/sitl/test_failsafe_geofence_breach.py |
Adds deterministic geofence failsafe scenario test. |
tests/sitl/test_failsafe_link_loss.py |
Adds deterministic link-loss failsafe scenario test. |
tests/sitl/test_failsafe_low_battery.py |
Adds deterministic low-battery failsafe scenario test. |
tests/sitl/test_nominal_waypoint_mission.py |
Adds deterministic nominal waypoint scenario test. |
tests/sitl/test_operator_abort.py |
Adds deterministic operator-abort scenario test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+56
to
+61
| try: | ||
| resolved = _import_symbol(candidate) | ||
| if callable(resolved): | ||
| return resolved(**constructor_kwargs) | ||
| return resolved | ||
| except Exception as err: # pragma: no cover - compatibility shim |
Comment on lines
+113
to
+117
| try: | ||
| cli = cli_factory(runtime=mission_runtime, vehicle_port=vehicle_port, **cli_cfg) | ||
| except Exception: | ||
| # CLI may be optional for scenario-only execution. | ||
| cli = None |
Comment on lines
+151
to
+154
| integration_factory: Callable[..., IntegrationBundle] = build_integration, | ||
| ) -> None: | ||
| self.artifact_dir = Path(artifact_dir) | ||
| self.integration_factory = integration_factory |
Comment on lines
+181
to
+183
| raw_events = list(runtime_event_sequence or []) | ||
| failsafe_events = [_event_to_dict(event) for event in raw_events] | ||
| observed_event_kinds = {_extract_event_kind(event) for event in failsafe_events} |
Comment on lines
+209
to
+210
| trace_path = self.artifact_dir / f"{scenario_id}.trace.json" | ||
| trace_path.write_text(json.dumps(trace, indent=2, sort_keys=True), encoding="utf-8") |
Comment on lines
+223
to
+225
| result_path = self.artifact_dir / f"{scenario_id}.result.json" | ||
| result_path.write_text( | ||
| json.dumps(asdict(result), indent=2, sort_keys=True), |
| import importlib | ||
| import json | ||
| from pathlib import Path | ||
| from typing import Any, Callable, Dict, Iterable, List, Optional, Sequence, Tuple |
Comment on lines
+33
to
+43
| --scenario) | ||
| SCENARIO_ID="$2" | ||
| shift 2 | ||
| ;; | ||
| --artifacts-dir) | ||
| ARTIFACTS_DIR="$2" | ||
| shift 2 | ||
| ;; | ||
| --timeout) | ||
| TIMEOUT_SECONDS="$2" | ||
| shift 2 |
| ;; | ||
| esac | ||
| done | ||
|
|
Comment on lines
+64
to
+73
| cat > "${RESULT_JSON}" <<EOF | ||
| { | ||
| "scenario_id": "${SCENARIO_ID}", | ||
| "mode": "${MODE}", | ||
| "status": "${status}", | ||
| "details": "${details}", | ||
| "log_path": "${RUN_LOG}" | ||
| } | ||
| EOF | ||
| } |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
What changed
Verification
Risk / follow-up
Review focus
Diff summary
Impact graph
Comparison
No baseline comparison data provided.