ironicclient tox unit test fails if http proxy environment variable is set.

Bug #1403046 reported by Naohiro Tamura
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Invalid
Undecided
Unassigned
python-ironicclient
Fix Released
Medium
Naohiro Tamura

Bug Description

If test environment is located behind a http proxy, tox and pip
require to set http proxy environment variable.
However httpretty mock library does NOT work as expected if http proxy is set.
Therefor the fixture of the test code should remove the http proxy environment variable.

naohirot@ubuntu3:~/work/src/python-ironicclient$ source .tox/venv/bin/activate
(venv)naohirot@ubuntu3:~/work/src/python-ironicclient$ tox -epy27
py27 runtests: commands[0] | python setup.py testr --slowest --testr-args=
running testr
running=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_TEST_TIMEOUT=60 ${PYTHON:-python} -m subunit.run discover -t ./ ./ --list
running=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_TEST_TIMEOUT=60 ${PYTHON:-python} -m subunit.run discover -t ./ ./ --load-list /tmp/tmpY5clI7
running=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_TEST_TIMEOUT=60 ${PYTHON:-python} -m subunit.run discover -t ./ ./ --load-list /tmp/tmpXObHRd
======================================================================
FAIL: ironicclient.tests.test_shell.ShellTestNoMox.test_node_list
tags: worker-0
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/naohirot/work/src/python-ironicclient/.tox/py27/local/lib/python2.7/site-packages/httpretty/core.py", line 1013, in wrapper
    return test(*args, **kw)
  File "/home/naohirot/work/src/python-ironicclient/ironicclient/tests/test_shell.py", line 281, in test_node_list
    event_list_text = self.shell('node-list')
  File "/home/naohirot/work/src/python-ironicclient/ironicclient/tests/test_shell.py", line 236, in shell
    _shell.main(argstr.split())
  File "/home/naohirot/work/src/python-ironicclient/ironicclient/shell.py", line 440, in main
    **kwargs)
  File "/home/naohirot/work/src/python-ironicclient/ironicclient/shell.py", line 310, in _get_keystone_auth
    auth_url=auth_url)
  File "/home/naohirot/work/src/python-ironicclient/ironicclient/shell.py", line 280, in _discover_auth_versions
    raise exc.CommandError(msg)
CommandError: Unable to determine the Keystone version to authenticate with using the given auth_url. Identity service may not support API version discovery. Please provide a versioned auth_url instead. http://keystone.example.com:5000/
======================================================================
FAIL: ironicclient.tests.test_shell.ShellTestNoMoxV3.test_node_list
tags: worker-1
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/naohirot/work/src/python-ironicclient/.tox/py27/local/lib/python2.7/site-packages/httpretty/core.py", line 1013, in wrapper
    return test(*args, **kw)
  File "/home/naohirot/work/src/python-ironicclient/ironicclient/tests/test_shell.py", line 281, in test_node_list
    event_list_text = self.shell('node-list')
  File "/home/naohirot/work/src/python-ironicclient/ironicclient/tests/test_shell.py", line 236, in shell
    _shell.main(argstr.split())
  File "/home/naohirot/work/src/python-ironicclient/ironicclient/shell.py", line 440, in main
    **kwargs)
  File "/home/naohirot/work/src/python-ironicclient/ironicclient/shell.py", line 310, in _get_keystone_auth
    auth_url=auth_url)
  File "/home/naohirot/work/src/python-ironicclient/ironicclient/shell.py", line 280, in _discover_auth_versions
    raise exc.CommandError(msg)
CommandError: Unable to determine the Keystone version to authenticate with using the given auth_url. Identity service may not support API version discovery. Please provide a versioned auth_url instead. http://keystone.example.com:5000/
Ran 166 tests in 241.601s (+240.391s)
FAILED (id=1, failures=2)
error: testr failed (1)
ERROR: InvocationError: '/home/naohirot/work/src/python-ironicclient/.tox/py27/bin/python setup.py testr --slowest --testr-args='
___________________________________ summary ____________________________________
ERROR: py27: commands failed
(venv)naohirot@ubuntu3:~/work/src/python-ironicclient$

(venv)naohirot@ubuntu3:~/work/src/python-ironicclient$ unset http_proxy
(venv)naohirot@ubuntu3:~/work/src/python-ironicclient$ unset https_proxy
(venv)naohirot@ubuntu3:~/work/src/python-ironicclient$ tox -epy27
py27 runtests: commands[0] | python setup.py testr --slowest --testr-args=
running testr
running=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_TEST_TIMEOUT=60 ${PYTHON:-python} -m subunit.run discover -t ./ ./ --list
running=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_TEST_TIMEOUT=60 ${PYTHON:-python} -m subunit.run discover -t ./ ./ --load-list /tmp/tmpx7dE3Y
running=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_TEST_TIMEOUT=60 ${PYTHON:-python} -m subunit.run discover -t ./ ./ --load-list /tmp/tmpSm7Ec0
Ran 166 tests in 112.243s (-127.948s)
PASSED (id=2)
Slowest Tests
Test id Runtime (s)
----------------------------------------------------------------------- -----------
ironicclient.tests.test_shell.ShellTest.test_password_prompted 112.208
ironicclient.tests.test_shell.ShellTest.test_help 0.083
ironicclient.tests.test_shell.ShellTest.test_auth_param 0.073
ironicclient.tests.test_shell.ShellTest.test_debug 0.032
ironicclient.tests.test_shell.ShellTestNoMoxV3.test_node_list 0.028
ironicclient.tests.test_shell.ShellTestNoMox.test_node_list 0.022
ironicclient.tests.test_shell.ShellTest.test_bash_completion 0.017
ironicclient.tests.test_shell.ShellTest.test_help_on_subcommand 0.016
ironicclient.tests.test_shell.ShellTest.test_help_unknown_command 0.015
ironicclient.tests.v1.test_node_shell.NodeShellTest.test_do_node_update 0.014
___________________________________ summary ____________________________________
  py27: commands succeeded
  congratulations :)
(venv)naohirot@ubuntu3:~/work/src/python-ironicclient$

Changed in ironic:
assignee: nobody → Naohiro Tamura (naohirot)
description: updated
description: updated
Dmitry Tantsur (divius)
Changed in python-ironicclient:
importance: Undecided → Medium
Changed in ironic:
status: New → Invalid
Changed in python-ironicclient:
assignee: nobody → Naohiro Tamura (naohirot)
no longer affects: ironic
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-ironicclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/142112

Changed in python-ironicclient:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-ironicclient (master)

Reviewed: https://review.openstack.org/142112
Committed: https://git.openstack.org/cgit/openstack/python-ironicclient/commit/?id=f746e172f4a0ba1dfa381f1abafbde2cca61cc3b
Submitter: Jenkins
Branch: master

commit f746e172f4a0ba1dfa381f1abafbde2cca61cc3b
Author: Naohiro Tamura <email address hidden>
Date: Tue Dec 16 23:12:41 2014 +0900

    Removed http proxy environment variable so that httpretty can work

    If test environment is located behind a http proxy, tox and pip
    require to set http proxy environment variable.
    However httpretty mock library does NOT work as expected if http proxy
    is set.
    Therefor code to remove the http proxy environment variable is added
    into the fixture.

    Change-Id: Ibd3bb833774b1362e628725603b9b274b09375bd
    Closes-Bug: #1403046

Changed in python-ironicclient:
status: In Progress → Fix Committed
Changed in ironic:
status: New → Invalid
Changed in python-ironicclient:
milestone: none → 0.7.0
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.