mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -07:00
Increase python version coverage for tests. (#24762)
* Improve ansible-test inventory handling. * Fix python 3 re-raise of exception from thread. * Fix python 3 encoding for windows-integration. * Run network tests on multiple python versions. * Run windows tests on multiple python versions. * Support Shippable delegation using --tox. * Skip vyos_command on python 3 tests until fixed. * Add python 3 filtering to local and tox. * Fix tests to support back to back runs. * Temporarily test networking with python 2.7 only. Running the tests back to back causes intermittent test failures which need to be addressed before we can test multiple versions in a single test run.
This commit is contained in:
parent
c99c3b2b5d
commit
5babe2daea
13 changed files with 140 additions and 51 deletions
|
@ -245,6 +245,11 @@ def command_network_integration(args):
|
|||
"""
|
||||
:type args: NetworkIntegrationConfig
|
||||
"""
|
||||
filename = 'test/integration/inventory.networking'
|
||||
|
||||
if not args.explain and not args.platform and not os.path.isfile(filename):
|
||||
raise ApplicationError('Use the --platform option or provide an inventory file (see %s.template).' % filename)
|
||||
|
||||
internal_targets = command_integration_filter(args, walk_network_integration_targets())
|
||||
platform_targets = set(a for t in internal_targets for a in t.aliases if a.startswith('network/'))
|
||||
|
||||
|
@ -276,8 +281,6 @@ def command_network_integration(args):
|
|||
remotes = [instance.wait_for_result() for instance in instances]
|
||||
inventory = network_inventory(remotes)
|
||||
|
||||
filename = 'test/integration/inventory.networking'
|
||||
|
||||
display.info('>>> Inventory: %s\n%s' % (filename, inventory.strip()), verbosity=3)
|
||||
|
||||
if not args.explain:
|
||||
|
@ -349,6 +352,11 @@ def command_windows_integration(args):
|
|||
"""
|
||||
:type args: WindowsIntegrationConfig
|
||||
"""
|
||||
filename = 'test/integration/inventory.winrm'
|
||||
|
||||
if not args.explain and not args.windows and not os.path.isfile(filename):
|
||||
raise ApplicationError('Use the --windows option or provide an inventory file (see %s.template).' % filename)
|
||||
|
||||
internal_targets = command_integration_filter(args, walk_windows_integration_targets())
|
||||
|
||||
if args.windows:
|
||||
|
@ -368,8 +376,6 @@ def command_windows_integration(args):
|
|||
remotes = [instance.wait_for_result() for instance in instances]
|
||||
inventory = windows_inventory(remotes)
|
||||
|
||||
filename = 'test/integration/inventory.winrm'
|
||||
|
||||
display.info('>>> Inventory: %s\n%s' % (filename, inventory.strip()), verbosity=3)
|
||||
|
||||
if not args.explain:
|
||||
|
@ -1111,6 +1117,14 @@ def get_integration_local_filter(args, targets):
|
|||
display.warning('Excluding tests marked "%s" which require --allow-destructive to run locally: %s'
|
||||
% (skip.rstrip('/'), ', '.join(skipped)))
|
||||
|
||||
if args.python_version.startswith('3'):
|
||||
skip = 'skip/python3/'
|
||||
skipped = [target.name for target in targets if skip in target.aliases]
|
||||
if skipped:
|
||||
exclude.append(skip)
|
||||
display.warning('Excluding tests marked "%s" which are not yet supported on python 3: %s'
|
||||
% (skip.rstrip('/'), ', '.join(skipped)))
|
||||
|
||||
return exclude
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue