Skip to content

Refactor tests to remove the falcontest decorator#1083

Merged
1Blademaster merged 6 commits intomainfrom
999-can-remove-the-unneccessary-pass_drone_status-decoraters-in-falcon_test-decorator-in-pytest
Mar 16, 2026
Merged

Refactor tests to remove the falcontest decorator#1083
1Blademaster merged 6 commits intomainfrom
999-can-remove-the-unneccessary-pass_drone_status-decoraters-in-falcon_test-decorator-in-pytest

Conversation

@1Blademaster
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_test usage across the test suite and switches tests to plain pytest functions using fixtures (notably drone_status).
  • Introduces/expands session-scoped fixtures in conftest.py for drone initialization and SocketIO testing.
  • Updates helper utilities (e.g., send_and_receive) to accept an explicit socketio_client instead 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.

Comment thread radio/tests/test_connections.py Outdated
Comment thread radio/tests/test_comPorts.py Outdated
Comment thread radio/tests/test_comPorts.py Outdated
Comment thread radio/tests/conftest.py Outdated
Comment thread radio/tests/test_frames.py
Comment thread radio/tests/test_connections.py Outdated
Comment thread radio/tests/test_comPorts.py Outdated
Comment thread radio/tests/test_comPorts.py Outdated
Comment thread radio/tests/conftest.py Outdated
Comment thread radio/tests/test_gripper.py Outdated
@1Blademaster 1Blademaster force-pushed the 999-can-remove-the-unneccessary-pass_drone_status-decoraters-in-falcon_test-decorator-in-pytest branch from f899db0 to 191cf2d Compare March 16, 2026 18:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_test and updates tests to use socketio_client / droneStatus pytest 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.

Comment thread sitl_setup/run.sh
Comment thread radio/app/controllers/missionController.py
Comment thread radio/tests/test_ftp.py Outdated
Comment thread radio/tests/test_ftp.py
Comment thread radio/tests/conftest.py
@1Blademaster 1Blademaster merged commit 49d2cfa into main Mar 16, 2026
7 checks passed
@1Blademaster 1Blademaster deleted the 999-can-remove-the-unneccessary-pass_drone_status-decoraters-in-falcon_test-decorator-in-pytest branch March 16, 2026 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can remove the unneccessary "pass_drone_status" decoraters in falcon_test decorator in pytest

2 participants