Skip to content

Add parameter setting before tests#881

Merged
1Blademaster merged 3 commits intomainfrom
880-update-backend-tests-to-ensure-deterministic-behaviour
Nov 28, 2025
Merged

Add parameter setting before tests#881
1Blademaster merged 3 commits intomainfrom
880-update-backend-tests-to-ensure-deterministic-behaviour

Conversation

@1Blademaster
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings November 28, 2025 12:49
@1Blademaster 1Blademaster linked an issue Nov 28, 2025 that may be closed by this pull request
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

This PR adds parameter initialization setup to test files to ensure consistent test conditions. The changes include creating a new set_params helper function with robust retry logic and adding session-scoped fixtures to multiple test files to configure drone parameters before tests run.

  • Introduced set_params helper function with exponential backoff retry logic for setting drone parameters
  • Added session-scoped setup fixtures to 5 test files (test_rc, test_params, test_gripper, test_frames, test_flightMode) to initialize parameters
  • Updated test assertions and parameter values to match the new initialized state
  • Simplified the test_flightMode cleanup fixture to use pymavlink directly

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
radio/tests/helpers.py Added set_params function with retry logic and error handling for setting drone parameters
radio/tests/test_rc.py Added setup fixture to initialize RC parameters and updated test assertions to match new parameter values
radio/tests/test_params.py Added setup fixture to initialize test parameter and changed test parameter name from RC_11MAX to RANDOM_ERR_PARAM
radio/tests/test_gripper.py Added setup fixture to enable gripper parameter before tests
radio/tests/test_frames.py Added setup fixture to initialize frame type and class parameters
radio/tests/test_flightMode.py Added setup fixture for flight mode parameters, removed unused import, and simplified cleanup fixture
docs/DEVELOPMENT_GUIDE.md Added documentation for pytest -x flag to stop on first failure

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread radio/tests/test_params.py
Comment thread radio/tests/test_gripper.py
Comment thread radio/tests/test_frames.py
Comment thread radio/tests/test_flightMode.py
Comment thread radio/tests/test_rc.py
Copy link
Copy Markdown
Contributor

@Kwash67 Kwash67 left a comment

Choose a reason for hiding this comment

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

LGTM

@1Blademaster 1Blademaster merged commit 5383795 into main Nov 28, 2025
7 checks passed
@1Blademaster 1Blademaster deleted the 880-update-backend-tests-to-ensure-deterministic-behaviour branch November 28, 2025 20:41
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.

Update backend tests to ensure deterministic behaviour

3 participants