← Back to team overview

openstack team mailing list archive

Re: Melange Unittests

 

Copying  /opt/stack/mélange/etc/mélange/mélange.conf to /etc resolved the problem i.e. test cases started executing.
But that seems like BAD idea since running test cases trashed my DB ( I have single box devstack installation)

-Mandar

-----Original Message-----
From: Vaze, Mandar 
Sent: Monday, April 09, 2012 11:49 AM
To: 'Jason Kölker'; openstack@xxxxxxxxxxxxxxxxxxx
Subject: RE: [Openstack] Melange Unittests

Commenting line 32-EOF from setup.cfg didn't help I also pip installed openstack.nose_plugin - still didn't help

Even if I try to run single test module, I still see same error(s) e.g. "python run_tests.py unit.test_ipam_models"
I run these from /opt/stack/mélange

Here are the actual/detailed errors I see :

======================================================================
ERROR: <nose.suite.ContextSuite context=melange.tests.functional>
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/nose/suite.py", line 208, in run
    self.setUp()
  File "/usr/lib/pymodules/python2.7/nose/suite.py", line 291, in setUp
    self.setupContext(ancestor)
  File "/usr/lib/pymodules/python2.7/nose/suite.py", line 314, in setupContext
    try_run(context, names)
  File "/usr/lib/pymodules/python2.7/nose/util.py", line 478, in try_run
    return func()
  File "/opt/stack/melange/melange/tests/functional/__init__.py", line 32, in setup
    db_api.db_reset(conf, db_based_ip_generator, db_based_mac_generator)
  File "/opt/stack/melange/melange/db/sqlalchemy/api.py", line 259, in db_reset
    db_sync(options)
  File "/opt/stack/melange/melange/db/sqlalchemy/api.py", line 246, in db_sync
    migration.db_sync(options, version, repo_path)
  File "/opt/stack/melange/melange/db/sqlalchemy/migration.py", line 124, in db_sync
    upgrade(options, version=version, repo_path=repo_path)
  File "/opt/stack/melange/melange/db/sqlalchemy/migration.py", line 66, in upgrade
    return versioning_api.upgrade(sql_connection, repo_path, version)
  File "/usr/lib/python2.7/dist-packages/migrate/versioning/api.py", line 186, in upgrade
    return _migrate(url, repository, version, upgrade=True, err=err, **opts)
  File "<string>", line 2, in _migrate
  File "/usr/lib/python2.7/dist-packages/migrate/versioning/util/__init__.py", line 159, in with_engine
    return f(*a, **kw)
  File "/usr/lib/python2.7/dist-packages/migrate/versioning/api.py", line 365, in _migrate
    schema.runchange(ver, change, changeset.step)
  File "/usr/lib/python2.7/dist-packages/migrate/versioning/schema.py", line 91, in runchange
    change.run(self.engine, step)
  File "/usr/lib/python2.7/dist-packages/migrate/versioning/script/py.py", line 145, in run
    script_func(engine)
  File "/opt/stack/melange/melange/db/sqlalchemy/migrate_repo/versions/002_device_id_to_uuid.py", line 29, in upgrade
    _db_connect()
  File "/opt/stack/melange/melange/db/sqlalchemy/migrate_repo/versions/002_device_id_to_uuid.py", line 62, in _db_connect
    conf, app = config.Config.load_paste_app('melange', options, args)
  File "/opt/stack/melange/melange/common/config.py", line 37, in load_paste_app
    conf, app = openstack_config.load_paste_app(*args, **kwargs)
  File "/opt/stack/melange/melange/openstack/common/config.py", line 283, in load_paste_app
    args, config_dir)
  File "/opt/stack/melange/melange/openstack/common/config.py", line 252, in load_paste_config
    "Cannot load application %s" % app_name)
RuntimeError: Unable to locate any configuration file. Cannot load application mélange


-Mandar


-----Original Message-----
From: openstack-bounces+mandar.vaze=nttdata.com@xxxxxxxxxxxxxxxxxxx [mailto:openstack-bounces+mandar.vaze=nttdata.com@xxxxxxxxxxxxxxxxxxx] On Behalf Of Jason Kölker
Sent: Friday, April 06, 2012 8:21 PM
To: openstack@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Openstack] Melange Unittests

On Fri, 2012-04-06 at 13:11 +0000, Vaze, Mandar wrote:
> I tried to run ./run_tests.sh (without virtualenv) I kept on getting error related to "unable to find config file"
> I ran the tests from /opt/stack/mélange Same errors when I run "python 
> run_tests.py"
> /opt/stack/mélange/etc/mélange/mélange.conf is present and valid.
> 
> How do I pass the config file to run_tests ? (Shouldn't it pick it up
> automatically)

The nova test runner is busted. We had converted it to use tox, but as Brian/James has found out there is an issue with the openstack.nose_plugin and something in melange causing tests to not be picked up by the collector.

For the time being edit setup.cfg and comment out lines 32-EOF. Since melange is merging with quantum, my plan is to fix them as I merge them into the quantum tests.

Happy Hacking!

7-11


_______________________________________________
Mailing list: https://launchpad.net/~openstack
Post to     : openstack@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~openstack
More help   : https://help.launchpad.net/ListHelp

______________________________________________________________________
Disclaimer:This email and any attachments are sent in strictest confidence for the sole use of the addressee and may contain legally privileged, confidential, and proprietary data.  If you are not the intended recipient, please advise the sender by replying promptly to this email and then delete and destroy this email and any attachments without any further use, copying or forwarding

References