[gnocchi] Running tests

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[gnocchi] Running tests

aalvarez
Hello everyone

I am having a hard time in understanding the correct way to run the tests in Gnocchi. I have already read about tox and testr, but it seems I still can't get to run the tests.

Would really appreciate if someone could explain the steps necessary to get all tests running.

__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: [hidden email]?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Reply | Threaded
Open this post in threaded view
|

Re: [gnocchi] Running tests

Julien Danjou
On Tue, May 23 2017, Andres Alvarez wrote:

> Hello everyone
>
> I am having a hard time in understanding the correct way to run the tests
> in Gnocchi. I have already read about tox and testr, but it seems I still
> can't get to run the tests.

tox -e py27-postgresql-file

That'll run the test with PostgreSQL and the file storage backend.

tox -e py35-mysql-ceph

For MySQL and Ceph, etc.

That's all you need.

--
Julien Danjou
-- Free Software hacker
-- https://julien.danjou.info

__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: [hidden email]?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

signature.asc (815 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [gnocchi] Running tests

aalvarez
Ok so started the tests using:

tox -e py27-postgresql-file

The suite starts running fine, but then I get a failing test:

==============================
Failed 1 tests - output below:
==============================

gnocchi.tests.test_indexer.TestIndexerDriver.test_list_resources_without_history
--------------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):
      File "gnocchi/tests/base.py", line 57, in skip_if_not_implemented
        return func(*args, **kwargs)
      File "gnocchi/tests/test_indexer.py", line 839, in test_list_resources_without_history
        details=True)
      File "/home/ubuntu/workspace/gnocchi/.tox/py27-postgresql-file/local/lib/python2.7/site-packages/oslo_db/api.py", line 150, in wrapper
        ectxt.value = e.inner_exc
      File "/home/ubuntu/workspace/gnocchi/.tox/py27-postgresql-file/local/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__
        self.force_reraise()
      File "/home/ubuntu/workspace/gnocchi/.tox/py27-postgresql-file/local/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
        six.reraise(self.type_, self.value, self.tb)
      File "/home/ubuntu/workspace/gnocchi/.tox/py27-postgresql-file/local/lib/python2.7/site-packages/oslo_db/api.py", line 138, in wrapper
        return f(*args, **kwargs)
      File "gnocchi/indexer/sqlalchemy.py", line 1048, in list_resources
        all_resources.extend(q.all())
      File "/home/ubuntu/workspace/gnocchi/.tox/py27-postgresql-file/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2703, in all
        return list(self)
      File "/home/ubuntu/workspace/gnocchi/.tox/py27-postgresql-file/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2855, in __iter__
        return self._execute_and_instances(context)
      File "/home/ubuntu/workspace/gnocchi/.tox/py27-postgresql-file/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2878, in _execute_and_instances
        result = conn.execute(querycontext.statement, self._params)
      File "/home/ubuntu/workspace/gnocchi/.tox/py27-postgresql-file/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 945, in execute
        return meth(self, multiparams, params)
      File "/home/ubuntu/workspace/gnocchi/.tox/py27-postgresql-file/local/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 263, in _execute_on_connection
        return connection._execute_clauseelement(self, multiparams, params)
      File "/home/ubuntu/workspace/gnocchi/.tox/py27-postgresql-file/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1046, in _execute_clauseelement
        if not self.schema_for_object.is_default else None)
      File "<string>", line 1, in <lambda>
      File "/home/ubuntu/workspace/gnocchi/.tox/py27-postgresql-file/local/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 436, in compile
        return self._compiler(dialect, bind=bind, **kw)
      File "/home/ubuntu/workspace/gnocchi/.tox/py27-postgresql-file/local/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 442, in _compiler
        return dialect.statement_compiler(dialect, self, **kw)
      File "/home/ubuntu/workspace/gnocchi/.tox/py27-postgresql-file/local/lib/python2.7/site-packages/sqlalchemy/sql/compiler.py", line 435, in __init__
        Compiled.__init__(self, dialect, statement, **kwargs)
      File "/home/ubuntu/workspace/gnocchi/.tox/py27-postgresql-file/local/lib/python2.7/site-packages/sqlalchemy/sql/compiler.py", line 216, in __init__
        self.string = self.process(self.statement, **compile_kwargs)
      File "/home/ubuntu/workspace/gnocchi/.tox/py27-postgresql-file/local/lib/python2.7/site-packages/sqlalchemy/sql/compiler.py", line 242, in process
        return obj._compiler_dispatch(self, **kwargs)
      File "/home/ubuntu/workspace/gnocchi/.tox/py27-postgresql-file/local/lib/python2.7/site-packages/sqlalchemy/sql/visitors.py", line 81, in _compiler_dispatch
        return meth(self, **kw)
      File "/home/ubuntu/workspace/gnocchi/.tox/py27-postgresql-file/local/lib/python2.7/site-packages/sqlalchemy/sql/compiler.py", line 1716, in visit_select
        for name, column in select._columns_plus_names
      File "/home/ubuntu/workspace/gnocchi/.tox/py27-postgresql-file/local/lib/python2.7/site-packages/sqlalchemy/sql/compiler.py", line 1488, in _label_select_column
        **column_clause_args
      File "/home/ubuntu/workspace/gnocchi/.tox/py27-postgresql-file/local/lib/python2.7/site-packages/sqlalchemy/sql/visitors.py", line 75, in _compiler_dispatch
        def _compiler_dispatch(self, visitor, **kw):
      File "/home/ubuntu/workspace/gnocchi/.tox/py27-postgresql-file/local/lib/python2.7/site-packages/fixtures/_fixtures/timeout.py", line 52, in signal_handler
        raise TimeoutException()
    fixtures._fixtures.timeout.TimeoutException
   


======
Totals
======
Ran: 1264 tests in 845.0000 sec.
 - Passed: 1223
 - Skipped: 40
 - Expected Fail: 0
 - Unexpected Success: 0
 - Failed: 1
Sum of execute time for each test: 4353.1843 sec.

ERROR: InvocationError: '/home/ubuntu/workspace/gnocchi/run-tests.sh'
________________________________________________________________________________________________________ summary ________________________________________________________________________________________________________
ERROR:   py27-postgresql-file: commands failed

This is a fresh clone so I am not sure what's wrong. My postgresql service is running fine too.
Reply | Threaded
Open this post in threaded view
|

Re: [gnocchi] Running tests

Julien Danjou
On Tue, May 23 2017, aalvarez wrote:

> Ok so started the tests using:
>
> tox -e py27-postgresql-file
>
> The suite starts running fine, but then I get a failing test:

Can you reproduce it each time?

That's weird, I don't think we ever saw that.

--
Julien Danjou
;; Free Software hacker
;; https://julien.danjou.info

__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: [hidden email]?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

signature.asc (815 bytes) Download Attachment