Merge "Allow running tests with multiple schedulers"
This commit is contained in:
commit
8c2f12cbeb
|
@ -130,6 +130,7 @@ import tests.fakegitlab
|
||||||
FIXTURE_DIR = os.path.join(os.path.dirname(__file__), 'fixtures')
|
FIXTURE_DIR = os.path.join(os.path.dirname(__file__), 'fixtures')
|
||||||
|
|
||||||
KEEP_TEMPDIRS = bool(os.environ.get('KEEP_TEMPDIRS', False))
|
KEEP_TEMPDIRS = bool(os.environ.get('KEEP_TEMPDIRS', False))
|
||||||
|
SCHEDULER_COUNT = int(os.environ.get('ZUUL_SCHEDULER_COUNT', 1))
|
||||||
|
|
||||||
|
|
||||||
def repack_repo(path):
|
def repack_repo(path):
|
||||||
|
@ -4498,6 +4499,7 @@ class ZuulTestCase(BaseTestCase):
|
||||||
git_url_with_auth: bool = False
|
git_url_with_auth: bool = False
|
||||||
log_console_port: int = 19885
|
log_console_port: int = 19885
|
||||||
validate_tenants = None
|
validate_tenants = None
|
||||||
|
scheduler_count = SCHEDULER_COUNT
|
||||||
|
|
||||||
def __getattr__(self, name):
|
def __getattr__(self, name):
|
||||||
"""Allows to access fake connections the old way, e.g., using
|
"""Allows to access fake connections the old way, e.g., using
|
||||||
|
@ -4675,7 +4677,8 @@ class ZuulTestCase(BaseTestCase):
|
||||||
self.builds = self.executor_server.running_builds
|
self.builds = self.executor_server.running_builds
|
||||||
|
|
||||||
self.scheds = SchedulerTestManager(self.validate_tenants)
|
self.scheds = SchedulerTestManager(self.validate_tenants)
|
||||||
self.createScheduler()
|
for _ in range(self.scheduler_count):
|
||||||
|
self.createScheduler()
|
||||||
|
|
||||||
self.merge_server = None
|
self.merge_server = None
|
||||||
|
|
||||||
|
|
|
@ -981,6 +981,7 @@ class TestTenantExtraConfigsInvalidValue(TenantParserTestCase):
|
||||||
|
|
||||||
class TestTenantDuplicate(TenantParserTestCase):
|
class TestTenantDuplicate(TenantParserTestCase):
|
||||||
tenant_config_file = 'config/tenant-parser/duplicate.yaml'
|
tenant_config_file = 'config/tenant-parser/duplicate.yaml'
|
||||||
|
scheduler_count = 1
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
with testtools.ExpectedException(Exception, 'Duplicate configuration'):
|
with testtools.ExpectedException(Exception, 'Duplicate configuration'):
|
||||||
|
|
Loading…
Reference in New Issue