Skip to content

Commit

Permalink
Merge pull request #46 from bitcraze/toverumar/remove_skipped_tests
Browse files Browse the repository at this point in the history
Add flowcontrol requirement so that tests that need it will not get generated for devices that do not have it
  • Loading branch information
ToveRumar authored Aug 12, 2024
2 parents fd1163c + 0d3f64e commit 9b7dcf2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
15 changes: 8 additions & 7 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ def pytest_generate_tests(metafunc):
has_properties = has_properties.args if has_properties else []
exclude_decks = exclude_decks.args if exclude_decks else []
devices = get_devices(has_decks,has_properties, exclude_decks)
if devices:
param_name = 'test_setup' if 'test_setup' in metafunc.fixturenames else 'dev'
metafunc.parametrize(param_name, devices, indirect=True if param_name == 'test_setup' else False, ids=lambda d: d.name)
else:
print(f'No devices found for test {metafunc.definition.name}')
metafunc.parametrize("test_setup", [pytest.param(None, marks=pytest.mark.ignore(reason="No device for test"))]) #This is a bit overly complicated but pytest.skip will skip all tests in module

for fixture in metafunc.fixturenames:
if fixture == 'request':
continue
if devices:
metafunc.parametrize(fixture, devices, indirect=(fixture=='test_setup') , ids=lambda d: d.name)
else:
print(f'No devices found for test {metafunc.definition.name}')
metafunc.parametrize(fixture, [pytest.param(None, marks=pytest.mark.ignore(reason="No device for test"))]) #This is a bit overly complicated but pytest.skip will skip all tests in modul

def pytest_collection_modifyitems(config, items):

Expand Down
7 changes: 4 additions & 3 deletions tests/QA/test_radio.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,18 @@ def test_latency_big_packets(self, dev: conftest.BCDevice):
requirement = conftest.get_requirement('radio.latencybig')
assert(latency(dev.link_uri, requirement['packet_size']) < requirement['limit_high_ms'])

@pytest.mark.skip(reason='This test does not pass reliably. We need flow control between nrf and stm32')
@pytest.mark.requirements("syslink_flowctrl")
def test_bandwidth_small_packets(self, dev: conftest.BCDevice):
requirement = conftest.get_requirement('radio.bwsmall')
assert(bandwidth(dev.link_uri, requirement['packet_size']) > requirement['limit_low'])

@pytest.mark.skip(reason='This test does not pass reliably. We need flow control between nrf and stm32')
@pytest.mark.requirements("syslink_flowctrl")
def test_bandwidth_big_packets(self, dev: conftest.BCDevice):
requirement = conftest.get_requirement('radio.bwbig')
assert(bandwidth(dev.link_uri, requirement['packet_size']) > requirement['limit_low'])

@pytest.mark.skip(reason='This test does not pass reliably. We need flow control between nrf and stm32')

@pytest.mark.requirements("syslink_flowctrl")
def test_reliability(self, dev: conftest.BCDevice):
requirement = conftest.get_requirement('radio.reliability')
# The bandwidth function will assert if there is any packet loss
Expand Down

0 comments on commit 9b7dcf2

Please sign in to comment.