[openstack-dev] [metering] can't get tests to pass locally
Doug Hellmann
doug.hellmann at dreamhost.com
Mon Aug 6 21:11:38 UTC 2012
On Mon, Aug 6, 2012 at 3:26 PM, John Tran <njhtran at gmail.com> wrote:
> Doug,
>
> Thanks for helping me out. I'm using a real MongoDB instance and the
> python-pymongo dpkg installed is version 2.1-1
>
It's possible that method was added in PyMongo 2.2. I have "pymongo==2.2.1"
from pip.
If updating fixes your tests we should peg the version in our requirements
file.
Doug
>
> On Mon, Aug 6, 2012 at 12:13 PM, Doug Hellmann
> <doug.hellmann at dreamhost.com> wrote:
> > On Mon, Aug 6, 2012 at 1:21 PM, John Tran <njhtran at gmail.com> wrote:
> >>
> >> I'm having trouble getting all the tests to pass locally. I'm using
> >> the run_tests.sh as well as tox -epy27 the same results. I attempted
> >> to look into the console output for all 3 daemons to see why I'm
> >> getting a 500 internal server error on the first few fails but didn't
> >> see any output. I can dig into it deeper but I'm hoping someone else
> >> has run into this and know off the top of their head a quick fix.
> >>
> >> ======================================================================
> >> ERROR: test_empty (tests.api.v1.test_list_users.TestListUsers)
> >> ----------------------------------------------------------------------
> >> Traceback (most recent call last):
> >> File "/opt/stack/ceilometer/tests/api/v1/test_list_users.py", line
> >> 35, in test_empty
> >> data = self.get('/users')
> >> File "/opt/stack/ceilometer/ceilometer/tests/api.py", line 82, in get
> >> data = json.loads(rv.data)
> >> File "/usr/lib/python2.7/json/__init__.py", line 326, in loads
> >> return _default_decoder.decode(s)
> >> File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
> >> obj, end = self.raw_decode(s, idx=_w(s, 0).end())
> >> File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
> >> raise ValueError("No JSON object could be decoded")
> >> ValueError: No JSON object could be decoded
> >> -------------------- >> begin captured stdout << ---------------------
> >> RAW DATA: <Response 291 bytes [500 INTERNAL SERVER ERROR]>
> >>
> >> --------------------- >> end captured stdout << ----------------------
> >> -------------------- >> begin captured logging << --------------------
> >> ceilometer.storage.impl_mongodb: INFO: connecting to MongoDB on
> >> localhost:27017
> >> ceilometer.tests.api: DEBUG: Unable to connect to mongod, falling back
> to
> >> MIM
> >> test: ERROR: Exception on /users [GET]
> >> Traceback (most recent call last):
> >> File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line
> >> 1687, in wsgi_app
> >> response = self.full_dispatch_request()
> >> File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line
> >> 1360, in full_dispatch_request
> >> rv = self.handle_user_exception(e)
> >> File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line
> >> 1358, in full_dispatch_request
> >> rv = self.dispatch_request()
> >> File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line
> >> 1344, in dispatch_request
> >> return self.view_functions[rule.endpoint](**req.view_args)
> >> File "/opt/stack/ceilometer/ceilometer/api/v1.py", line 49, in
> >> list_users
> >> users = flask.request.storage_conn.get_users(source=source)
> >> File "/opt/stack/ceilometer/ceilometer/storage/impl_mongodb.py",
> >> line 261, in get_users
> >> return self.db.user.distinct('_id')
> >> File "/usr/lib/python2.7/dist-packages/pymongo/collection.py", line
> >> 1011, in distinct
> >> return self.find().distinct(key)
> >> AttributeError: 'Cursor' object has no attribute 'distinct'
> >
> >
> > Are you running the tests against a real MongoDB instance or with the MiM
> > (Mongo in Memory) implementation from Ming?
> >
> > Which version of PyMongo do you have and how was it installed?
> >
> > Doug
> >
> >
> > _______________________________________________
> > OpenStack-dev mailing list
> > OpenStack-dev at lists.openstack.org
> > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> >
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20120806/8eb5d718/attachment.html>
More information about the OpenStack-dev
mailing list