Skip to content
Snippets Groups Projects
Commit 848c7184 authored by Drew Devereux's avatar Drew Devereux
Browse files

Merge branch 'faster-tests-without-fork' into 'master'

Fork new test processes sparingly

See merge request ska-telescope/ska-tango-base!52
parents 4f05222c 9f0132f8
Branches
Tags
No related merge requests found
...@@ -7,8 +7,7 @@ source = ska_tango_base ...@@ -7,8 +7,7 @@ source = ska_tango_base
[tool:pytest] [tool:pytest]
testpaths = tests testpaths = tests
addopts = --forked addopts = --verbose
--verbose
--json-report --json-report
--json-report-file=build/htmlcov/report.json --json-report-file=build/htmlcov/report.json
--cov-report term --cov-report term
......
...@@ -34,6 +34,10 @@ def tango_context(device_test_config): ...@@ -34,6 +34,10 @@ def tango_context(device_test_config):
yield tango_context yield tango_context
tango_context.stop() tango_context.stop()
def pytest_itemcollected(item):
"""Make Tango-related tests run in forked mode"""
if "tango_context" in item.fixturenames:
item.add_marker("forked")
@pytest.fixture(scope="function") @pytest.fixture(scope="function")
def initialize_device(tango_context): def initialize_device(tango_context):
......
...@@ -366,6 +366,7 @@ class TestCspSubElementMaster(object): ...@@ -366,6 +366,7 @@ class TestCspSubElementMaster(object):
# PROTECTED REGION END # // CspSubelementMaster.test_ReInitDevices_when_in_wrong_state # PROTECTED REGION END # // CspSubelementMaster.test_ReInitDevices_when_in_wrong_state
@pytest.mark.forked
def test_multiple_devices_in_same_process(): def test_multiple_devices_in_same_process():
# The order here is important - base class last, so that we can # The order here is important - base class last, so that we can
......
...@@ -410,6 +410,7 @@ class TestCspSubElementObsDevice(object): ...@@ -410,6 +410,7 @@ class TestCspSubElementObsDevice(object):
# PROTECTED REGION END # // CspSubelementObsDevice.test_Abort # PROTECTED REGION END # // CspSubelementObsDevice.test_Abort
@pytest.mark.forked
def test_multiple_devices_in_same_process(): def test_multiple_devices_in_same_process():
devices_info = ( devices_info = (
{"class": CspSubElementObsDevice, "devices": [{"name": "test/se/1"}]}, {"class": CspSubElementObsDevice, "devices": [{"name": "test/se/1"}]},
......
...@@ -159,6 +159,7 @@ class TestSKALogger(object): ...@@ -159,6 +159,7 @@ class TestSKALogger(object):
# PROTECTED REGION END # // SKALogger.test_testMode # PROTECTED REGION END # // SKALogger.test_testMode
@pytest.mark.forked
def test_SetLoggingLevel(): def test_SetLoggingLevel():
"""Test for SetLoggingLevel""" """Test for SetLoggingLevel"""
logging_level = int(tango.LogLevel.LOG_ERROR) logging_level = int(tango.LogLevel.LOG_ERROR)
......
...@@ -187,6 +187,7 @@ class TestSKAObsDevice(object): ...@@ -187,6 +187,7 @@ class TestSKAObsDevice(object):
# PROTECTED REGION END # // SKAObsDevice.test_testMode # PROTECTED REGION END # // SKAObsDevice.test_testMode
@pytest.mark.forked
def test_multiple_devices_in_same_process(): def test_multiple_devices_in_same_process():
# The order here is important - base class last, so that we can # The order here is important - base class last, so that we can
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment