diff options
author | Scott Murray <scott.murray@konsulko.com> | 2020-09-30 19:06:09 -0400 |
---|---|---|
committer | Scott Murray <scott.murray@konsulko.com> | 2020-09-30 19:29:56 -0400 |
commit | 5a66db32dbe49579595ce865f8fbe7ed6a6d92de (patch) | |
tree | 1b1780ff0d20acc05c333c59a18c843bd409ebe6 | |
parent | 30e59542153b567bb44bd36c3fb21d4e6fef5f83 (diff) |
Skip signal composer tests by default
Fix signal composer test markings (there were accidentally marked
as can_low_level), and add logic to skip them by default for now due
to SPEC-3615. They can be enabled by passing --run-signal-composer
to pytest. Once SPEC-3615 is resolved, this can be removed or the
default changed to not skipping.
Bug-AGL: SPEC-3585
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Change-Id: Ie64d2868d90bdd242b762c7ad35cac1be11677e6
-rw-r--r-- | pyagl/conftest.py | 10 | ||||
-rw-r--r-- | pyagl/tests/test_signal_composer.py | 6 |
2 files changed, 13 insertions, 3 deletions
diff --git a/pyagl/conftest.py b/pyagl/conftest.py index dd4dc31..0d470d6 100644 --- a/pyagl/conftest.py +++ b/pyagl/conftest.py @@ -37,6 +37,9 @@ class LavaAction(argparse.Action): def pytest_addoption(parser): parser.addoption('-L', '--lava', action=LavaAction, help='enable LAVA signals') + # Hook to allow not skipping signal-composer tests for debugging + parser.addoption('--run-signal-composer', action='store_true', default=False, help='run signal-composer tests') + def pytest_configure(config): # Force normal progress and verbose output off when doing LAVA output @@ -145,3 +148,10 @@ def pytest_collection_modifyitems(config, items): for item in items: if "can_j1939" in item.keywords: item.add_marker(skip_j1939) + + # For now, skip signal-composer tests if not explicitly enabled + if not config.getoption("--run-signal-composer"): + skip_signal_composer = pytest.mark.skip(reason="need --run-signal-composer option to run") + for item in items: + if "signal_composer" in item.keywords: + item.add_marker(skip_signal_composer) diff --git a/pyagl/tests/test_signal_composer.py b/pyagl/tests/test_signal_composer.py index dfc002b..19847a6 100644 --- a/pyagl/tests/test_signal_composer.py +++ b/pyagl/tests/test_signal_composer.py @@ -22,7 +22,7 @@ from pyagl.services.base import AFBResponse, AFBT from pyagl.services.signal_composer import SignalComposerService as scs -pytestmark = [pytest.mark.asyncio, pytest.mark.can_low_level] +pytestmark = [pytest.mark.asyncio, pytest.mark.signal_composer] @pytest.fixture(scope='module') @@ -40,7 +40,7 @@ async def service(): await ns.websocket.close() -@pytest.mark.dependency +@pytest.mark.dependency() async def test_list(event_loop, service: scs): msgid = await service.list() resp = await service.afbresponse() @@ -56,7 +56,6 @@ async def test_getNoFilter(event_loop, service: scs): @pytest.mark.dependency(depends=['test_list']) -@pytest.mark.xfail(reason='on first boot enumerating through all signals causes the service to crash, restarting it fixes it') async def test_getAllSignals(event_loop, service: scs): msgid = await service.list() resp = await service.afbresponse() @@ -66,6 +65,7 @@ async def test_getAllSignals(event_loop, service: scs): resp = await service.afbresponse() assert resp.status == 'success', f'get() with signal {s} failed, info: {resp.info}' + # while rewriting the old lua tests this one tries to 'get' 'odometer' signal but its not currently present # async def test_getFilterAvg(event_loop, service: scs): # msgid = await service.get({'signal': 'odometer', 'options': {'average': 10}}) |