Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the default test container to 1.7.0. #54930

Merged
merged 3 commits into from
Apr 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/runner/completion/docker.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
default name=quay.io/ansible/default-test-container:1.6.0 python=3.6,2.6,2.7,3.5,3.7,3.8 python3.8=/usr/local/bin/python3.8 seccomp=unconfined
default name=quay.io/ansible/default-test-container:1.7.0 python=3.6,2.6,2.7,3.5,3.7,3.8 seccomp=unconfined
centos6 name=quay.io/ansible/centos6-test-container:1.8.0 python=2.6 seccomp=unconfined
centos7 name=quay.io/ansible/centos7-test-container:1.8.0 python=2.7 seccomp=unconfined
fedora28 name=quay.io/ansible/fedora28-test-container:1.8.0 python=2.7
Expand Down
38 changes: 15 additions & 23 deletions test/runner/lib/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,17 +213,22 @@ def install_command_requirements(args, python_version=None):
# first pass to install requirements, changes expected unless environment is already set up
changes = run_pip_commands(args, pip, commands, detect_pip_changes)

if not changes:
return # no changes means we can stop early
if changes:
# second pass to check for conflicts in requirements, changes are not expected here
changes = run_pip_commands(args, pip, commands, detect_pip_changes)

# second pass to check for conflicts in requirements, changes are not expected here
changes = run_pip_commands(args, pip, commands, detect_pip_changes)

if not changes:
return # no changes means no conflicts
if changes:
raise ApplicationError('Conflicts detected in requirements. The following commands reported changes during verification:\n%s' %
'\n'.join((' '.join(pipes.quote(c) for c in cmd) for cmd in changes)))

raise ApplicationError('Conflicts detected in requirements. The following commands reported changes during verification:\n%s' %
'\n'.join((' '.join(pipes.quote(c) for c in cmd) for cmd in changes)))
# ask pip to check for conflicts between installed packages
try:
run_command(args, pip + ['check', '--disable-pip-version-check'], capture=True)
except SubprocessError as ex:
if ex.stderr.strip() == 'ERROR: unknown command "check"':
display.warning('Cannot check pip requirements for conflicts because "pip check" is not supported.')
else:
raise


def run_pip_commands(args, pip, commands, detect_pip_changes=False):
Expand All @@ -244,20 +249,7 @@ def run_pip_commands(args, pip, commands, detect_pip_changes=False):

before_list = after_list

try:
run_command(args, cmd)
except SubprocessError as ex:
if ex.status != 2:
raise

# If pip is too old it won't understand the arguments we passed in, so we'll need to upgrade it.

# Installing "coverage" on ubuntu 16.04 fails with the error:
# AttributeError: 'Requirement' object has no attribute 'project_name'
# See: https://bugs.launchpad.net/ubuntu/xenial/+source/python-pip/+bug/1626258
# Upgrading pip works around the issue.
run_command(args, pip + ['install', '--upgrade', 'pip'])
run_command(args, cmd)
run_command(args, cmd)

after_list = pip_list(args, pip) if detect_pip_changes else None

Expand Down