diff --git "a/.github/workflows/crazylab-malm\303\266-experiment.yml" b/.github/workflows/crazylab-linux-experiment.yml similarity index 100% rename from ".github/workflows/crazylab-malm\303\266-experiment.yml" rename to .github/workflows/crazylab-linux-experiment.yml diff --git "a/.github/workflows/crazylab-malm\303\266.yml" b/.github/workflows/crazylab-linux.yml similarity index 100% rename from ".github/workflows/crazylab-malm\303\266.yml" rename to .github/workflows/crazylab-linux.yml diff --git a/.github/workflows/crazylab-mac.yml b/.github/workflows/crazylab-mac.yml new file mode 100644 index 0000000..09b1f5d --- /dev/null +++ b/.github/workflows/crazylab-mac.yml @@ -0,0 +1,45 @@ +name: Crazy Stab Lab Mac 🗡️ + +# Controls when the action will run. +on: + workflow_dispatch: + schedule: + - cron: '0 3 * * *' +jobs: + #TODO add flashing of crazyflies + checkout_sources: + runs-on: [self-hosted, macOS] + steps: + - name: Check out sources + uses: actions/checkout@v4 + + sanity_testsuite_on_mac: + needs: checkout_sources + runs-on: [self-hosted, macOS] + strategy: + matrix: + python_version: ["3.8","3.9", "3.10", "3.11"] + fail-fast: false + env: + CRAZY_SITE: crazylab-mac + PYTHON_VERSION: ${{ matrix.python_version }} + timeout-minutes: 120 + steps: + - name: Setup python environment + run: | + $(brew --prefix)/bin/python${PYTHON_VERSION} -m venv venv + source venv/bin/activate + + - name: Install pytest + run: venv/bin/pip install pytest + + - name: Install Crazyflie python library + run: venv/bin/pip install git+https://github.com/bitcraze/crazyflie-lib-python.git@master + + - name: Install requirements + run: | + venv/bin/pip install -r requirements.txt + - name: Run test suite + run: venv/bin/python -m pytest --verbose -m sanity tests/QA + + diff --git a/pytest.ini b/pytest.ini index c02d292..d52ae28 100644 --- a/pytest.ini +++ b/pytest.ini @@ -9,3 +9,4 @@ markers = requirements: other requirements that a test needs to run exclude_decks: decks that makes a test not runnable ignore: ignore a test + sanity: sanity tests diff --git a/tests/QA/test_log.py b/tests/QA/test_log.py index e0830ff..70d0f0a 100644 --- a/tests/QA/test_log.py +++ b/tests/QA/test_log.py @@ -23,6 +23,7 @@ class TestLogVariables: + @pytest.mark.sanity def test_log_async(self, test_setup: conftest.DeviceFixture): ''' Make sure we receive ~100 rows 1 second at 100Hz ''' requirement = conftest.get_requirement('logging.basic') @@ -127,6 +128,7 @@ def test_log_too_much_per_block(self, test_setup: conftest.DeviceFixture): with pytest.raises(AttributeError): test_setup.device.cf.log.add_config(config) + @pytest.mark.sanity @pytest.mark.exclude_decks('bcDWM1000','bcFlow', 'bcFlow2', 'lighthouse4') def test_log_stress(self, test_setup: conftest.DeviceFixture): ''' diff --git a/tests/QA/test_param.py b/tests/QA/test_param.py index 5431d37..fe8ff5f 100644 --- a/tests/QA/test_param.py +++ b/tests/QA/test_param.py @@ -26,6 +26,7 @@ class TestParameters: + @pytest.mark.sanity def test_param_ronly(self, test_setup: conftest.DeviceFixture): with ValidatedSyncCrazyflie(test_setup.device.link_uri) as scf: # Get a known (core) read-only parameter @@ -58,6 +59,7 @@ def test_param_extended_type(self, test_setup: conftest.DeviceFixture): assert not element.is_extended() assert not element.is_persistent() + @pytest.mark.sanity def test_param_persistent_store(self, test_setup: conftest.DeviceFixture): # Get a known persistent parameter param = "sound.effect" @@ -97,7 +99,8 @@ def store_cb(name, success): val = test_setup.device.cf.param.get_value(param) assert int(val) == value - + + @pytest.mark.sanity def test_param_persistent_clear(self, test_setup: conftest.DeviceFixture): assert test_setup.device.connect_sync() diff --git a/tests/QA/test_radio.py b/tests/QA/test_radio.py index 05c100a..809b41e 100644 --- a/tests/QA/test_radio.py +++ b/tests/QA/test_radio.py @@ -26,7 +26,7 @@ logger = logging.getLogger(__name__) - +@pytest.mark.sanity class TestRadio: def test_latency_small_packets(self, dev: conftest.BCDevice): requirement = conftest.get_requirement('radio.latencysmall')