mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
Make ansible-test available in the bin directory. (#45876)
This commit is contained in:
@@ -1 +0,0 @@
|
||||
test.py
|
||||
8
test/runner/ansible-test
Executable file
8
test/runner/ansible-test
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env python
|
||||
# PYTHON_ARGCOMPLETE_OK
|
||||
"""Legacy entry point for ansible-test. The preferred version is in the bin directory."""
|
||||
|
||||
import lib.cli
|
||||
|
||||
if __name__ == '__main__':
|
||||
lib.cli.main()
|
||||
8
test/runner/test.py → test/runner/lib/cli.py
Executable file → Normal file
8
test/runner/test.py → test/runner/lib/cli.py
Executable file → Normal file
@@ -1,5 +1,3 @@
|
||||
#!/usr/bin/env python
|
||||
# PYTHON_ARGCOMPLETE_OK
|
||||
"""Test runner for all Ansible tests."""
|
||||
|
||||
from __future__ import absolute_import, print_function
|
||||
@@ -72,7 +70,7 @@ import lib.cover
|
||||
def main():
|
||||
"""Main program function."""
|
||||
try:
|
||||
git_root = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..'))
|
||||
git_root = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..', '..'))
|
||||
os.chdir(git_root)
|
||||
initialize_cloud_plugins()
|
||||
sanity_init()
|
||||
@@ -786,7 +784,3 @@ def complete_sanity_test(prefix, parsed_args, **_):
|
||||
tests = sorted(t.name for t in sanity_get_tests())
|
||||
|
||||
return [i for i in tests if i.startswith(prefix)]
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -143,7 +143,7 @@ def delegate_tox(args, exclude, require, integration_targets):
|
||||
|
||||
tox.append('--')
|
||||
|
||||
cmd = generate_command(args, os.path.abspath('test/runner/test.py'), options, exclude, require)
|
||||
cmd = generate_command(args, os.path.abspath('bin/ansible-test'), options, exclude, require)
|
||||
|
||||
if not args.python:
|
||||
cmd += ['--python', version]
|
||||
@@ -195,7 +195,7 @@ def delegate_docker(args, exclude, require, integration_targets):
|
||||
'--docker-util': 1,
|
||||
}
|
||||
|
||||
cmd = generate_command(args, '/root/ansible/test/runner/test.py', options, exclude, require)
|
||||
cmd = generate_command(args, '/root/ansible/bin/ansible-test', options, exclude, require)
|
||||
|
||||
if isinstance(args, TestConfig):
|
||||
if args.coverage and not args.coverage_label:
|
||||
@@ -364,7 +364,7 @@ def delegate_remote(args, exclude, require, integration_targets):
|
||||
'--remote': 1,
|
||||
}
|
||||
|
||||
cmd = generate_command(args, 'ansible/test/runner/test.py', options, exclude, require)
|
||||
cmd = generate_command(args, 'ansible/bin/ansible-test', options, exclude, require)
|
||||
|
||||
if httptester_id:
|
||||
cmd += ['--inject-httptester']
|
||||
|
||||
Reference in New Issue
Block a user