Skip ansible validation for non-ansible tests
The non-ansible test cases don't need to validate if ansible is installed correctly so skip that in this case. Also copying the ansible module overrides can be skipped in this case. This shaves off two seconds for each non-ansible test case and reduced the runtime of the full test suite locally from 420s to 320s. Change-Id: I9af3c932589ad10804ae0e8a9f2551e4fe35990e
This commit is contained in:
parent
fa0715eeac
commit
f6a923caa6
|
@ -66,6 +66,7 @@ import zuul.driver.sql
|
|||
import zuul.scheduler
|
||||
import zuul.executor.server
|
||||
import zuul.executor.client
|
||||
import zuul.lib.ansible
|
||||
import zuul.lib.connections
|
||||
import zuul.merger.client
|
||||
import zuul.merger.merger
|
||||
|
@ -150,6 +151,15 @@ def never_capture():
|
|||
return decorator
|
||||
|
||||
|
||||
class FakeAnsibleManager(zuul.lib.ansible.AnsibleManager):
|
||||
|
||||
def validate(self):
|
||||
return True
|
||||
|
||||
def copyAnsibleFiles(self):
|
||||
pass
|
||||
|
||||
|
||||
class GerritChangeReference(git.Reference):
|
||||
_common_path_default = "refs/changes"
|
||||
_points_to_commits_only = True
|
||||
|
@ -1586,6 +1596,10 @@ class RecordingExecutorServer(zuul.executor.server.ExecutorServer):
|
|||
def __init__(self, *args, **kw):
|
||||
self._run_ansible = kw.pop('_run_ansible', False)
|
||||
self._test_root = kw.pop('_test_root', False)
|
||||
if self._run_ansible:
|
||||
self._ansible_manager_class = zuul.lib.ansible.AnsibleManager
|
||||
else:
|
||||
self._ansible_manager_class = FakeAnsibleManager
|
||||
super(RecordingExecutorServer, self).__init__(*args, **kw)
|
||||
self.hold_jobs_in_build = False
|
||||
self.lock = threading.Lock()
|
||||
|
|
|
@ -2192,6 +2192,7 @@ class ExecutorExecuteWorker(gear.TextWorker):
|
|||
|
||||
class ExecutorServer(object):
|
||||
log = logging.getLogger("zuul.ExecutorServer")
|
||||
_ansible_manager_class = AnsibleManager
|
||||
_job_class = AnsibleJob
|
||||
|
||||
def __init__(self, config, connections={}, jobdir_root=None,
|
||||
|
@ -2291,7 +2292,7 @@ class ExecutorServer(object):
|
|||
self.config, 'executor', 'ansible_root', None)
|
||||
if not ansible_install_root:
|
||||
ansible_install_root = os.path.join(state_dir, 'ansible-bin')
|
||||
self.ansible_manager = AnsibleManager(
|
||||
self.ansible_manager = self._ansible_manager_class(
|
||||
ansible_dir, runtime_install_path=ansible_install_root)
|
||||
if not self.ansible_manager.validate():
|
||||
if not manage_ansible:
|
||||
|
|
Loading…
Reference in New Issue