Enable more network support in ansible-test. (#20372)

* Only start platform instances with tests selected.
* Enable ios on Shippable.
* Show inventory in explain mode.
* Fix indentation of generated network inventory.
* Update classification of network module_utils.
This commit is contained in:
Matt Clay 2017-01-17 16:24:05 -08:00 committed by GitHub
parent 97491672e4
commit 3c51ce56fd
3 changed files with 41 additions and 7 deletions

View file

@ -10,6 +10,7 @@ from lib.target import (
walk_units_targets,
walk_compile_targets,
walk_sanity_targets,
load_integration_prefixes,
)
from lib.util import (
@ -86,6 +87,7 @@ class PathMapper(object):
self.module_names_by_path = dict((t.path, t.module) for t in self.module_targets)
self.integration_targets_by_name = dict((t.name, t) for t in self.integration_targets)
self.integration_targets_by_alias = dict((a, t) for t in self.integration_targets for a in t.aliases)
self.posix_integration_by_module = dict((m, t.name) for t in self.integration_targets
if 'posix/' in t.aliases for m in t.modules)
@ -94,6 +96,8 @@ class PathMapper(object):
self.network_integration_by_module = dict((m, t.name) for t in self.integration_targets
if 'network/' in t.aliases for m in t.modules)
self.prefixes = load_integration_prefixes()
def classify(self, path):
"""
:type path: str
@ -170,6 +174,21 @@ class PathMapper(object):
}
if ext == '.py':
if name in self.prefixes and self.prefixes[name] == 'network':
network_target = 'network/%s/' % name
if network_target in self.integration_targets_by_alias:
return {
'network-integration': network_target,
'units': 'all',
}
display.warning('Integration tests for "%s" not found.' % network_target)
return {
'units': 'all',
}
return {
'integration': 'all',
'network-integration': 'all',