Re: [Openstack] [OpenStack][Nova] Issues with run_tests.sh, no tests are run when import libvirt is present
Thanks, that let me see the real problem now: ./tools/with_venv.sh nosetests -svx nova nose.config: INFO: Set working dir to /home/gsd/nova/nova/tests nose.config: INFO: Working directory /home/gsd/nova/nova/tests is a package; adding to sys.path nose.config: INFO: Ignoring files matching ['^\\.', '^_', '^setup\\.py$'] nose.plugins.cover: INFO: Coverage report will include only packages: ['nova'] nose.selector: INFO: /home/gsd/nova/nova/auth/opendj.sh is executable; skipped nose.selector: INFO: /home/gsd/nova/nova/auth/slap.sh is executable; skipped nose.selector: INFO: /home/gsd/nova/nova/cloudpipe/bootscript.template is executable; skipped Failure: ImportError (No module named libvirt) ... ERROR == ERROR: Failure: ImportError (No module named libvirt) -- Traceback (most recent call last): File /home/gsd/nova/.venv/local/lib/python2.7/site-packages/nose/loader.py, line 390, in loadTestsFromName addr.filename, addr.module) File /home/gsd/nova/.venv/local/lib/python2.7/site-packages/nose/importer.py, line 39, in importFromPath return self.importFromDir(dir_path, fqname) File /home/gsd/nova/.venv/local/lib/python2.7/site-packages/nose/importer.py, line 86, in importFromDir mod = load_module(part_fqname, fh, filename, desc) File /home/gsd/nova/nova/test.py, line 41, in module from nova.tests import fake_flags File /home/gsd/nova/nova/tests/fake_flags.py, line 24, in module flags.DECLARE('compute_scheduler_driver', 'nova.scheduler.multi') File /home/gsd/nova/nova/flags.py, line 52, in DECLARE __import__(module_string, globals(), locals()) File /home/gsd/nova/nova/scheduler/multi.py, line 27, in module from nova.scheduler import driver File /home/gsd/nova/nova/scheduler/driver.py, line 53, in module flags.DECLARE('libvirt_type', 'nova.virt.libvirt.connection') File /home/gsd/nova/nova/flags.py, line 52, in DECLARE __import__(module_string, globals(), locals()) File /home/gsd/nova/nova/virt/libvirt/connection.py, line 73, in module from nova.virt.libvirt import diagnostics as libvirt_diagnostics File /home/gsd/nova/nova/virt/libvirt/diagnostics.py, line 75, in module import libvirt as virt ImportError: No module named libvirt -- Ran 1 test in 0.002s FAILED (errors=1) Libvirt is present on my system, i can import it through the python interpreter from any location. Yet, it still says it is not present. Could this have to do with the virtual_env or fakelibvirt? On Fri, Jun 29, 2012 at 6:54 PM, Jay Pipes jaypi...@gmail.com wrote: Hi Leander, I've noticed some weirdness with the openstack.nose_plugin (which is used by default for the Nova test runner) sometimes either throwing errors (particularly errors raised by nosetests) away and/or coming up with a different set of skip tests than when running just with nosetests. So, I'd recommend running just this: ./tools/with_venv.sh nosetests -svx nova That will stop at the first error and probably will give you better insight into the actual errors that are likely being suppressed by the openstack nose plugin. best, -jay On 06/29/2012 09:02 AM, Leander Bessa Beernaert wrote: Hello, I'm sorry to restart the topic (https://lists.launchpad.net/**openstack/msg13621.htmlhttps://lists.launchpad.net/openstack/msg13621.html), but i accidentally deleted the message in my inbox :S. I'm still having the same problem, each time i add import libvirt to the file diangostics.py (https://review.openstack.org/**#/c/8839/https://review.openstack.org/#/c/8839/) the entire test suit won't run. *With the import* present i get the following output: --**--** -- Ran 0 tests in 0.000s OK Running PEP8 and HACKING compliance check... 2 imports missing in this test environment *Without the import *present it get this output: --**--** -- Ran 3030 tests in 233.326s OK (SKIP=22) Running PEP8 and HACKING compliance check... 11 imports missing in this test environment The problem now is that, according to the OpenStack conventions, the import must be present. However, with the import present i can't get any of the tests to run. I'm no expert in Python, so could someone please help me out here? Regards, Leander __**_ Mailing list: https://launchpad.net/~**openstackhttps://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~**openstackhttps://launchpad.net/~openstack More help : https://help.launchpad.net/**ListHelphttps://help.launchpad.net/ListHelp
Re: [Openstack] [OpenStack][Nova] Issues with run_tests.sh, no tests are run when import libvirt is present
On 07/02/2012 06:02 AM, Leander Bessa Beernaert wrote: Thanks, that let me see the real problem now: ./tools/with_venv.sh nosetests -svx nova nose.config: INFO: Set working dir to /home/gsd/nova/nova/tests nose.config: INFO: Working directory /home/gsd/nova/nova/tests is a package; adding to sys.path nose.config: INFO: Ignoring files matching ['^\\.', '^_', '^setup\\.py$'] nose.plugins.cover: INFO: Coverage report will include only packages: ['nova'] nose.selector: INFO: /home/gsd/nova/nova/auth/opendj.sh is executable; skipped nose.selector: INFO: /home/gsd/nova/nova/auth/slap.sh is executable; skipped nose.selector: INFO: /home/gsd/nova/nova/cloudpipe/bootscript.template is executable; skipped Failure: ImportError (No module named libvirt) ... ERROR == ERROR: Failure: ImportError (No module named libvirt) -- Traceback (most recent call last): File /home/gsd/nova/.venv/local/lib/python2.7/site-packages/nose/loader.py, line 390, in loadTestsFromName addr.filename, addr.module) File /home/gsd/nova/.venv/local/lib/python2.7/site-packages/nose/importer.py, line 39, in importFromPath return self.importFromDir(dir_path, fqname) File /home/gsd/nova/.venv/local/lib/python2.7/site-packages/nose/importer.py, line 86, in importFromDir mod = load_module(part_fqname, fh, filename, desc) File /home/gsd/nova/nova/test.py, line 41, in module from nova.tests import fake_flags File /home/gsd/nova/nova/tests/fake_flags.py, line 24, in module flags.DECLARE('compute_scheduler_driver', 'nova.scheduler.multi') File /home/gsd/nova/nova/flags.py, line 52, in DECLARE __import__(module_string, globals(), locals()) File /home/gsd/nova/nova/scheduler/multi.py, line 27, in module from nova.scheduler import driver File /home/gsd/nova/nova/scheduler/driver.py, line 53, in module flags..DECLARE('libvirt_type', 'nova.virt.libvirt.connection') File /home/gsd/nova/nova/flags.py, line 52, in DECLARE __import__(module_string, globals(), locals()) File /home/gsd/nova/nova/virt/libvirt/connection.py, line 73, in module from nova.virt.libvirt import diagnostics as libvirt_diagnostics File /home/gsd/nova/nova/virt/libvirt/diagnostics.py, line 75, in module import libvirt as virt ImportError: No module named libvirt -- Ran 1 test in 0.002s FAILED (errors=1) Libvirt is present on my system, i can import it through the python interpreter from any location. Yet, it still says it is not present. Could this have to do with the virtual_env or fakelibvirt? Yes. Our virtualenvs are currently configured to not allow system packages to be used (so that they only use python libs installed into the virtualenv. However, libvirt is not installable via pip, which is a problem. We've recently added a new tox environment to help with this, so try running: tox -v -efull Which is set up to allow system site packages. However, if you're adding unittests, you should look at the other ones which test for libvirt existence and skip the tests if they can't find it. On Fri, Jun 29, 2012 at 6:54 PM, Jay Pipes jaypi...@gmail.com mailto:jaypi...@gmail.com wrote: Hi Leander, I've noticed some weirdness with the openstack.nose_plugin (which is used by default for the Nova test runner) sometimes either throwing errors (particularly errors raised by nosetests) away and/or coming up with a different set of skip tests than when running just with nosetests. So, I'd recommend running just this: ./tools/with_venv.sh nosetests -svx nova That will stop at the first error and probably will give you better insight into the actual errors that are likely being suppressed by the openstack nose plugin. best, -jay On 06/29/2012 09:02 AM, Leander Bessa Beernaert wrote: Hello, I'm sorry to restart the topic (https://lists.launchpad.net/__openstack/msg13621.html https://lists.launchpad.net/openstack/msg13621.html), but i accidentally deleted the message in my inbox :S. I'm still having the same problem, each time i add import libvirt to the file diangostics.py (https://review.openstack.org/__#/c/8839/ https://review.openstack.org/#/c/8839/) the entire test suit won't run. *With the import* present i get the following output: --__--__-- Ran 0 tests
Re: [Openstack] [OpenStack][Nova] Issues with run_tests.sh, no tests are run when import libvirt is present
So, if no system packages can be imported, how do you test the connection class for the libvirt driver? How does that particular test case wrap around the fact that it requires the libvirt module? The only thing i could find are these lines of code in the driver's __init__ method. Do these somehow detect if this is a unit test environment and import the fakelibvirt driver instead? I'm no expert in python so i'm not sure what's happening there :s global libvirt if libvirt is None: libvirt = __import__('libvirt') Regards, Leander On Mon, Jul 2, 2012 at 1:27 PM, Monty Taylor mord...@inaugust.com wrote: On 07/02/2012 06:02 AM, Leander Bessa Beernaert wrote: Thanks, that let me see the real problem now: ./tools/with_venv.sh nosetests -svx nova nose.config: INFO: Set working dir to /home/gsd/nova/nova/tests nose.config: INFO: Working directory /home/gsd/nova/nova/tests is a package; adding to sys.path nose.config: INFO: Ignoring files matching ['^\\.', '^_', '^setup\\.py$'] nose.plugins.cover: INFO: Coverage report will include only packages: ['nova'] nose.selector: INFO: /home/gsd/nova/nova/auth/opendj.sh is executable; skipped nose.selector: INFO: /home/gsd/nova/nova/auth/slap.sh is executable; skipped nose.selector: INFO: /home/gsd/nova/nova/cloudpipe/bootscript.template is executable; skipped Failure: ImportError (No module named libvirt) ... ERROR == ERROR: Failure: ImportError (No module named libvirt) -- Traceback (most recent call last): File /home/gsd/nova/.venv/local/lib/python2.7/site-packages/nose/loader.py, line 390, in loadTestsFromName addr.filename, addr.module) File /home/gsd/nova/.venv/local/lib/python2.7/site-packages/nose/importer.py, line 39, in importFromPath return self.importFromDir(dir_path, fqname) File /home/gsd/nova/.venv/local/lib/python2.7/site-packages/nose/importer.py, line 86, in importFromDir mod = load_module(part_fqname, fh, filename, desc) File /home/gsd/nova/nova/test.py, line 41, in module from nova.tests import fake_flags File /home/gsd/nova/nova/tests/fake_flags.py, line 24, in module flags.DECLARE('compute_scheduler_driver', 'nova.scheduler.multi') File /home/gsd/nova/nova/flags.py, line 52, in DECLARE __import__(module_string, globals(), locals()) File /home/gsd/nova/nova/scheduler/multi.py, line 27, in module from nova.scheduler import driver File /home/gsd/nova/nova/scheduler/driver.py, line 53, in module flags..DECLARE('libvirt_type', 'nova.virt.libvirt.connection') File /home/gsd/nova/nova/flags.py, line 52, in DECLARE __import__(module_string, globals(), locals()) File /home/gsd/nova/nova/virt/libvirt/connection.py, line 73, in module from nova.virt.libvirt import diagnostics as libvirt_diagnostics File /home/gsd/nova/nova/virt/libvirt/diagnostics.py, line 75, in module import libvirt as virt ImportError: No module named libvirt -- Ran 1 test in 0.002s FAILED (errors=1) Libvirt is present on my system, i can import it through the python interpreter from any location. Yet, it still says it is not present. Could this have to do with the virtual_env or fakelibvirt? Yes. Our virtualenvs are currently configured to not allow system packages to be used (so that they only use python libs installed into the virtualenv. However, libvirt is not installable via pip, which is a problem. We've recently added a new tox environment to help with this, so try running: tox -v -efull Which is set up to allow system site packages. However, if you're adding unittests, you should look at the other ones which test for libvirt existence and skip the tests if they can't find it. On Fri, Jun 29, 2012 at 6:54 PM, Jay Pipes jaypi...@gmail.com mailto:jaypi...@gmail.com wrote: Hi Leander, I've noticed some weirdness with the openstack.nose_plugin (which is used by default for the Nova test runner) sometimes either throwing errors (particularly errors raised by nosetests) away and/or coming up with a different set of skip tests than when running just with nosetests. So, I'd recommend running just this: ./tools/with_venv.sh nosetests -svx nova That will stop at the first error and probably will give you better insight into the actual errors that are likely being suppressed by the openstack nose plugin. best, -jay On 06/29/2012 09:02 AM, Leander Bessa Beernaert wrote: Hello,
Re: [Openstack] [OpenStack][Nova] Issues with run_tests.sh, no tests are run when import libvirt is present
On 07/02/2012 08:43 AM, Leander Bessa Beernaert wrote: So, if no system packages can be imported, how do you test the connection class for the libvirt driver? We're working on that - but as I said, please try running tox -efull which _should_ run tests with libvirt support enabled. How does that particular test case wrap around the fact that it requires the libvirt module? The only thing i could find are these lines of code in the driver's __init__ method. Do these somehow detect if this is a unit test environment and import the fakelibvirt driver instead? I'm no expert in python so i'm not sure what's happening there :s global libvirt if libvirt is None: libvirt = __import__('libvirt') Regards, Leander On Mon, Jul 2, 2012 at 1:27 PM, Monty Taylor mord...@inaugust.com mailto:mord...@inaugust.com wrote: On 07/02/2012 06:02 AM, Leander Bessa Beernaert wrote: Thanks, that let me see the real problem now: ./tools/with_venv.sh nosetests -svx nova nose.config: INFO: Set working dir to /home/gsd/nova/nova/tests nose.config: INFO: Working directory /home/gsd/nova/nova/tests is a package; adding to sys.path nose.config: INFO: Ignoring files matching ['^\\.', '^_', '^setup\\.py$'] nose.plugins.cover: INFO: Coverage report will include only packages: ['nova'] nose.selector: INFO: /home/gsd/nova/nova/auth/opendj.sh is executable; skipped nose.selector: INFO: /home/gsd/nova/nova/auth/slap.sh is executable; skipped nose.selector: INFO: /home/gsd/nova/nova/cloudpipe/bootscript.template is executable; skipped Failure: ImportError (No module named libvirt) ... ERROR == ERROR: Failure: ImportError (No module named libvirt) -- Traceback (most recent call last): File /home/gsd/nova/.venv/local/lib/python2.7/site-packages/nose/loader.py, line 390, in loadTestsFromName addr.filename, addr.module) File /home/gsd/nova/.venv/local/lib/python2.7/site-packages/nose/importer.py, line 39, in importFromPath return self.importFromDir(dir_path, fqname) File /home/gsd/nova/.venv/local/lib/python2.7/site-packages/nose/importer.py, line 86, in importFromDir mod = load_module(part_fqname, fh, filename, desc) File /home/gsd/nova/nova/test.py, line 41, in module from nova.tests import fake_flags File /home/gsd/nova/nova/tests/fake_flags.py, line 24, in module flags.DECLARE('compute_scheduler_driver', 'nova.scheduler.multi') File /home/gsd/nova/nova/flags.py, line 52, in DECLARE __import__(module_string, globals(), locals()) File /home/gsd/nova/nova/scheduler/multi.py, line 27, in module from nova.scheduler import driver File /home/gsd/nova/nova/scheduler/driver.py, line 53, in module flags..DECLARE('libvirt_type', 'nova.virt.libvirt.connection') File /home/gsd/nova/nova/flags.py, line 52, in DECLARE __import__(module_string, globals(), locals()) File /home/gsd/nova/nova/virt/libvirt/connection.py, line 73, in module from nova.virt.libvirt import diagnostics as libvirt_diagnostics File /home/gsd/nova/nova/virt/libvirt/diagnostics.py, line 75, in module import libvirt as virt ImportError: No module named libvirt -- Ran 1 test in 0.002s FAILED (errors=1) Libvirt is present on my system, i can import it through the python interpreter from any location. Yet, it still says it is not present. Could this have to do with the virtual_env or fakelibvirt? Yes. Our virtualenvs are currently configured to not allow system packages to be used (so that they only use python libs installed into the virtualenv. However, libvirt is not installable via pip, which is a problem. We've recently added a new tox environment to help with this, so try running: tox -v -efull Which is set up to allow system site packages. However, if you're adding unittests, you should look at the other ones which test for libvirt existence and skip the tests if they can't find it. On Fri, Jun 29, 2012 at 6:54 PM, Jay Pipes jaypi...@gmail.com mailto:jaypi...@gmail.com mailto:jaypi...@gmail.com mailto:jaypi...@gmail.com wrote: Hi Leander,
Re: [Openstack] [OpenStack][Nova] Issues with run_tests.sh, no tests are run when import libvirt is present
I'm developing on custom branch and haven't updated the repository for at least 3 weeks. Do i fetch the lastest changes like this: git remote update git checkout master git pull origin master git checkout branch git pull master ? On Mon, Jul 2, 2012 at 1:44 PM, Monty Taylor mord...@inaugust.com wrote: On 07/02/2012 08:43 AM, Leander Bessa Beernaert wrote: So, if no system packages can be imported, how do you test the connection class for the libvirt driver? We're working on that - but as I said, please try running tox -efull which _should_ run tests with libvirt support enabled. How does that particular test case wrap around the fact that it requires the libvirt module? The only thing i could find are these lines of code in the driver's __init__ method. Do these somehow detect if this is a unit test environment and import the fakelibvirt driver instead? I'm no expert in python so i'm not sure what's happening there :s global libvirt if libvirt is None: libvirt = __import__('libvirt') Regards, Leander On Mon, Jul 2, 2012 at 1:27 PM, Monty Taylor mord...@inaugust.com mailto:mord...@inaugust.com wrote: On 07/02/2012 06:02 AM, Leander Bessa Beernaert wrote: Thanks, that let me see the real problem now: ./tools/with_venv.sh nosetests -svx nova nose.config: INFO: Set working dir to /home/gsd/nova/nova/tests nose.config: INFO: Working directory /home/gsd/nova/nova/tests is a package; adding to sys.path nose.config: INFO: Ignoring files matching ['^\\.', '^_', '^setup\\.py$'] nose.plugins.cover: INFO: Coverage report will include only packages: ['nova'] nose.selector: INFO: /home/gsd/nova/nova/auth/opendj.sh is executable; skipped nose.selector: INFO: /home/gsd/nova/nova/auth/slap.sh is executable; skipped nose.selector: INFO: /home/gsd/nova/nova/cloudpipe/bootscript.template is executable; skipped Failure: ImportError (No module named libvirt) ... ERROR == ERROR: Failure: ImportError (No module named libvirt) -- Traceback (most recent call last): File /home/gsd/nova/.venv/local/lib/python2.7/site-packages/nose/loader.py, line 390, in loadTestsFromName addr.filename, addr.module) File /home/gsd/nova/.venv/local/lib/python2.7/site-packages/nose/importer.py, line 39, in importFromPath return self.importFromDir(dir_path, fqname) File /home/gsd/nova/.venv/local/lib/python2.7/site-packages/nose/importer.py, line 86, in importFromDir mod = load_module(part_fqname, fh, filename, desc) File /home/gsd/nova/nova/test.py, line 41, in module from nova.tests import fake_flags File /home/gsd/nova/nova/tests/fake_flags.py, line 24, in module flags.DECLARE('compute_scheduler_driver', 'nova.scheduler.multi') File /home/gsd/nova/nova/flags.py, line 52, in DECLARE __import__(module_string, globals(), locals()) File /home/gsd/nova/nova/scheduler/multi.py, line 27, in module from nova.scheduler import driver File /home/gsd/nova/nova/scheduler/driver.py, line 53, in module flags..DECLARE('libvirt_type', 'nova.virt.libvirt.connection') File /home/gsd/nova/nova/flags.py, line 52, in DECLARE __import__(module_string, globals(), locals()) File /home/gsd/nova/nova/virt/libvirt/connection.py, line 73, in module from nova.virt.libvirt import diagnostics as libvirt_diagnostics File /home/gsd/nova/nova/virt/libvirt/diagnostics.py, line 75, in module import libvirt as virt ImportError: No module named libvirt -- Ran 1 test in 0.002s FAILED (errors=1) Libvirt is present on my system, i can import it through the python interpreter from any location. Yet, it still says it is not present. Could this have to do with the virtual_env or fakelibvirt? Yes. Our virtualenvs are currently configured to not allow system packages to be used (so that they only use python libs installed into the virtualenv. However, libvirt is not installable via pip, which is a problem. We've recently added a new tox environment to help with this, so try running: tox -v -efull Which is set up to allow
Re: [Openstack] [OpenStack][Nova] Issues with run_tests.sh, no tests are run when import libvirt is present
On 07/02/2012 08:57 AM, Leander Bessa Beernaert wrote: I'm developing on custom branch and haven't updated the repository for at least 3 weeks. Do i fetch the lastest changes like this: git remote update git checkout master git pull origin master git checkout branch git pull master Remember to git stash your current working changes first... # Ensure you are in your local working git branch # (not your local master) git stash --all git checkout master git pull git checkout $WORKINGBRANCH git rebase master git stash pop and then handle any merge conflicts that may pop up. Best, -jay ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp
Re: [Openstack] [OpenStack][Nova] Issues with run_tests.sh, no tests are run when import libvirt is present
@Jay Thx. @Monty I'm unable to run tox -efull, it keeps saying the command could not be located. I'm supposed to run this from the same place i run run_tests.sh right? On Mon, Jul 2, 2012 at 2:08 PM, Jay Pipes jaypi...@gmail.com wrote: On 07/02/2012 08:57 AM, Leander Bessa Beernaert wrote: I'm developing on custom branch and haven't updated the repository for at least 3 weeks. Do i fetch the lastest changes like this: git remote update git checkout master git pull origin master git checkout branch git pull master Remember to git stash your current working changes first... # Ensure you are in your local working git branch # (not your local master) git stash --all git checkout master git pull git checkout $WORKINGBRANCH git rebase master git stash pop and then handle any merge conflicts that may pop up. Best, -jay ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp
Re: [Openstack] [OpenStack][Nova] Issues with run_tests.sh, no tests are run when import libvirt is present
On Mon, Jul 02, 2012 at 01:43:31PM +0100, Leander Bessa Beernaert wrote: So, if no system packages can be imported, how do you test the connection class for the libvirt driver? How does that particular test case wrap around the fact that it requires the libvirt module? The only thing i could find are these lines of code in the driver's __init__ method. Do these somehow detect if this is a unit test environment and import the fakelibvirt driver instead? I'm no expert in python so i'm not sure what's happening there :s global libvirt if libvirt is None: libvirt = __import__('libvirt') If you have installed all the neccessary python packages on your local host, then it is entirely possible to run the Nova test suites without using virtualenv. You just need to pass the '-N' arg to the run_tests.sh script, eg on my Fedora 17 host, I can run ./run_tests.sh -N nova.tests.test_libvirt Regards, Daniel -- |: http://berrange.com -o-http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :| ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp
Re: [Openstack] [OpenStack][Nova] Issues with run_tests.sh, no tests are run when import libvirt is present
Running with ./run_tests.sh -N nova.tests.test_libvirt works just fine, however i don't know if this is enough to get it past jenkins :/ On Mon, Jul 2, 2012 at 3:26 PM, Daniel P. Berrange berra...@redhat.comwrote: On Mon, Jul 02, 2012 at 01:43:31PM +0100, Leander Bessa Beernaert wrote: So, if no system packages can be imported, how do you test the connection class for the libvirt driver? How does that particular test case wrap around the fact that it requires the libvirt module? The only thing i could find are these lines of code in the driver's __init__ method. Do these somehow detect if this is a unit test environment and import the fakelibvirt driver instead? I'm no expert in python so i'm not sure what's happening there :s global libvirt if libvirt is None: libvirt = __import__('libvirt') If you have installed all the neccessary python packages on your local host, then it is entirely possible to run the Nova test suites without using virtualenv. You just need to pass the '-N' arg to the run_tests.sh script, eg on my Fedora 17 host, I can run ./run_tests.sh -N nova.tests.test_libvirt Regards, Daniel -- |: http://berrange.com -o-http://www.flickr.com/photos/dberrange/:| |: http://libvirt.org -o- http://virt-manager.org:| |: http://autobuild.org -o- http://search.cpan.org/~danberr/:| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc:| ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp
Re: [Openstack] [OpenStack][Nova] Issues with run_tests.sh, no tests are run when import libvirt is present
Run: sudo pip install tox And you will get the tox command. Does ./run_tests.sh -N nova.tests.test_libvirt work fine when you _don't_ have libvirt? It needs to skip the test if you don't have libvirt installed, and it needs to run it and pass if you do. Jenkins is going to run tox -v -epy27 and then eventually also tox -v -efull - so make sure both of those work and you'll be set. Monty On 07/02/2012 10:30 AM, Leander Bessa Beernaert wrote: Running with ./run_tests.sh -N nova.tests.test_libvirt works just fine, however i don't know if this is enough to get it past jenkins :/ On Mon, Jul 2, 2012 at 3:26 PM, Daniel P. Berrange berra...@redhat.com mailto:berra...@redhat.com wrote: On Mon, Jul 02, 2012 at 01:43:31PM +0100, Leander Bessa Beernaert wrote: So, if no system packages can be imported, how do you test the connection class for the libvirt driver? How does that particular test case wrap around the fact that it requires the libvirt module? The only thing i could find are these lines of code in the driver's __init__ method. Do these somehow detect if this is a unit test environment and import the fakelibvirt driver instead? I'm no expert in python so i'm not sure what's happening there :s global libvirt if libvirt is None: libvirt = __import__('libvirt') If you have installed all the neccessary python packages on your local host, then it is entirely possible to run the Nova test suites without using virtualenv. You just need to pass the '-N' arg to the run_tests.sh script, eg on my Fedora 17 host, I can run ./run_tests.sh -N nova.tests.test_libvirt Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :| ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp
Re: [Openstack] [OpenStack][Nova] Issues with run_tests.sh, no tests are run when import libvirt is present
I have never tested it on a machine which doesn't have libvirt, i'll get back to you on that. I've ran tox -v -epy27 and it produced this ouput -- Ran 0 tests in 0.001s OK _ summary _ py27: commands succeeded congratulations :) and this is the output produced by tox -v -efull: -- Ran 3046 tests in 217.842s OK (SKIP=5) Exception KeyError: KeyError(25433840,) in module 'threading' from '/usr/lib/python2.7/threading.pyc' ignored _ summary _ full: commands succeeded congratulations :) I think the problem still remains :S On Mon, Jul 2, 2012 at 4:48 PM, Monty Taylor mord...@inaugust.com wrote: Run: sudo pip install tox And you will get the tox command. Does ./run_tests.sh -N nova.tests.test_libvirt work fine when you _don't_ have libvirt? It needs to skip the test if you don't have libvirt installed, and it needs to run it and pass if you do. Jenkins is going to run tox -v -epy27 and then eventually also tox -v -efull - so make sure both of those work and you'll be set. Monty On 07/02/2012 10:30 AM, Leander Bessa Beernaert wrote: Running with ./run_tests.sh -N nova.tests.test_libvirt works just fine, however i don't know if this is enough to get it past jenkins :/ On Mon, Jul 2, 2012 at 3:26 PM, Daniel P. Berrange berra...@redhat.com mailto:berra...@redhat.com wrote: On Mon, Jul 02, 2012 at 01:43:31PM +0100, Leander Bessa Beernaert wrote: So, if no system packages can be imported, how do you test the connection class for the libvirt driver? How does that particular test case wrap around the fact that it requires the libvirt module? The only thing i could find are these lines of code in the driver's __init__ method. Do these somehow detect if this is a unit test environment and import the fakelibvirt driver instead? I'm no expert in python so i'm not sure what's happening there :s global libvirt if libvirt is None: libvirt = __import__('libvirt') If you have installed all the neccessary python packages on your local host, then it is entirely possible to run the Nova test suites without using virtualenv. You just need to pass the '-N' arg to the run_tests.sh script, eg on my Fedora 17 host, I can run ./run_tests.sh -N nova.tests.test_libvirt Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :| ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp
[Openstack] [OpenStack][Nova] Issues with run_tests.sh, no tests are run when import libvirt is present
Hello, I'm sorry to restart the topic ( https://lists.launchpad.net/openstack/msg13621.html), but i accidentally deleted the message in my inbox :S. I'm still having the same problem, each time i add import libvirt to the file diangostics.py (https://review.openstack.org/#/c/8839/) the entire test suit won't run. *With the import* present i get the following output: -- Ran 0 tests in 0.000s OK Running PEP8 and HACKING compliance check... 2 imports missing in this test environment *Without the import *present it get this output: -- Ran 3030 tests in 233.326s OK (SKIP=22) Running PEP8 and HACKING compliance check... 11 imports missing in this test environment The problem now is that, according to the OpenStack conventions, the import must be present. However, with the import present i can't get any of the tests to run. I'm no expert in Python, so could someone please help me out here? Regards, Leander ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp