Refactor tests to remove the falcontest decorator#1083
Conversation
There was a problem hiding this comment.
Pull request overview
Refactors the radio/tests suite to remove the falcon_test decorator and migrate setup/clients to pytest fixtures, aiming to simplify test invocation and reduce shared global state.
Changes:
- Removes
falcon_testusage across the test suite and switches tests to plain pytest functions using fixtures (notablydrone_status). - Introduces/expands session-scoped fixtures in
conftest.pyfor drone initialization and SocketIO testing. - Updates helper utilities (e.g.,
send_and_receive) to accept an explicitsocketio_clientinstead of importing a global.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| radio/tests/test_states.py | Drops decorator usage; updates to fixture-based drone_status and explicit socketio_client usage. |
| radio/tests/test_rc.py | Refactors to fixture-driven setup and removes decorator/type-only imports. |
| radio/tests/test_params.py | Removes decorator; shifts parameter injection to use drone_status. |
| radio/tests/test_motors.py | Removes decorator usage; simplifies test signatures. |
| radio/tests/test_motorController.py | Converts helper/test functions to use drone_status fixture. |
| radio/tests/test_mission.py | Refactors mission setup and tests to use drone_status fixture. |
| radio/tests/test_gripper.py | Refactors to explicit fixture usage and updated helper calls. |
| radio/tests/test_ftpController.py | Converts controller tests to use drone_status fixture. |
| radio/tests/test_ftp.py | Refactors FTP endpoint tests to use drone_status fixture. |
| radio/tests/test_frames.py | Removes decorator usage; updates tests to use drone_status. |
| radio/tests/test_flightMode.py | Refactors flight mode tests and setup to use drone_status fixture. |
| radio/tests/test_connections.py | Removes decorator usage; comments out reconnection fixture and skips disconnect test. |
| radio/tests/test_comPorts.py | Refactors to explicit socketio_client usage; skips several connection tests and comments out reconnection fixture. |
| radio/tests/test_autopilot.py | Removes decorator and type-only imports; keeps socketio-based reboot test. |
| radio/tests/test_arm.py | Refactors arm/disarm tests and fixtures to use drone_status. |
| radio/tests/test_FlightModesController.py | Converts controller-level tests and module teardown to use drone_status. |
| radio/tests/helpers.py | Changes send_and_receive to take socketio_client explicitly; removes global client import. |
| radio/tests/conftest.py | Adds session fixtures for drone_status, app creation, and socketio_client; updates autouse aircraft-type skipping. |
| radio/tests/init.py | Removes global client/decorator utilities; retains SocketIO event ignores with typed no-op handlers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f899db0 to
191cf2d
Compare
…tatus-decoraters-in-falcon_test-decorator-in-pytest
There was a problem hiding this comment.
Pull request overview
Refactors the Radio backend pytest suite to remove the falcon_test decorator in favor of fixtures, while also adjusting SITL location/mission serialization outputs to stabilize mission-related golden files.
Changes:
- Removes
falcon_testand updates tests to usesocketio_client/droneStatuspytest fixtures. - Updates simulator home coordinates and refreshes mission golden files/data to match new serialized values.
- Adjusts mission item serialization to round altitude (
z) to reduce floating-point noise.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| sitl_setup/run.sh | Updates default SITL home lat/lon/alt used by the simulator. |
| radio/tests/test_states.py | Removes falcon_test usage; relies on fixtures instead. |
| radio/tests/test_rc.py | Removes falcon_test usage; relies on fixtures instead. |
| radio/tests/test_params.py | Removes falcon_test usage; relies on fixtures instead. |
| radio/tests/test_motors.py | Removes falcon_test usage; relies on fixtures instead. |
| radio/tests/test_motorController.py | Removes falcon_test usage and drops unused SocketIO client parameter. |
| radio/tests/test_mission.py | Removes falcon_test usage; relies on fixtures instead. |
| radio/tests/test_gripper.py | Removes falcon_test usage; relies on fixtures instead. |
| radio/tests/test_ftpController.py | Removes falcon_test usage and drops unused SocketIO client parameter. |
| radio/tests/test_ftp.py | Removes falcon_test usage; loosens read-file content assertion. |
| radio/tests/test_frames.py | Removes falcon_test usage; relies on fixtures instead. |
| radio/tests/test_flightMode.py | Removes falcon_test usage; relies on fixtures instead. |
| radio/tests/test_connections.py | Removes falcon_test usage; relies on fixtures instead. |
| radio/tests/test_autopilot.py | Removes falcon_test usage; relies on fixtures instead. |
| radio/tests/test_arm.py | Removes falcon_test usage; relies on fixtures instead. |
| radio/tests/test_FlightModesController.py | Removes falcon_test usage and drops unused SocketIO client parameter. |
| radio/tests/mission_test_files/test_writeCurrentMission_uploadMissionSuccess_data.json | Updates golden mission item values (x/y/z) to match new outputs. |
| radio/tests/mission_test_files/test_getCurrentMission_correctState_result.json | Updates golden mission item values (x/y/z) to match new outputs. |
| radio/tests/mission_test_files/test_getCurrentMission_correctMission_result.json | Updates golden mission item values (x/y/z) to match new outputs. |
| radio/tests/mission_test_files/exported_mission_check.txt | Updates exported mission golden file content (notably home WP altitude). |
| radio/tests/ftp_test_files/expected_locations.txt | Removes the previous golden file used for FTP read-file content comparison. |
| radio/tests/conftest.py | Introduces droneStatus / socketio_client fixtures and removes --fc physical-device path. |
| radio/tests/init.py | Removes falcon_test; retains module-level app/socketio client setup for tests. |
| radio/app/controllers/missionController.py | Adds _wp_to_dict and uses it to round z when serializing mission items. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…tatus-decoraters-in-falcon_test-decorator-in-pytest
No description provided.