[Nodeshot] failing tests
Nemesis
nemesis at ninux.org
Wed Apr 15 17:30:36 CEST 2015
I see.
Do you know this? https://github.com/ninuxorg/nodeshot/tree/master/tests
It's the test app that is used for automated testing on travic-ci.org
and on my jenkins instance.
I suggest you to do the following:
1. setup a local_settings.py in tests/ci/ with your test database
settings, copy it from this one:
https://github.com/ninuxorg/nodeshot/blob/master/tests/ci/local_settings.example.py
2. try running ./manage.py syncdb in tests/ to ensure everything works out
3. then run ./runtests.py, this one:
https://github.com/ninuxorg/nodeshot/blob/master/tests/runtests.py
Fed
On 04/15/2015 05:24 PM, Eden Ray Gardner wrote:
> Hi Federico,
>
> I am in Pycharm and rightclick at the highest nodeshot folder..., so
> that probably runs 'everything' as you mentioned. I have to check how
> to run django test properly in pycharm then...
>
> Thanks,
>
> Eden
>
> 2015-04-15 17:21 GMT+02:00 Nemesis <nemesis at ninux.org
> <mailto:nemesis at ninux.org>>:
>
> Hey Eden,
>
> what command are you using to run the tests?
>
> The error you're getting is from the new nodeshot.core.metrics
> django app, which is still disabled by default, so you should not
> get this error unless you enabled it or unless you're using a
> command that runs all the unit tests, even for the modules which
> are disabled.
>
> The tests should be run by doing something like:
>
> cd tests/
> ./runtests.py
>
> (assuming the database in the test settings are configured correctly)
>
> Federico
>
>
>
> On 04/15/2015 04:03 PM, Eden Ray Gardner wrote:
>> Hello,
>>
>> I used current build of nodeshot and had it tested on shippable
>> and all 250 tests passed. However when I run the tests on my
>> local machine I keep getting three failing tests. Any help?:
>>
>> This is output of my tests:
>>
>> Testing started at 15:45 ...
>> Creating test database for alias 'default'...
>> Type 'yes' if you would like to try deleting the test database
>> 'test_nodeshot', or 'no' to cancel: Got an error creating the
>> test database: database "test_nodeshot" already exists
>>
>> Destroying old test database 'default'...
>>
>>
>> [INFO 2015-04-15 15:45:38,126] module: base, process: 25464,
>> thread: 140337668454208
>> Raven is not configured (logging is disabled). Please see the
>> documentation for more information.
>>
>>
>> Error
>> Traceback (most recent call last):
>> File
>> "/usr/local/lib/virtualenvs/nodeshot/src/nodeshot/nodeshot/interop/oldimporter/tests.py",
>> line 35, in setUp
>> management.call_command('loaddata', fixture,
>> database='old_nodeshot')
>> File
>> "/usr/local/lib/virtualenvs/nodeshot/local/lib/python2.7/site-packages/django/core/management/__init__.py",
>> line 159, in call_command
>> return klass.execute(*args, **defaults)
>> File
>> "/usr/local/lib/virtualenvs/nodeshot/local/lib/python2.7/site-packages/django/core/management/base.py",
>> line 285, in execute
>> output = self.handle(*args, **options)
>> File
>> "/usr/local/lib/virtualenvs/nodeshot/local/lib/python2.7/site-packages/django/core/management/commands/loaddata.py",
>> line 54, in handle
>> with
>> transaction.commit_on_success_unless_managed(using=self.using):
>> File
>> "/usr/local/lib/virtualenvs/nodeshot/local/lib/python2.7/site-packages/django/db/transaction.py",
>> line 531, in commit_on_success_unless_managed
>> connection = get_connection(using)
>> File
>> "/usr/local/lib/virtualenvs/nodeshot/local/lib/python2.7/site-packages/django/db/transaction.py",
>> line 42, in get_connection
>> return connections[using]
>> File
>> "/usr/local/lib/virtualenvs/nodeshot/local/lib/python2.7/site-packages/django/db/utils.py",
>> line 196, in __getitem__
>> self.ensure_defaults(alias)
>> File
>> "/usr/local/lib/virtualenvs/nodeshot/local/lib/python2.7/site-packages/django/db/utils.py",
>> line 172, in ensure_defaults
>> raise ConnectionDoesNotExist("The connection %s doesn't
>> exist" % alias)
>> ConnectionDoesNotExist: The connection old_nodeshot doesn't exist
>>
>>
>> Error
>> Traceback (most recent call last):
>> File
>> "/usr/local/lib/virtualenvs/nodeshot/src/nodeshot/nodeshot/interop/sync/tests.py",
>> line 603, in test_nodeshot_sync
>> self.assertEqual(type(response.data['results']), list)
>> KeyError: 'results'
>>
>> there are no old notifications to purge
>>
>> found 1 notifications to purge...
>>
>> 1 notifications deleted successfully.
>>
>> found 1 notifications to purge...
>>
>> 1 notifications deleted successfully.
>>
>>
>> Error
>> ImportError: Failed to import test module:
>> nodeshot.core.metrics.tests
>> Traceback (most recent call last):
>> File "/usr/lib/python2.7/unittest/loader.py", line 254, in
>> _find_tests
>> module = self._get_module_from_name(name)
>> File "/usr/lib/python2.7/unittest/loader.py", line 232, in
>> _get_module_from_name
>> __import__(name)
>> File
>> "/usr/local/lib/virtualenvs/nodeshot/src/nodeshot/nodeshot/core/metrics/__init__.py",
>> line 4, in <module>
>> from .utils import create_database
>> File
>> "/usr/local/lib/virtualenvs/nodeshot/src/nodeshot/nodeshot/core/metrics/utils.py",
>> line 5, in <module>
>> from . import settings
>> File
>> "/usr/local/lib/virtualenvs/nodeshot/src/nodeshot/nodeshot/core/metrics/settings.py",
>> line 5, in <module>
>> INFLUXDB_USER = getattr(settings, 'INFLUXDB_USER')
>> File
>> "/usr/local/lib/virtualenvs/nodeshot/local/lib/python2.7/site-packages/django/conf/__init__.py",
>> line 55, in __getattr__
>> return getattr(self._wrapped, name)
>> AttributeError: 'Settings' object has no attribute 'INFLUXDB_USER'
>>
>>
>> Destroying test database for alias 'default'...
>>
>> Process finished with exit code 1
>>
>>
>> _______________________________________________
>> Nodeshot mailing list
>> Nodeshot at ml.ninux.org <mailto:Nodeshot at ml.ninux.org>
>> http://ml.ninux.org/mailman/listinfo/nodeshot
>
>
> _______________________________________________
> Nodeshot mailing list
> Nodeshot at ml.ninux.org <mailto:Nodeshot at ml.ninux.org>
> http://ml.ninux.org/mailman/listinfo/nodeshot
>
>
>
>
> _______________________________________________
> Nodeshot mailing list
> Nodeshot at ml.ninux.org
> http://ml.ninux.org/mailman/listinfo/nodeshot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ml.ninux.org/pipermail/nodeshot/attachments/20150415/362e8c74/attachment-0001.html>
More information about the Nodeshot
mailing list