mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Much streamlining around setup steps in playbooks, now only run setup once per play.
This commit is contained in:
@@ -30,12 +30,9 @@ class TestCallbacks(object):
|
||||
def on_start(self):
|
||||
EVENTS.append('start')
|
||||
|
||||
def on_setup_primary(self):
|
||||
def on_setup(self):
|
||||
EVENTS.append([ 'primary_setup' ])
|
||||
|
||||
def on_setup_secondary(self):
|
||||
EVENTS.append([ 'secondary_setup' ])
|
||||
|
||||
def on_skipped(self, host):
|
||||
EVENTS.append([ 'skipped', [ host ]])
|
||||
|
||||
@@ -86,12 +83,9 @@ class TestCallbacks(object):
|
||||
def on_unreachable(self, host, msg):
|
||||
EVENTS.append([ 'failed/dark', [ host, msg ]])
|
||||
|
||||
def on_setup_primary(self):
|
||||
def on_setup(self):
|
||||
pass
|
||||
|
||||
def on_setup_secondary(self):
|
||||
pass
|
||||
|
||||
def on_no_hosts(self):
|
||||
pass
|
||||
|
||||
@@ -158,7 +152,7 @@ class TestPlaybook(unittest.TestCase):
|
||||
"127.0.0.2": {
|
||||
"changed": 9,
|
||||
"failures": 0,
|
||||
"ok": 12,
|
||||
"ok": 11,
|
||||
"skipped": 1,
|
||||
"unreachable": 0
|
||||
}
|
||||
|
||||
@@ -194,14 +194,13 @@ class TestRunner(unittest.TestCase):
|
||||
def test_service(self):
|
||||
# TODO: tests for the service module
|
||||
pass
|
||||
|
||||
def test_assemble(self):
|
||||
input = self._get_test_file('assemble.d')
|
||||
metadata = self._get_test_file('metadata.json')
|
||||
output = self._get_stage_file('sample.out')
|
||||
result = self._run('assemble', [
|
||||
"src=%s" % input,
|
||||
"dest=%s" % output,
|
||||
"metadata=%s" % metadata
|
||||
])
|
||||
assert os.path.exists(output)
|
||||
out = file(output).read()
|
||||
@@ -214,7 +213,6 @@ class TestRunner(unittest.TestCase):
|
||||
result = self._run('assemble', [
|
||||
"src=%s" % input,
|
||||
"dest=%s" % output,
|
||||
"metadata=%s" % metadata
|
||||
])
|
||||
assert result['changed'] == False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user