Skip to content

Commit

Permalink
Merge pull request #41 from bitcraze/toverumar/addrunner
Browse files Browse the repository at this point in the history
Add a sanity test job running on mac
  • Loading branch information
ToveRumar authored Jul 10, 2024
2 parents 0f0eb50 + c6f621e commit e333f07
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 2 deletions.
File renamed without changes.
45 changes: 45 additions & 0 deletions .github/workflows/crazylab-mac.yml
Original file line number Diff line number Diff line change
@@ -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


1 change: 1 addition & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions tests/QA/test_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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):
'''
Expand Down
5 changes: 4 additions & 1 deletion tests/QA/test_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion tests/QA/test_radio.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit e333f07

Please sign in to comment.