|
|
@ -12,6 +12,7 @@ import time
|
|
|
|
import textwrap
|
|
|
|
import textwrap
|
|
|
|
import functools
|
|
|
|
import functools
|
|
|
|
import pipes
|
|
|
|
import pipes
|
|
|
|
|
|
|
|
import sys
|
|
|
|
import hashlib
|
|
|
|
import hashlib
|
|
|
|
|
|
|
|
|
|
|
|
import lib.pytar
|
|
|
|
import lib.pytar
|
|
|
@ -49,6 +50,8 @@ from lib.util import (
|
|
|
|
raw_command,
|
|
|
|
raw_command,
|
|
|
|
get_coverage_path,
|
|
|
|
get_coverage_path,
|
|
|
|
get_available_port,
|
|
|
|
get_available_port,
|
|
|
|
|
|
|
|
generate_pip_command,
|
|
|
|
|
|
|
|
find_python,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
from lib.docker_util import (
|
|
|
|
from lib.docker_util import (
|
|
|
@ -148,9 +151,10 @@ def create_shell_command(command):
|
|
|
|
return cmd
|
|
|
|
return cmd
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def install_command_requirements(args):
|
|
|
|
def install_command_requirements(args, python_version=None):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
:type args: EnvironmentConfig
|
|
|
|
:type args: EnvironmentConfig
|
|
|
|
|
|
|
|
:type python_version: str | None
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
generate_egg_info(args)
|
|
|
|
generate_egg_info(args)
|
|
|
|
|
|
|
|
|
|
|
@ -168,7 +172,10 @@ def install_command_requirements(args):
|
|
|
|
if args.junit:
|
|
|
|
if args.junit:
|
|
|
|
packages.append('junit-xml')
|
|
|
|
packages.append('junit-xml')
|
|
|
|
|
|
|
|
|
|
|
|
pip = args.pip_command
|
|
|
|
if not python_version:
|
|
|
|
|
|
|
|
python_version = args.python_version
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pip = generate_pip_command(find_python(python_version))
|
|
|
|
|
|
|
|
|
|
|
|
commands = [generate_pip_install(pip, args.command, packages=packages)]
|
|
|
|
commands = [generate_pip_install(pip, args.command, packages=packages)]
|
|
|
|
|
|
|
|
|
|
|
@ -1133,8 +1140,6 @@ def command_units(args):
|
|
|
|
if args.delegate:
|
|
|
|
if args.delegate:
|
|
|
|
raise Delegate(require=changes)
|
|
|
|
raise Delegate(require=changes)
|
|
|
|
|
|
|
|
|
|
|
|
install_command_requirements(args)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
version_commands = []
|
|
|
|
version_commands = []
|
|
|
|
|
|
|
|
|
|
|
|
for version in SUPPORTED_PYTHON_VERSIONS:
|
|
|
|
for version in SUPPORTED_PYTHON_VERSIONS:
|
|
|
@ -1142,6 +1147,9 @@ def command_units(args):
|
|
|
|
if args.python and version != args.python_version:
|
|
|
|
if args.python and version != args.python_version:
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if args.requirements_mode != 'skip':
|
|
|
|
|
|
|
|
install_command_requirements(args, version)
|
|
|
|
|
|
|
|
|
|
|
|
env = ansible_environment(args)
|
|
|
|
env = ansible_environment(args)
|
|
|
|
|
|
|
|
|
|
|
|
cmd = [
|
|
|
|
cmd = [
|
|
|
@ -1167,6 +1175,9 @@ def command_units(args):
|
|
|
|
|
|
|
|
|
|
|
|
version_commands.append((version, cmd, env))
|
|
|
|
version_commands.append((version, cmd, env))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if args.requirements_mode == 'only':
|
|
|
|
|
|
|
|
sys.exit()
|
|
|
|
|
|
|
|
|
|
|
|
for version, command, env in version_commands:
|
|
|
|
for version, command, env in version_commands:
|
|
|
|
display.info('Unit test with Python %s' % version)
|
|
|
|
display.info('Unit test with Python %s' % version)
|
|
|
|
|
|
|
|
|
|
|
|