Recovery - #1941
Open
amilcarlucas wants to merge 1 commit into
Open
GitHub Actions / Test Results
failed
Aug 28, 2026 in 0s
3 fail, 7 skipped, 4 854 pass in 45m 58s
Annotations
github-actions / Test Results
All 4 runs failed: test_model_raises_error_with_empty_layouts (tests.plugins.test_data_model_motor_test.TestMotorTestDataModelJSONLoading)
artifacts/coverage-macos-latest-3.14-xml/results-junit.xml [took 0s]
artifacts/coverage-ubuntu-latest-3.10-xml/results-junit.xml [took 0s]
artifacts/coverage-ubuntu-latest-3.14-xml/results-junit.xml [took 0s]
artifacts/coverage-windows-latest-3.14-xml/results-junit.xml [took 0s]
Raw output
Failed: DID NOT RAISE RuntimeError
self = <plugins.test_data_model_motor_test.TestMotorTestDataModelJSONLoading object at 0x00000205D99A2FD0>
mock_flight_controller = <MagicMock spec='FlightController' id='2222720241008'>
mock_filesystem = <MagicMock id='2222720247728'>
def test_model_raises_error_with_empty_layouts(self, mock_flight_controller, mock_filesystem) -> None:
"""
Model raises RuntimeError when no matching frame layout is found.
GIVEN: JSON data loads successfully but contains no matching frame layouts
WHEN: User initializes the motor test data model
THEN: Model should raise RuntimeError about missing frame configuration
"""
# Arrange: Mock JSON loading with empty layouts
mock_flight_controller.get_frame_info.return_value = (1, 1) # QUAD_X frame
with patch(
"ardupilot_methodic_configurator.plugins.data_model_motor_test.FilesystemJSONWithSchema"
) as mock_json_class:
mock_loader = MagicMock()
mock_loader.load_json_data.return_value = {"layouts": []}
mock_loader.data = mock_loader.load_json_data.return_value
mock_json_class.return_value = mock_loader
# Act & Assert: Initialize model should raise RuntimeError
> with pytest.raises(RuntimeError, match="No motor configuration found for frame class 1 and type 1"):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E Failed: DID NOT RAISE RuntimeError
tests\plugins\test_data_model_motor_test.py:1699: Failed
github-actions / Test Results
All 4 runs failed: test_model_handles_json_loading_failure_gracefully (tests.plugins.test_data_model_motor_test.TestMotorTestDataModelJSONLoading)
artifacts/coverage-macos-latest-3.14-xml/results-junit.xml [took 0s]
artifacts/coverage-ubuntu-latest-3.10-xml/results-junit.xml [took 0s]
artifacts/coverage-ubuntu-latest-3.14-xml/results-junit.xml [took 0s]
artifacts/coverage-windows-latest-3.14-xml/results-junit.xml [took 0s]
Raw output
Failed: DID NOT RAISE RuntimeError
self = <plugins.test_data_model_motor_test.TestMotorTestDataModelJSONLoading object at 0x00000205D9963790>
mock_flight_controller = <MagicMock spec='FlightController' id='2222720243696'>
mock_filesystem = <MagicMock id='2222715155328'>
def test_model_handles_json_loading_failure_gracefully(self, mock_flight_controller, mock_filesystem) -> None:
"""
Model raises RuntimeError when JSON loading fails.
GIVEN: JSON loading fails due to file or validation errors
WHEN: User initializes the motor test data model
THEN: Model should raise RuntimeError since no frame configuration can be found
"""
# Arrange: Mock JSON loading failure
mock_flight_controller.get_frame_info.return_value = (1, 1) # QUAD_X frame
with patch(
"ardupilot_methodic_configurator.plugins.data_model_motor_test.FilesystemJSONWithSchema"
) as mock_json_class:
mock_loader = MagicMock()
mock_loader.load_json_data.side_effect = Exception("JSON loading failed")
mock_loader.data = None # When loading fails, data is None
mock_json_class.return_value = mock_loader
# Act & Assert: Initialize model should raise RuntimeError
> with pytest.raises(RuntimeError, match="No motor configuration found for frame class 1 and type 1"):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E Failed: DID NOT RAISE RuntimeError
tests\plugins\test_data_model_motor_test.py:1773: Failed
github-actions / Test Results
All 4 runs failed: test_model_handles_empty_json_response_appropriately (tests.plugins.test_data_model_motor_test.TestMotorTestDataModelJSONLoading)
artifacts/coverage-macos-latest-3.14-xml/results-junit.xml [took 0s]
artifacts/coverage-ubuntu-latest-3.10-xml/results-junit.xml [took 0s]
artifacts/coverage-ubuntu-latest-3.14-xml/results-junit.xml [took 0s]
artifacts/coverage-windows-latest-3.14-xml/results-junit.xml [took 0s]
Raw output
Failed: DID NOT RAISE RuntimeError
self = <plugins.test_data_model_motor_test.TestMotorTestDataModelJSONLoading object at 0x00000205D99638A0>
mock_flight_controller = <MagicMock spec='FlightController' id='2222720245712'>
mock_filesystem = <MagicMock id='2222707843360'>
def test_model_handles_empty_json_response_appropriately(self, mock_flight_controller, mock_filesystem) -> None:
"""
Model raises RuntimeError when JSON loading returns empty data.
GIVEN: JSON loading returns empty data structure
WHEN: User initializes the motor test data model
THEN: Model should raise RuntimeError since no frame configuration can be found
"""
# Arrange: Mock empty JSON response
mock_flight_controller.get_frame_info.return_value = (1, 1) # QUAD_X frame
with patch(
"ardupilot_methodic_configurator.plugins.data_model_motor_test.FilesystemJSONWithSchema"
) as mock_json_class:
mock_loader = MagicMock()
mock_loader.load_json_data.return_value = {}
mock_loader.data = {} # Empty data
mock_json_class.return_value = mock_loader
# Act & Assert: Initialize model should raise RuntimeError
> with pytest.raises(RuntimeError, match="No motor configuration found for frame class 1 and type 1"):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E Failed: DID NOT RAISE RuntimeError
tests\plugins\test_data_model_motor_test.py:1796: Failed
Loading