Skip to content

Commit

Permalink
core: ArdupilotManager: skip some tests on MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Williangalvani authored and patrickelectric committed Mar 28, 2024
1 parent 1758759 commit 009a995
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
@@ -1,4 +1,5 @@
import os
import platform

import pytest

Expand Down Expand Up @@ -48,6 +49,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"))

0 comments on commit 009a995

Please sign in to comment.