Merge "Drop support for ansible 2.7"

This commit is contained in:
Zuul 2020-09-21 16:22:01 +00:00 committed by Gerrit Code Review
commit d466669208
213 changed files with 29 additions and 418 deletions

View File

@ -264,7 +264,6 @@
success-url: 'npm/reports/bundle.html'
files:
- web/.*
- zuul-stream-functional-2.7
- zuul-stream-functional-2.8
- zuul-stream-functional-2.9
- zuul-tox-remote:
@ -306,7 +305,6 @@
success-url: 'npm/reports/bundle.html'
files:
- web/.*
- zuul-stream-functional-2.7
- zuul-stream-functional-2.8
- zuul-stream-functional-2.9
- zuul-tox-remote:

View File

@ -0,0 +1,4 @@
---
upgrade:
- |
Support for Ansible 2.7 has been removed.

View File

@ -34,15 +34,7 @@
parent: ansible-version
vars:
test_ansible_version_major: 2
test_ansible_version_minor: 7
- job:
name: ansible-27
parent: ansible-version
ansible-version: 2.7
vars:
test_ansible_version_major: 2
test_ansible_version_minor: 7
test_ansible_version_minor: 8
- job:
name: ansible-28
@ -66,7 +58,6 @@
check:
jobs:
- ansible-default
- ansible-27
- ansible-28
- ansible-29
@ -75,6 +66,5 @@
check:
jobs:
- ansible-default-zuul-conf
- ansible-27
- ansible-28
- ansible-29

View File

@ -99,15 +99,6 @@
label: ubuntu-xenial
run: playbooks/jinja2-message.yaml
- job:
name: ansible-version27-inventory
nodeset:
nodes:
- name: ubuntu-xenial
label: ubuntu-xenial
ansible-version: '2.7'
run: playbooks/ansible-version.yaml
- job:
name: ansible-version28-inventory
nodeset:

View File

@ -7,5 +7,4 @@
- executor-only-inventory
- group-inventory
- hostvars-inventory
- ansible-version27-inventory
- ansible-version28-inventory

View File

@ -6,5 +6,4 @@
- executor-only-inventory
- group-inventory
- hostvars-inventory
- ansible-version27-inventory
- ansible-version28-inventory

View File

@ -9,7 +9,7 @@ server=127.0.0.1
[scheduler]
tenant_config=main.yaml
relative_priority=true
default_ansible_version=2.7
default_ansible_version=2.8
[merger]
git_dir=/tmp/zuul-test/merger-git

View File

@ -222,14 +222,6 @@ class FunctionalActionModulesMixIn:
self._run_job('known-hosts-bad', 'FAILURE', ERROR_ACCESS_OUTSIDE)
class TestActionModules27(AnsibleZuulTestCase, FunctionalActionModulesMixIn):
ansible_version = '2.7'
def setUp(self):
super().setUp()
self._setUp()
class TestActionModules28(AnsibleZuulTestCase, FunctionalActionModulesMixIn):
ansible_version = '2.8'

View File

@ -91,8 +91,11 @@ class FunctionalZuulJSONMixIn:
text = self._get_json_as_text(build)
json_result = json.loads(text)
tasks = json_result[0]['plays'][0]['tasks']
# NOTE(pabelanger): In 2.8 gather_facts are now logged as an
# expected action.
expected_actions = [
'debug', 'debug', 'debug', 'copy', 'find', 'stat', 'debug'
'gather_facts', 'debug', 'debug', 'debug', 'copy', 'find',
'stat', 'debug'
]
for i, expected in enumerate(expected_actions):
host_result = tasks[i]['hosts']['controller']
@ -108,10 +111,12 @@ class FunctionalZuulJSONMixIn:
self.assertIn('json-role', text)
json_result = json.loads(text)
role_name = json_result[0]['plays'][0]['tasks'][0]['role']['name']
# NOTE(pabelanger): In 2.8 gather_facts are now logged as the
# first task.
role_name = json_result[0]['plays'][0]['tasks'][1]['role']['name']
self.assertEqual('json-role', role_name)
role_path = json_result[0]['plays'][0]['tasks'][0]['role']['path']
role_path = json_result[0]['plays'][0]['tasks'][1]['role']['path']
self.assertEqual('json-role', os.path.basename(role_path))
def test_json_time_log(self):
@ -143,14 +148,6 @@ class FunctionalZuulJSONMixIn:
dateutil.parser.parse(play_end_time)
class TestZuulJSON27(AnsibleZuulTestCase, FunctionalZuulJSONMixIn):
ansible_version = '2.7'
def setUp(self):
super().setUp()
self._setUp()
class TestZuulJSON28(AnsibleZuulTestCase, FunctionalZuulJSONMixIn):
ansible_version = '2.8'
@ -158,43 +155,10 @@ class TestZuulJSON28(AnsibleZuulTestCase, FunctionalZuulJSONMixIn):
super().setUp()
self._setUp()
def test_json_task_action(self):
job = self._run_job('no-log')
with self.jobLog(job):
build = self.history[-1]
self.assertEqual(build.result, 'SUCCESS')
text = self._get_json_as_text(build)
json_result = json.loads(text)
tasks = json_result[0]['plays'][0]['tasks']
# NOTE(pabelanger): In 2.8 gather_facts are now logged as an
# expected action.
expected_actions = [
'gather_facts', 'debug', 'debug', 'debug', 'copy', 'find',
'stat', 'debug'
]
for i, expected in enumerate(expected_actions):
host_result = tasks[i]['hosts']['controller']
self.assertEquals(expected, host_result['action'])
def test_json_role_log(self):
job = self._run_job('json-role')
with self.jobLog(job):
build = self.history[-1]
self.assertEqual(build.result, 'SUCCESS')
text = self._get_json_as_text(build)
self.assertIn('json-role', text)
json_result = json.loads(text)
# NOTE(pabelanger): In 2.8 gather_facts are now logged as the
# first task.
role_name = json_result[0]['plays'][0]['tasks'][1]['role']['name']
self.assertEqual('json-role', role_name)
role_path = json_result[0]['plays'][0]['tasks'][1]['role']['path']
self.assertEqual('json-role', os.path.basename(role_path))
class TestZuulJSON29(TestZuulJSON28):
class TestZuulJSON29(AnsibleZuulTestCase, FunctionalZuulJSONMixIn):
ansible_version = '2.9'
def setUp(self):
super().setUp()
self._setUp()

View File

@ -158,9 +158,11 @@ class FunctionalZuulStreamMixIn:
self.assertLogLine(
r'controller \| ok: Runtime: \d:\d\d:\d\d\.\d\d\d\d\d\d', text)
self.assertLogLine('PLAY RECAP', text)
# NOTE(pabelanger): Ansible 2.8 added new stats
# skipped, rescued, ignored.
self.assertLogLine(
r'controller \| ok: \d+ changed: \d+ unreachable: 0 failed: 1',
text)
r'controller \| ok: \d+ changed: \d+ unreachable: 0 failed: 0 '
'skipped: 0 rescued: 1 ignored: 0', text)
self.assertLogLine(
r'RUN END RESULT_NORMAL: \[untrusted : review.example.com/'
r'org/project/playbooks/command.yaml@master]', text)
@ -210,14 +212,6 @@ class FunctionalZuulStreamMixIn:
self.assertLogLine(regex, text)
class TestZuulStream27(AnsibleZuulTestCase, FunctionalZuulStreamMixIn):
ansible_version = '2.7'
def setUp(self):
super().setUp()
self._setUp()
class TestZuulStream28(AnsibleZuulTestCase, FunctionalZuulStreamMixIn):
ansible_version = '2.8'
@ -225,88 +219,10 @@ class TestZuulStream28(AnsibleZuulTestCase, FunctionalZuulStreamMixIn):
super().setUp()
self._setUp()
def test_command(self):
job = self._run_job('command')
with self.jobLog(job):
build = self.history[-1]
self.assertEqual(build.result, 'SUCCESS')
text = self._get_job_output(build)
self.assertLogLine(
r'RUN START: \[untrusted : review.example.com/org/project/'
r'playbooks/command.yaml@master\]', text)
self.assertLogLine(r'PLAY \[all\]', text)
self.assertLogLine(
r'Ansible version={}'.format(self.ansible_version), text)
self.assertLogLine(r'TASK \[Show contents of first file\]', text)
self.assertLogLine(r'controller \| command test one', text)
self.assertLogLine(
r'controller \| ok: Runtime: \d:\d\d:\d\d\.\d\d\d\d\d\d', text)
self.assertLogLine(r'TASK \[Show contents of second file\]', text)
self.assertLogLine(r'compute1 \| command test two', text)
self.assertLogLine(r'controller \| command test two', text)
self.assertLogLine(r'compute1 \| This is a rescue task', text)
self.assertLogLine(r'controller \| This is a rescue task', text)
self.assertLogLine(r'compute1 \| This is an always task', text)
self.assertLogLine(r'controller \| This is an always task', text)
self.assertLogLine(r'compute1 \| This is a handler', text)
self.assertLogLine(r'controller \| This is a handler', text)
self.assertLogLine(r'controller \| First free task', text)
self.assertLogLine(r'controller \| Second free task', text)
self.assertLogLine(r'controller \| This is a shell task after an '
'included role', text)
self.assertLogLine(r'compute1 \| This is a shell task after an '
'included role', text)
self.assertLogLine(r'controller \| This is a command task after '
'an included role', text)
self.assertLogLine(r'compute1 \| This is a command task after an '
'included role', text)
self.assertLogLine(r'controller \| This is a shell task with '
'delegate compute1', text)
self.assertLogLine(r'controller \| This is a shell task with '
'delegate controller', text)
self.assertLogLine(r'compute1 \| item_in_loop1', text)
self.assertLogLine(r'compute1 \| ok: Item: item_in_loop1 '
r'Runtime: \d:\d\d:\d\d\.\d\d\d\d\d\d', text)
self.assertLogLine(r'compute1 \| item_in_loop2', text)
self.assertLogLine(r'compute1 \| ok: Item: item_in_loop2 '
r'Runtime: \d:\d\d:\d\d\.\d\d\d\d\d\d', text)
self.assertLogLine(r'compute1 \| failed_in_loop1', text)
self.assertLogLine(r'compute1 \| ok: Item: failed_in_loop1 '
r'Result: 1', text)
self.assertLogLine(r'compute1 \| failed_in_loop2', text)
self.assertLogLine(r'compute1 \| ok: Item: failed_in_loop2 '
r'Result: 1', text)
self.assertLogLine(r'compute1 \| .*No such file or directory: .*'
r'\'/remote-shelltask/somewhere/'
r'that/does/not/exist\'', text)
self.assertLogLine(r'controller \| .*No such file or directory: .*'
r'\'/remote-shelltask/somewhere/'
r'that/does/not/exist\'', text)
self.assertLogLine(
r'controller \| ok: Runtime: \d:\d\d:\d\d\.\d\d\d\d\d\d', text)
self.assertLogLine('PLAY RECAP', text)
# NOTE(pabelanger): Ansible 2.8 added new stats
# skipped, rescued, ignored.
self.assertLogLine(
r'controller \| ok: \d+ changed: \d+ unreachable: 0 failed: 0 '
'skipped: 0 rescued: 1 ignored: 0', text)
self.assertLogLine(
r'RUN END RESULT_NORMAL: \[untrusted : review.example.com/'
r'org/project/playbooks/command.yaml@master]', text)
# Run a pre-defined job that is defined in a trusted repo to test
# localhost tasks.
job = self._run_job('command-localhost', create=False)
with self.jobLog(job):
build = self.history[-1]
self.assertEqual(build.result, 'SUCCESS')
text = self._get_job_output(build)
self.assertLogLine(r'localhost \| .*No such file or directory: .*'
r'\'/local-shelltask/somewhere/'
r'that/does/not/exist\'', text)
class TestZuulStream29(TestZuulStream28):
class TestZuulStream29(AnsibleZuulTestCase, FunctionalZuulStreamMixIn):
ansible_version = '2.9'
def setUp(self):
super().setUp()
self._setUp()

View File

@ -167,30 +167,6 @@ class TestInventoryAutoPython(TestInventoryBase):
self.executor_server.release()
self.waitUntilSettled()
def test_auto_python_ansible27_inventory(self):
inventory = self._get_build_inventory('ansible-version27-inventory')
all_nodes = ('ubuntu-xenial',)
self.assertIn('all', inventory)
self.assertIn('hosts', inventory['all'])
self.assertIn('vars', inventory['all'])
for node_name in all_nodes:
self.assertIn(node_name, inventory['all']['hosts'])
node_vars = inventory['all']['hosts'][node_name]
self.assertEqual(
'/usr/bin/python2', node_vars['ansible_python_interpreter'])
self.assertIn('zuul', inventory['all']['vars'])
z_vars = inventory['all']['vars']['zuul']
self.assertIn('executor', z_vars)
self.assertIn('src_root', z_vars['executor'])
self.assertIn('job', z_vars)
self.assertEqual(z_vars['job'], 'ansible-version27-inventory')
self.assertEqual(z_vars['message'], 'QQ==')
self.executor_server.release()
self.waitUntilSettled()
class TestInventory(TestInventoryBase):

View File

@ -2849,10 +2849,6 @@ class FunctionalAnsibleMixIn(object):
self._test_plugins(plugin_tests)
class TestAnsible27(AnsibleZuulTestCase, FunctionalAnsibleMixIn):
ansible_version = '2.7'
class TestAnsible28(AnsibleZuulTestCase, FunctionalAnsibleMixIn):
ansible_version = '2.8'
@ -6597,7 +6593,6 @@ class TestAnsibleVersion(AnsibleZuulTestCase):
self.assertHistory([
dict(name='ansible-default', result='SUCCESS', changes='1,1'),
dict(name='ansible-27', result='SUCCESS', changes='1,1'),
dict(name='ansible-28', result='SUCCESS', changes='1,1'),
dict(name='ansible-29', result='SUCCESS', changes='1,1'),
], ordered=False)
@ -6618,7 +6613,6 @@ class TestDefaultAnsibleVersion(AnsibleZuulTestCase):
self.assertHistory([
dict(name='ansible-default-zuul-conf', result='SUCCESS',
changes='1,1'),
dict(name='ansible-27', result='SUCCESS', changes='1,1'),
dict(name='ansible-28', result='SUCCESS', changes='1,1'),
dict(name='ansible-29', result='SUCCESS', changes='1,1'),
], ordered=False)

View File

@ -1 +0,0 @@
../../base/action/__init__.py

View File

@ -1 +0,0 @@
../../base/action/add_host.py

View File

@ -1 +0,0 @@
../../base/action/add_host.pyi

View File

@ -1 +0,0 @@
../../base/action/aireos.py

View File

@ -1 +0,0 @@
../../base/action/aireos.pyi

View File

@ -1 +0,0 @@
../../base/action/aireos_config.py

View File

@ -1 +0,0 @@
../../base/action/aireos_config.pyi

View File

@ -1 +0,0 @@
../../base/action/aruba.py

View File

@ -1 +0,0 @@
../../base/action/aruba.pyi

View File

@ -1 +0,0 @@
../../base/action/aruba_config.py

View File

@ -1 +0,0 @@
../../base/action/aruba_config.pyi

View File

@ -1 +0,0 @@
../../base/action/asa.py

View File

@ -1 +0,0 @@
../../base/action/asa.pyi

View File

@ -1 +0,0 @@
../../base/action/asa_config.py

View File

@ -1 +0,0 @@
../../base/action/asa_config.pyi

View File

@ -1 +0,0 @@
../../base/action/asa_template.py

View File

@ -1 +0,0 @@
../../base/action/asa_template.pyi

View File

@ -1 +0,0 @@
../../base/action/assemble.py

View File

@ -1 +0,0 @@
../../base/action/assemble.pyi

View File

@ -1 +0,0 @@
../../base/action/aws_s3.py

View File

@ -1 +0,0 @@
../../base/action/aws_s3.pyi

View File

@ -1 +0,0 @@
../../base/action/ce.py

View File

@ -1 +0,0 @@
../../base/action/ce.pyi

View File

@ -1 +0,0 @@
../../base/action/ce_config.py

View File

@ -1 +0,0 @@
../../base/action/ce_config.pyi

View File

@ -1 +0,0 @@
../../base/action/ce_template.py

View File

@ -1 +0,0 @@
../../base/action/ce_template.pyi

View File

@ -1 +0,0 @@
../../base/action/copy.py

View File

@ -1 +0,0 @@
../../base/action/copy.pyi

View File

@ -1 +0,0 @@
../../base/action/dellos10_config.py

View File

@ -1 +0,0 @@
../../base/action/dellos10_config.pyi

View File

@ -1 +0,0 @@
../../base/action/dellos6_config.py

View File

@ -1 +0,0 @@
../../base/action/dellos6_config.pyi

View File

@ -1 +0,0 @@
../../base/action/dellos9_config.py

View File

@ -1 +0,0 @@
../../base/action/dellos9_config.pyi

View File

@ -1 +0,0 @@
../../base/action/eos_config.py

View File

@ -1 +0,0 @@
../../base/action/eos_config.pyi

View File

@ -1 +0,0 @@
../../base/action/eos_template.py

View File

@ -1 +0,0 @@
../../base/action/eos_template.pyi

View File

@ -1 +0,0 @@
../../base/action/fetch.py

View File

@ -1 +0,0 @@
../../base/action/fetch.pyi

View File

@ -1 +0,0 @@
../../base/action/fortios_config.py

View File

@ -1 +0,0 @@
../../base/action/fortios_config.pyi

View File

@ -1 +0,0 @@
../../base/action/include_vars.py

View File

@ -1 +0,0 @@
../../base/action/include_vars.pyi

View File

@ -1 +0,0 @@
../../base/action/ios_config.py

View File

@ -1 +0,0 @@
../../base/action/ios_config.pyi

View File

@ -1 +0,0 @@
../../base/action/ios_template.py

View File

@ -1 +0,0 @@
../../base/action/ios_template.pyi

View File

@ -1 +0,0 @@
../../base/action/iosxr_config.py

View File

@ -1 +0,0 @@
../../base/action/iosxr_config.pyi

View File

@ -1 +0,0 @@
../../base/action/iosxr_template.py

View File

@ -1 +0,0 @@
../../base/action/iosxr_template.pyi

View File

@ -1 +0,0 @@
../../base/action/junos_config.py

View File

@ -1 +0,0 @@
../../base/action/junos_config.pyi

View File

@ -1 +0,0 @@
../../base/action/junos_template.py

View File

@ -1 +0,0 @@
../../base/action/junos_template.pyi

View File

@ -1 +0,0 @@
../../base/action/net_banner.py

View File

@ -1 +0,0 @@
../../base/action/net_banner.pyi

View File

@ -1 +0,0 @@
../../base/action/net_base.py

View File

@ -1 +0,0 @@
../../base/action/net_base.pyi

View File

@ -1 +0,0 @@
../../base/action/net_config.py

View File

@ -1 +0,0 @@
../../base/action/net_config.pyi

View File

@ -1 +0,0 @@
../../base/action/net_get.py

View File

@ -1 +0,0 @@
../../base/action/net_get.pyi

View File

@ -1 +0,0 @@
../../base/action/net_interface.py

View File

@ -1 +0,0 @@
../../base/action/net_interface.pyi

View File

@ -1 +0,0 @@
../../base/action/net_l2_interface.py

View File

@ -1 +0,0 @@
../../base/action/net_l2_interface.pyi

View File

@ -1 +0,0 @@
../../base/action/net_l3_interface.py

View File

@ -1 +0,0 @@
../../base/action/net_l3_interface.pyi

View File

@ -1 +0,0 @@
../../base/action/net_linkagg.py

View File

@ -1 +0,0 @@
../../base/action/net_linkagg.pyi

View File

@ -1 +0,0 @@
../../base/action/net_lldp.py

View File

@ -1 +0,0 @@
../../base/action/net_lldp.pyi

View File

@ -1 +0,0 @@
../../base/action/net_lldp_interface.py

View File

@ -1 +0,0 @@
../../base/action/net_lldp_interface.pyi

View File

@ -1 +0,0 @@
../../base/action/net_logging.py

View File

@ -1 +0,0 @@
../../base/action/net_logging.pyi

View File

@ -1 +0,0 @@
../../base/action/net_ping.py

View File

@ -1 +0,0 @@
../../base/action/net_ping.pyi

View File

@ -1 +0,0 @@
../../base/action/net_static_route.py

View File

@ -1 +0,0 @@
../../base/action/net_static_route.pyi

View File

@ -1 +0,0 @@
../../base/action/net_system.py

View File

@ -1 +0,0 @@
../../base/action/net_system.pyi

View File

@ -1 +0,0 @@
../../base/action/net_template.py

View File

@ -1 +0,0 @@
../../base/action/net_template.pyi

View File

@ -1 +0,0 @@
../../base/action/net_user.py

Some files were not shown because too many files have changed in this diff Show More