Commit 65a30238 authored by Neil Williams's avatar Neil Williams 💬 Committed by Rémi Duraffort
Browse files

Fix Device.CONFIG_PATH for individual unit tests

When called individually, the TestYamlMultinode unit tests
were failing because these relied on a side-effect of the
other unit test classes. Move the configuration step to
the Factory.

Change-Id: Ida0d68228c3df7f8fac759fcaa1ca28e9a63abb2
parent fec9dfac
......@@ -51,6 +51,7 @@ class YamlFactory(ModelFactory):
def __init__(self):
super(YamlFactory, self).__init__()
Device.CONFIG_PATH = os.path.join(os.getcwd(), 'lava_scheduler_app', 'tests', 'devices')
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
logger = logging.getLogger('unittests')
logger.disabled = True
......@@ -141,7 +142,6 @@ class PipelineDeviceTags(TestCaseWithFactory):
self.assertEqual(TestJob.LOW, job.priority)
def test_yaml_device_tags(self):
Device.CONFIG_PATH = os.path.join(os.getcwd(), 'lava_scheduler_app', 'tests', 'devices')
tag_list = [
......@@ -547,7 +547,6 @@ class TestExtendsSubmit(TestCaseWithFactory):
def setUp(self):
super(TestExtendsSubmit, self).setUp()
Device.CONFIG_PATH = os.path.join(os.getcwd(), 'lava_scheduler_app', 'tests', 'devices')
Device.HEALTH_CHECK_PATH = os.path.join(os.getcwd(), 'lava_scheduler_app', 'tests', 'health-checks')
self.factory = YamlFactory()
self.device_type = self.factory.make_device_type(name='juno-r2')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment