I'm developing on custom branch and haven't updated the repository for at least 3 weeks. <div>Do i fetch the lastest changes like this:<br><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
git remote update<br>git checkout master<br>git pull origin master</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
git checkout <branch> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">git pull master</blockquote>
<div>?</div><div> </div><div class="gmail_quote">On Mon, Jul 2, 2012 at 1:44 PM, Monty Taylor <span dir="ltr"><<a href="mailto:mordred@inaugust.com" target="_blank">mordred@inaugust.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br>
<br>
On 07/02/2012 08:43 AM, Leander Bessa Beernaert wrote:<br>
> So, if no system packages can be imported, how do you test the<br>
> "connection" class for the libvirt driver?<br>
<br>
</div>We're working on that - but as I said, please try running tox -efull<br>
which _should_ run tests with libvirt support enabled.<br>
<div><br>
> How does that particular test case wrap around the fact that it requires<br>
> the libvirt module? The only thing i could find are these lines of code<br>
> in the driver's __init__ method. Do these somehow detect if this is a<br>
> unit test environment and import the fakelibvirt driver instead? I'm no<br>
> expert in python so i'm not sure what's happening there :s<br>
><br>
> global libvirt<br>
> if libvirt is None:<br>
> libvirt = __import__('libvirt')<br>
><br>
><br>
> Regards,<br>
> Leander<br>
><br>
> On Mon, Jul 2, 2012 at 1:27 PM, Monty Taylor <<a href="mailto:mordred@inaugust.com" target="_blank">mordred@inaugust.com</a><br>
</div><div><div>> <mailto:<a href="mailto:mordred@inaugust.com" target="_blank">mordred@inaugust.com</a>>> wrote:<br>
><br>
><br>
><br>
> On 07/02/2012 06:02 AM, Leander Bessa Beernaert wrote:<br>
> > Thanks, that let me see the real problem now:<br>
> ><br>
> > ./tools/with_venv.sh nosetests -svx nova<br>
> > nose.config: INFO: Set working dir to /home/gsd/nova/nova/tests<br>
> > nose.config: INFO: Working directory /home/gsd/nova/nova/tests<br>
> is a<br>
> > package; adding to sys.path<br>
> > nose.config: INFO: Ignoring files matching ['^\\.', '^_',<br>
> > '^setup\\.py$']<br>
> > nose.plugins.cover: INFO: Coverage report will include only<br>
> > packages: ['nova']<br>
> > nose.selector: INFO: /home/gsd/nova/nova/auth/opendj.sh is<br>
> > executable; skipped<br>
> > nose.selector: INFO: /home/gsd/nova/nova/auth/slap.sh is<br>
> executable;<br>
> > skipped<br>
> > nose.selector: INFO:<br>
> > /home/gsd/nova/nova/cloudpipe/bootscript.template is<br>
> executable; skipped<br>
> > Failure: ImportError (No module named libvirt) ... ERROR<br>
> ><br>
> ======================================================================<br>
> > ERROR: Failure: ImportError (No module named libvirt)<br>
> ><br>
> ----------------------------------------------------------------------<br>
> > Traceback (most recent call last):<br>
> > File<br>
> ><br>
> "/home/gsd/nova/.venv/local/lib/python2.7/site-packages/nose/loader.py",<br>
> > line 390, in loadTestsFromName<br>
> > addr.filename, addr.module)<br>
> > File<br>
> ><br>
> "/home/gsd/nova/.venv/local/lib/python2.7/site-packages/nose/importer.py",<br>
> > line 39, in importFromPath<br>
> > return self.importFromDir(dir_path, fqname)<br>
> > File<br>
> ><br>
> "/home/gsd/nova/.venv/local/lib/python2.7/site-packages/nose/importer.py",<br>
> > line 86, in importFromDir<br>
> > mod = load_module(part_fqname, fh, filename, desc)<br>
> > File "/home/gsd/nova/nova/test.py", line 41, in <module><br>
> > from nova.tests import fake_flags<br>
> > File "/home/gsd/nova/nova/tests/fake_flags.py", line 24, in<br>
> <module><br>
> > flags.DECLARE('compute_scheduler_driver',<br>
> 'nova.scheduler.multi')<br>
> > File "/home/gsd/nova/nova/flags.py", line 52, in DECLARE<br>
> > __import__(module_string, globals(), locals())<br>
> > File "/home/gsd/nova/nova/scheduler/multi.py", line 27, in<br>
> <module><br>
> > from nova.scheduler import driver<br>
> > File "/home/gsd/nova/nova/scheduler/driver.py", line 53, in<br>
> <module><br>
> > flags..DECLARE('libvirt_type', 'nova.virt.libvirt.connection')<br>
> > File "/home/gsd/nova/nova/flags.py", line 52, in DECLARE<br>
> > __import__(module_string, globals(), locals())<br>
> > File "/home/gsd/nova/nova/virt/libvirt/connection.py", line<br>
> 73, in<br>
> > <module><br>
> > from nova.virt.libvirt import diagnostics as<br>
> libvirt_diagnostics<br>
> > File "/home/gsd/nova/nova/virt/libvirt/diagnostics.py", line 75,<br>
> > in <module><br>
> > import libvirt as virt<br>
> > ImportError: No module named libvirt<br>
> ><br>
> ----------------------------------------------------------------------<br>
> > Ran 1 test in 0.002s<br>
> > FAILED (errors=1)<br>
> ><br>
> ><br>
> > Libvirt is present on my system, i can import it through the python<br>
> > interpreter from any location. Yet, it still says it is not present.<br>
> > Could this have to do with the virtual_env or fakelibvirt?<br>
><br>
> Yes. Our virtualenvs are currently configured to not allow system<br>
> packages to be used (so that they only use python libs installed into<br>
> the virtualenv. However, libvirt is not installable via pip, which is a<br>
> problem.<br>
><br>
> We've recently added a new tox environment to help with this, so try<br>
> running:<br>
><br>
> tox -v -efull<br>
><br>
> Which is set up to allow system site packages.<br>
><br>
> However, if you're adding unittests, you should look at the other ones<br>
> which test for libvirt existence and skip the tests if they can't<br>
> find it.<br>
><br>
> > On Fri, Jun 29, 2012 at 6:54 PM, Jay Pipes <<a href="mailto:jaypipes@gmail.com" target="_blank">jaypipes@gmail.com</a><br>
> <mailto:<a href="mailto:jaypipes@gmail.com" target="_blank">jaypipes@gmail.com</a>><br>
</div></div><div><div>> > <mailto:<a href="mailto:jaypipes@gmail.com" target="_blank">jaypipes@gmail.com</a> <mailto:<a href="mailto:jaypipes@gmail.com" target="_blank">jaypipes@gmail.com</a>>>> wrote:<br>
> ><br>
> > Hi Leander,<br>
> ><br>
> > I've noticed some weirdness with the openstack.nose_plugin<br>
> (which is<br>
> > used by default for the Nova test runner) sometimes either<br>
> throwing<br>
> > errors (particularly errors raised by nosetests) away and/or<br>
> coming<br>
> > up with a different set of skip tests than when running just with<br>
> > nosetests.<br>
> ><br>
> > So, I'd recommend running just this:<br>
> ><br>
> > ./tools/with_venv.sh nosetests -svx nova<br>
> ><br>
> > That will stop at the first error and probably will give you<br>
> better<br>
> > insight into the actual errors that are likely being suppressed by<br>
> > the openstack nose plugin.<br>
> ><br>
> > best,<br>
> > -jay<br>
> ><br>
> ><br>
> > On 06/29/2012 09:02 AM, Leander Bessa Beernaert wrote:<br>
> ><br>
> > Hello,<br>
> ><br>
> > I'm sorry to restart the topic<br>
> > (<a href="https://lists.launchpad.net/__openstack/msg13621.html" target="_blank">https://lists.launchpad.net/__openstack/msg13621.html</a><br>
> > <<a href="https://lists.launchpad.net/openstack/msg13621.html" target="_blank">https://lists.launchpad.net/openstack/msg13621.html</a>>), but<br>
> > i accidentally deleted the message in my inbox :S.<br>
> ><br>
> > I'm still having the same problem, each time i add "import<br>
> > libvirt" to<br>
> > the file "diangostics.py"<br>
> > (<a href="https://review.openstack.org/__#/c/8839/" target="_blank">https://review.openstack.org/__#/c/8839/</a><br>
> > <<a href="https://review.openstack.org/#/c/8839/" target="_blank">https://review.openstack.org/#/c/8839/</a>>) the<br>
> > entire test suit won't run.<br>
> ><br>
> > *With the import* present i get the following output:<br>
> ><br>
> ><br>
> ><br>
> ><br>
> ------------------------------__------------------------------__----------<br>
> > Ran 0 tests in 0.000s<br>
</div></div>> > OK Running PEP8 and HACKING compliance check....<br>
<div>> > 2 imports missing in this test environment<br>
> ><br>
> ><br>
> > *Without the import *present it get this output:<br>
> ><br>
> ><br>
> ><br>
> ><br>
> ------------------------------__------------------------------__----------<br>
> > Ran 3030 tests in 233.326s<br>
> > OK (SKIP=22) Running PEP8 and HACKING compliance check...<br>
> > 11 imports missing in this test environment<br>
> ><br>
> ><br>
> ><br>
> > The problem now is that, according to the OpenStack<br>
> conventions, the<br>
> > import must be present. However, with the import present i<br>
> can't<br>
> > get any<br>
> > of the tests to run.<br>
> > I'm no expert in Python, so could someone please help me<br>
> out here?<br>
> ><br>
> > Regards,<br>
> ><br>
> > Leander<br>
> ><br>
> ><br>
> > _________________________________________________<br>
> > Mailing list: <a href="https://launchpad.net/~__openstack" target="_blank">https://launchpad.net/~__openstack</a><br>
> > <<a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a>><br>
> > Post to : <a href="mailto:openstack@lists.launchpad.net" target="_blank">openstack@lists.launchpad.net</a><br>
> <mailto:<a href="mailto:openstack@lists.launchpad.net" target="_blank">openstack@lists.launchpad.net</a>><br>
</div>> > <mailto:<a href="mailto:openstack@lists.launchpad.net" target="_blank">openstack@lists.launchpad.net</a><br>
<div>> <mailto:<a href="mailto:openstack@lists.launchpad.net" target="_blank">openstack@lists.launchpad.net</a>>><br>
> > Unsubscribe : <a href="https://launchpad.net/~__openstack" target="_blank">https://launchpad.net/~__openstack</a><br>
> > <<a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a>><br>
> > More help : <a href="https://help.launchpad.net/__ListHelp" target="_blank">https://help.launchpad.net/__ListHelp</a><br>
> > <<a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a>><br>
> ><br>
> ><br>
> ><br>
> > _________________________________________________<br>
> > Mailing list: <a href="https://launchpad.net/~__openstack" target="_blank">https://launchpad.net/~__openstack</a><br>
> > <<a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a>><br>
> > Post to : <a href="mailto:openstack@lists.launchpad.net" target="_blank">openstack@lists.launchpad.net</a><br>
> <mailto:<a href="mailto:openstack@lists.launchpad.net" target="_blank">openstack@lists.launchpad.net</a>><br>
</div>> > <mailto:<a href="mailto:openstack@lists.launchpad.net" target="_blank">openstack@lists.launchpad.net</a><br>
<div>> <mailto:<a href="mailto:openstack@lists.launchpad.net" target="_blank">openstack@lists.launchpad.net</a>>><br>
> > Unsubscribe : <a href="https://launchpad.net/~__openstack" target="_blank">https://launchpad.net/~__openstack</a><br>
> > <<a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a>><br>
> > More help : <a href="https://help.launchpad.net/__ListHelp" target="_blank">https://help.launchpad.net/__ListHelp</a><br>
> > <<a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a>><br>
> ><br>
> ><br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > Mailing list: <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
> > Post to : <a href="mailto:openstack@lists.launchpad.net" target="_blank">openstack@lists.launchpad.net</a><br>
</div>> <mailto:<a href="mailto:openstack@lists.launchpad.net" target="_blank">openstack@lists.launchpad.net</a>><br>
<div><div>> > Unsubscribe : <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
> > More help : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
> ><br>
><br>
><br>
<br>
</div></div></blockquote></div><br>
</div></div>