diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/runner/ansible-test | 10 | ||||
-rw-r--r-- | test/runner/lib/cli.py | 35 | ||||
-rw-r--r-- | test/runner/lib/executor.py | 20 | ||||
-rwxr-xr-x | test/utils/shippable/shippable.sh | 2 |
4 files changed, 34 insertions, 33 deletions
diff --git a/test/runner/ansible-test b/test/runner/ansible-test deleted file mode 100755 index 74dc229f16..0000000000 --- a/test/runner/ansible-test +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env python -# PYTHON_ARGCOMPLETE_OK -"""Legacy entry point for ansible-test. The preferred version is in the bin directory.""" -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -import lib.cli - -if __name__ == '__main__': - lib.cli.main() diff --git a/test/runner/lib/cli.py b/test/runner/lib/cli.py index b6699dd9ff..079422276f 100644 --- a/test/runner/lib/cli.py +++ b/test/runner/lib/cli.py @@ -88,7 +88,16 @@ from lib.util_common import ( CommonConfig, ) -import lib.cover +from lib.cover import ( + command_coverage_combine, + command_coverage_erase, + command_coverage_html, + command_coverage_report, + command_coverage_xml, + COVERAGE_GROUPS, + CoverageConfig, + CoverageReportConfig, +) def main(): @@ -478,8 +487,8 @@ def parse_args(): parents=[coverage_common], help='combine coverage data and rewrite remote paths') - coverage_combine.set_defaults(func=lib.cover.command_coverage_combine, - config=lib.cover.CoverageConfig) + coverage_combine.set_defaults(func=command_coverage_combine, + config=CoverageConfig) add_extra_coverage_options(coverage_combine) @@ -487,15 +496,15 @@ def parse_args(): parents=[coverage_common], help='erase coverage data files') - coverage_erase.set_defaults(func=lib.cover.command_coverage_erase, - config=lib.cover.CoverageConfig) + coverage_erase.set_defaults(func=command_coverage_erase, + config=CoverageConfig) coverage_report = coverage_subparsers.add_parser('report', parents=[coverage_common], help='generate console coverage report') - coverage_report.set_defaults(func=lib.cover.command_coverage_report, - config=lib.cover.CoverageReportConfig) + coverage_report.set_defaults(func=command_coverage_report, + config=CoverageReportConfig) coverage_report.add_argument('--show-missing', action='store_true', @@ -516,8 +525,8 @@ def parse_args(): parents=[coverage_common], help='generate html coverage report') - coverage_html.set_defaults(func=lib.cover.command_coverage_html, - config=lib.cover.CoverageConfig) + coverage_html.set_defaults(func=command_coverage_html, + config=CoverageConfig) add_extra_coverage_options(coverage_html) @@ -525,8 +534,8 @@ def parse_args(): parents=[coverage_common], help='generate xml coverage report') - coverage_xml.set_defaults(func=lib.cover.command_coverage_xml, - config=lib.cover.CoverageConfig) + coverage_xml.set_defaults(func=command_coverage_xml, + config=CoverageConfig) add_extra_coverage_options(coverage_xml) @@ -710,8 +719,8 @@ def add_extra_coverage_options(parser): parser.add_argument('--group-by', metavar='GROUP', action='append', - choices=lib.cover.COVERAGE_GROUPS, - help='group output by: %s' % ', '.join(lib.cover.COVERAGE_GROUPS)) + choices=COVERAGE_GROUPS, + help='group output by: %s' % ', '.join(COVERAGE_GROUPS)) parser.add_argument('--all', action='store_true', diff --git a/test/runner/lib/executor.py b/test/runner/lib/executor.py index 2331a8826d..1d265a81df 100644 --- a/test/runner/lib/executor.py +++ b/test/runner/lib/executor.py @@ -20,7 +20,9 @@ import shutil import lib.types as t -import lib.thread +from lib.thread import ( + WrappedThread, +) from lib.core_ci import ( AnsibleCoreCI, @@ -380,7 +382,7 @@ def command_network_integration(args): all_targets = tuple(walk_network_integration_targets(include_hidden=True)) internal_targets = command_integration_filter(args, all_targets, init_callback=network_init) - instances = [] # type: t.List[lib.thread.WrappedThread] + instances = [] # type: t.List[WrappedThread] if args.platform: get_python_path(args, args.python_executable) # initialize before starting threads @@ -394,7 +396,7 @@ def command_network_integration(args): if not config: continue - instance = lib.thread.WrappedThread(functools.partial(network_run, args, platform, version, config)) + instance = WrappedThread(functools.partial(network_run, args, platform, version, config)) instance.daemon = True instance.start() instances.append(instance) @@ -435,7 +437,7 @@ def network_init(args, internal_targets): platform_targets = set(a for target in internal_targets for a in target.aliases if a.startswith('network/')) - instances = [] # type: t.List[lib.thread.WrappedThread] + instances = [] # type: t.List[WrappedThread] # generate an ssh key (if needed) up front once, instead of for each instance SshKey(args) @@ -449,7 +451,7 @@ def network_init(args, internal_targets): platform_version, platform)) continue - instance = lib.thread.WrappedThread(functools.partial(network_start, args, platform, version)) + instance = WrappedThread(functools.partial(network_start, args, platform, version)) instance.daemon = True instance.start() instances.append(instance) @@ -545,7 +547,7 @@ def command_windows_integration(args): all_targets = tuple(walk_windows_integration_targets(include_hidden=True)) internal_targets = command_integration_filter(args, all_targets, init_callback=windows_init) - instances = [] # type: t.List[lib.thread.WrappedThread] + instances = [] # type: t.List[WrappedThread] pre_target = None post_target = None httptester_id = None @@ -558,7 +560,7 @@ def command_windows_integration(args): for version in args.windows: config = configs['windows/%s' % version] - instance = lib.thread.WrappedThread(functools.partial(windows_run, args, version, config)) + instance = WrappedThread(functools.partial(windows_run, args, version, config)) instance.daemon = True instance.start() instances.append(instance) @@ -660,10 +662,10 @@ def windows_init(args, internal_targets): # pylint: disable=locally-disabled, u if args.metadata.instance_config is not None: return - instances = [] # type: t.List[lib.thread.WrappedThread] + instances = [] # type: t.List[WrappedThread] for version in args.windows: - instance = lib.thread.WrappedThread(functools.partial(windows_start, args, version)) + instance = WrappedThread(functools.partial(windows_start, args, version)) instance.daemon = True instance.start() instances.append(instance) diff --git a/test/utils/shippable/shippable.sh b/test/utils/shippable/shippable.sh index 79aa5d08e9..98f9c879ff 100755 --- a/test/utils/shippable/shippable.sh +++ b/test/utils/shippable/shippable.sh @@ -30,7 +30,7 @@ command -v pip pip --version pip list --disable-pip-version-check -export PATH="test/runner:${PATH}" +export PATH="${PWD}/bin:${PATH}" export PYTHONIOENCODING='utf-8' if [ "${JOB_TRIGGERED_BY_NAME:-}" == "nightly-trigger" ]; then |