Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: ArdupilotManager: skip some tests on MacOS #2228

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,4 +1,5 @@
import os
import platform

import pytest

Expand Down Expand Up @@ -47,6 +48,9 @@ def test_firmware_download() -> None:

assert firmware_download.download(Vehicle.Sub, Platform.SITL), "Failed to download SITL."

# skipt these tests for MacOS
if platform.system() == "Darwin":
pytest.skip("Skipping test for MacOS")
# It'll fail if running in an arch different of ARM
if "x86" in os.uname().machine:
assert firmware_download.download(Vehicle.Sub, Platform.Navigator), "Failed to download navigator binary."
Expand Down
17 changes: 11 additions & 6 deletions core/services/ardupilot_manager/firmware/test_FirmwareInstall.py
@@ -1,4 +1,5 @@
import pathlib
import platform

import pytest

Expand All @@ -19,16 +20,20 @@ def test_firmware_validation() -> None:
temporary_file = downloader.download(Vehicle.Sub, Platform.Pixhawk4)
installer.validate_firmware(temporary_file, Platform.Pixhawk4)

# New SITL firmwares should always work
temporary_file = downloader.download(Vehicle.Sub, Platform.SITL, version="DEV")
installer.validate_firmware(temporary_file, Platform.SITL)
# New SITL firmwares should always work, except for MacOS
# there are no SITL builds for MacOS
if platform.system() != "Darwin":
temporary_file = downloader.download(Vehicle.Sub, Platform.SITL, version="DEV")
installer.validate_firmware(temporary_file, Platform.SITL)

# Raise when validating Navigator firmwares (as test platform is x86)
temporary_file = downloader.download(Vehicle.Sub, Platform.Navigator)
with pytest.raises(InvalidFirmwareFile):
installer.validate_firmware(temporary_file, Platform.Navigator)

# Install SITL firmware
temporary_file = downloader.download(Vehicle.Sub, Platform.SITL, version="DEV")
board = FlightController(name="SITL", manufacturer="ArduPilot Team", platform=Platform.SITL)
installer.install_firmware(temporary_file, board, pathlib.Path(f"{temporary_file}_dest"))
if platform.system() != "Darwin":
# there are no SITL builds for MacOS
temporary_file = downloader.download(Vehicle.Sub, Platform.SITL, version="DEV")
board = FlightController(name="SITL", manufacturer="ArduPilot Team", platform=Platform.SITL)
installer.install_firmware(temporary_file, board, pathlib.Path(f"{temporary_file}_dest"))