Opened 12 years ago

Closed 12 years ago

#442 closed defect (fixed)

migration tests fail

Reported by: Will Kahn-Greene Owned by:
Priority: blocker Milestone: 0.3.0
Component: programming Keywords:
Cc: Parent Tickets:

Description

Given that we don't need mongodb things installed anymore and we're removing the installation instructions from the documentation, it shouldn't be the case that tests fail if you don't have it installed.

These tests should get fixed so that they get skipped if mongodb is either not installed or not running. nose is super duper for this sort of thing.

(M=d2eab local) saturn ~/projects/mediagoblin> ./runtests.sh 
Using ./bin/nosetests
..../home/willkg/projects/mediagoblin/local/lib/python2.7/site-packages/SQLAlchemy-0.7.6-py2.7-linux-i686.egg/sqlalchemy/engine/default.py:461: SAWarning: Unicode type received non-unicode bind param value.
  param.append(processors[key](compiled_params[key]))
................/home/willkg/projects/mediagoblin/mediagoblin/db/sql/open.py:63: SAWarning: At least one scoped session is already present.  configure() can not affect sessions that have already been created.
  Session.configure(bind=engine)
.EEEEEEE..........................................
======================================================================
ERROR: Make sure that if we don't have a migration_status
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 381, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/usr/lib/python2.7/dist-packages/nose/util.py", line 478, in try_run
    return func()
  File "/home/willkg/projects/mediagoblin/mediagoblin/tests/test_migrations.py", line 273, in setUp
    self.connection = Connection()
  File "/home/willkg/projects/mediagoblin/local/lib/python2.7/site-packages/pymongo-2.1.1-py2.7-linux-i686.egg/pymongo/connection.py", line 381, in __init__
    self.__find_node()
  File "/home/willkg/projects/mediagoblin/local/lib/python2.7/site-packages/pymongo-2.1.1-py2.7-linux-i686.egg/pymongo/connection.py", line 659, in __find_node
    raise AutoReconnect(', '.join(errors))
AutoReconnect: could not connect to localhost:27017: [Errno 111] Connection refused

======================================================================
ERROR: Make sure that migrations get registered and are sorted right
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 381, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/usr/lib/python2.7/dist-packages/nose/util.py", line 478, in try_run
    return func()
  File "/home/willkg/projects/mediagoblin/mediagoblin/tests/test_migrations.py", line 273, in setUp
    self.connection = Connection()
  File "/home/willkg/projects/mediagoblin/local/lib/python2.7/site-packages/pymongo-2.1.1-py2.7-linux-i686.egg/pymongo/connection.py", line 381, in __init__
    self.__find_node()
  File "/home/willkg/projects/mediagoblin/local/lib/python2.7/site-packages/pymongo-2.1.1-py2.7-linux-i686.egg/pymongo/connection.py", line 659, in __find_node
    raise AutoReconnect(', '.join(errors))
AutoReconnect: could not connect to localhost:27017: [Errno 111] Connection refused

======================================================================
ERROR: Make sure we get the right list of migrations to run
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 381, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/usr/lib/python2.7/dist-packages/nose/util.py", line 478, in try_run
    return func()
  File "/home/willkg/projects/mediagoblin/mediagoblin/tests/test_migrations.py", line 273, in setUp
    self.connection = Connection()
  File "/home/willkg/projects/mediagoblin/local/lib/python2.7/site-packages/pymongo-2.1.1-py2.7-linux-i686.egg/pymongo/connection.py", line 381, in __init__
    self.__find_node()
  File "/home/willkg/projects/mediagoblin/local/lib/python2.7/site-packages/pymongo-2.1.1-py2.7-linux-i686.egg/pymongo/connection.py", line 659, in __find_node
    raise AutoReconnect(', '.join(errors))
AutoReconnect: could not connect to localhost:27017: [Errno 111] Connection refused

======================================================================
ERROR: If we don't have the current migration set in the database,
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 381, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/usr/lib/python2.7/dist-packages/nose/util.py", line 478, in try_run
    return func()
  File "/home/willkg/projects/mediagoblin/mediagoblin/tests/test_migrations.py", line 273, in setUp
    self.connection = Connection()
  File "/home/willkg/projects/mediagoblin/local/lib/python2.7/site-packages/pymongo-2.1.1-py2.7-linux-i686.egg/pymongo/connection.py", line 381, in __init__
    self.__find_node()
  File "/home/willkg/projects/mediagoblin/local/lib/python2.7/site-packages/pymongo-2.1.1-py2.7-linux-i686.egg/pymongo/connection.py", line 659, in __find_node
    raise AutoReconnect(', '.join(errors))
AutoReconnect: could not connect to localhost:27017: [Errno 111] Connection refused

======================================================================
ERROR: Make sure that if we don't have a migration_status
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 381, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/usr/lib/python2.7/dist-packages/nose/util.py", line 478, in try_run
    return func()
  File "/home/willkg/projects/mediagoblin/mediagoblin/tests/test_migrations.py", line 273, in setUp
    self.connection = Connection()
  File "/home/willkg/projects/mediagoblin/local/lib/python2.7/site-packages/pymongo-2.1.1-py2.7-linux-i686.egg/pymongo/connection.py", line 381, in __init__
    self.__find_node()
  File "/home/willkg/projects/mediagoblin/local/lib/python2.7/site-packages/pymongo-2.1.1-py2.7-linux-i686.egg/pymongo/connection.py", line 659, in __find_node
    raise AutoReconnect(', '.join(errors))
AutoReconnect: could not connect to localhost:27017: [Errno 111] Connection refused

======================================================================
ERROR: Make sure that running the full migration suite from 0 updates
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 381, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/usr/lib/python2.7/dist-packages/nose/util.py", line 478, in try_run
    return func()
  File "/home/willkg/projects/mediagoblin/mediagoblin/tests/test_migrations.py", line 273, in setUp
    self.connection = Connection()
  File "/home/willkg/projects/mediagoblin/local/lib/python2.7/site-packages/pymongo-2.1.1-py2.7-linux-i686.egg/pymongo/connection.py", line 381, in __init__
    self.__find_node()
  File "/home/willkg/projects/mediagoblin/local/lib/python2.7/site-packages/pymongo-2.1.1-py2.7-linux-i686.egg/pymongo/connection.py", line 659, in __find_node
    raise AutoReconnect(', '.join(errors))
AutoReconnect: could not connect to localhost:27017: [Errno 111] Connection refused

======================================================================
ERROR: Make sure that running full migration suite from 3 only runs
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 381, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/usr/lib/python2.7/dist-packages/nose/util.py", line 478, in try_run
    return func()
  File "/home/willkg/projects/mediagoblin/mediagoblin/tests/test_migrations.py", line 273, in setUp
    self.connection = Connection()
  File "/home/willkg/projects/mediagoblin/local/lib/python2.7/site-packages/pymongo-2.1.1-py2.7-linux-i686.egg/pymongo/connection.py", line 381, in __init__
    self.__find_node()
  File "/home/willkg/projects/mediagoblin/local/lib/python2.7/site-packages/pymongo-2.1.1-py2.7-linux-i686.egg/pymongo/connection.py", line 659, in __find_node
    raise AutoReconnect(', '.join(errors))
AutoReconnect: could not connect to localhost:27017: [Errno 111] Connection refused

----------------------------------------------------------------------
Ran 70 tests in 86.665s

FAILED (errors=7)

Change History (1)

comment:1 by Christopher Allan Webber, 12 years ago

Resolution: fixed
Status: newclosed

Nice catch. This is old, crufty code. I've removed it.

Note: See TracTickets for help on using tickets.