<div dir="ltr">Clark,<div><br></div><div>This is good. every file that uses a CONF.xyz needs to have an import for xyz. This is often overlooked</div><div><br></div><div>-- dims</div></div><div class="gmail_extra"><br><br>
<div class="gmail_quote">On Tue, Sep 10, 2013 at 11:43 PM, Clark Boylan <span dir="ltr"><<a href="mailto:clark.boylan@gmail.com" target="_blank">clark.boylan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Mon, Sep 9, 2013 at 4:20 AM, Rosa, Andrea (HP Cloud Services)<br>
<<a href="mailto:andrea.rosa@hp.com">andrea.rosa@hp.com</a>> wrote:<br>
</div><div><div class="h5">> Hi all<br>
><br>
> I need to debug a specific test but when I try to run it in debug mode using the "run_tests -d" (I need to attach pdb) that command fails but if I run the script without the "-d" option that works.<br>
> I created a brand-new env so I don't think it's related to my local env.<br>
> Anyone is experiencing the same issue?<br>
> Should I file a nova bug for that?<br>
><br>
> Error details:<br>
> ./run_tests.sh -d nova.tests.integrated.test_servers.ServersTestV3.test_create_and_rebuild_server<br>
> Traceback (most recent call last):<br>
> File "nova/tests/integrated/test_servers.py", line 43, in setUp<br>
> super(ServersTest, self).setUp()<br>
> File "nova/tests/integrated/integrated_helpers.py", line 87, in setUp<br>
> self.consoleauth = self.start_service('consoleauth')<br>
> File "nova/test.py", line 279, in start_service<br>
> svc = self.useFixture(ServiceFixture(name, host, **kwargs))<br>
> File "/home/ubuntu/nova/.venv/local/lib/python2.7/site-packages/testtools/testcase.py", line 591, in useFixture<br>
> fixture.setUp()<br>
> File "nova/test.py", line 174, in setUp<br>
> self.service = service.Service.create(**self.kwargs)<br>
> File "nova/service.py", line 245, in create<br>
> manager = CONF.get(manager_cls, None)<br>
> File "/home/ubuntu/nova/.venv/lib/python2.7/_abcoll.py", line 342, in get<br>
> return self[key]<br>
> File "/home/ubuntu/nova/.venv/local/lib/python2.7/site-packages/oslo/config/cfg.py", line 1610, in __getitem__<br>
> return self.__getattr__(key)<br>
> File "/home/ubuntu/nova/.venv/local/lib/python2.7/site-packages/oslo/config/cfg.py", line 1606, in __getattr__<br>
> return self._get(name)<br>
> File "/home/ubuntu/nova/.venv/local/lib/python2.7/site-packages/oslo/config/cfg.py", line 1930, in _get<br>
> value = self._substitute(self._do_get(name, group, namespace))<br>
> File "/home/ubuntu/nova/.venv/local/lib/python2.7/site-packages/oslo/config/cfg.py", line 1948, in _do_get<br>
> info = self._get_opt_info(name, group)<br>
> File "/home/ubuntu/nova/.venv/local/lib/python2.7/site-packages/oslo/config/cfg.py", line 2029, in _get_opt_info<br>
> raise NoSuchOptError(opt_name, group)<br>
> NoSuchOptError: no such option: consoleauth_manager<br>
><br>
> Ran 1 test in 11.296s<br>
> FAILED (failures=1)<br>
><br>
</div></div>There are a couple interesting things going on here, and I haven't<br>
quite untangled all of it. Basically the consoleauth_manager option<br>
comes from nova.consoleauth.manager and when we don't import that<br>
module the option isn't available to us. For some reason when running<br>
`python -m subunit.run<br>
nova.tests.integrated.test_servers.ServersTestV3.test_create_and_rebuild_server`<br>
or `python -m testtools.run<br>
nova.tests.integrated.test_servers.ServersTestV3.test_create_and_rebuild_server`<br>
(this is what run_tests.sh -d does) nova.consoleauth.manager isn't<br>
being imported, but when running `testr run<br>
nova.tests.integrated.test_servers.ServersTestV3.test_create_and_rebuild_server`<br>
it is. Not sure why there is a difference (possibly related to<br>
discover?).<br>
<br>
I did manage to confirm that the attached patch mostly fixes the<br>
problem. It allows me to run the above commands out of the a tox built<br>
virtualenv, but not a run_tests.sh built virtualenv. This is the other<br>
piece of the puzzle that I haven't sorted yet. I do have a hunch it<br>
has to do with how oslo.config is installed. As a work around you can<br>
source the tox virtualenv then run run_tests.sh -N -d and that should<br>
work given the attached patch. I would submit a change to Gerrit but<br>
would like to understand more of what is going on first. If someone<br>
else groks this more please feel free to submit the fix instead.<br>
<span class="HOEnZb"><font color="#888888"><br>
Clark<br>
</font></span><br>_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Davanum Srinivas :: <a href="http://davanum.wordpress.com">http://davanum.wordpress.com</a>
</div>