Hi Peter, Could you set "debug = 'True'," in the kwargs dict in ./scripts/functional_tests.py and see if you get any more useful output? Thanks, --nate Peter wrote:
Hi all,
I'm having trouble with the Galaxy functional tests. On our Linux server things seem to work, but I'm having trouble on my Mac. This affects multiple tests.
For example, using a test for my own tool wrapper, on Linux my test passes. On my Mac, the tool is missing the required binary so I expect the test to fail with error level 127 and a message to stderr.
However, I get the following cryptic error:
$ ./run_functional_tests.sh -id tmhmm2 ... functional_tests.py INFO 2010-10-28 11:57:01,129 Embedded web server started functional_tests.py INFO 2010-10-28 11:57:01,185 Functional tests will be run against localhost:8980 nose.plugins.manager DEBUG 2010-10-28 11:57:01,210 DefaultPluginManager load plugin sqlalchemy = sqlalchemy.test.noseplugin:NoseSQLAlchemy nose.plugins.manager DEBUG 2010-10-28 11:57:01,215 DefaultPluginManager load plugin nosehtml = nosehtml.plugin:NoseHTML TMHMM 2.0 ( tmhmm2 ) > Test-1 ... Error - <type 'exceptions.TypeError'>: 'NoneType' object is not callable URL: http://localhost:8980/history File '/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Paste-1.7.2-py2.5.egg/paste/exceptions/errormiddleware.py', line 144 in __call__ app_iter = self.application(environ, sr_checker) File '/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Paste-1.7.2-py2.5.egg/paste/recursive.py', line 80 in __call__ return self.application(environ, start_response) File '/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Paste-1.7.2-py2.5.egg/paste/httpexceptions.py', line 636 in __call__ return self.application(environ, start_response) File '/Users/xxx/repositories/galaxy-central/lib/galaxy/web/framework/base.py', line 154 in __call__ return body( environ, start_response ) File '/Users/xxx/repositories/galaxy-central/lib/galaxy/web/framework/__init__.py', line 668 in render template.render_context( context ) File '/Users/xxx/repositories/galaxy-central/eggs/Mako-0.2.5-py2.5.egg/mako/template.py', line 146 in render_context runtime._render_context(self, self.callable_, context, *args, **kwargs) File '/Users/xxx/repositories/galaxy-central/eggs/Mako-0.2.5-py2.5.egg/mako/runtime.py', line 381 in _render_context _exec_template(inherit, lclcontext, args=args, kwargs=kwargs) File '/Users/xxx/repositories/galaxy-central/eggs/Mako-0.2.5-py2.5.egg/mako/runtime.py', line 414 in _exec_template callable_(context, *args, **kwargs) File '/Users/xxx/repositories/galaxy-central/database/compiled_templates/root/history.mako.py', line 55 in render_body __M_writer(u'\n<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\n\n<html>\n\n<head>\n<title>') File '/Users/xxx/repositories/galaxy-central/lib/galaxy/web/framework/__init__.py', line 665 in write response_write( d.encode( 'utf-8' ) ) TypeError: 'NoneType' object is not callable
CGI Variables ------------- CONTENT_LENGTH: '0' HTTP_ACCEPT: 'text/html; */*' HTTP_ACCEPT_ENCODING: 'identity' HTTP_CONNECTION: 'close' HTTP_COOKIE: '$Version=1; galaxysession=eb142648ac45b770a711a07bbd8189c4a80d9868f9ceff96f0635391728a47dfe5161bca180a2aae; $Path="/"' HTTP_HOST: 'localhost:8980' PATH_INFO: '/history' REMOTE_ADDR: '127.0.0.1' REQUEST_METHOD: 'GET' SERVER_NAME: '127.0.0.1' SERVER_PORT: '8980' SERVER_PROTOCOL: 'HTTP/1.1'
Configuration ------------- static_enabled: False use_translogger: False
WSGI Variables -------------- application: <paste.recursive.RecursiveMiddleware object at 0xbfd2e10> paste.cookies: (<SimpleCookie: galaxysession='eb142648ac45b770a711a07bbd8189c4a80d9868f9ceff96f0635391728a47dfe5161bca180a2aae'>, '$Version=1; galaxysession=eb142648ac45b770a711a07bbd8189c4a80d9868f9ceff96f0635391728a47dfe5161bca180a2aae; $Path="/"') paste.expected_exceptions: [<class 'paste.httpexceptions.HTTPException'>] paste.httpexceptions: <paste.httpexceptions.HTTPExceptionHandler object at 0xbfd3110> paste.httpserver.thread_pool: <paste.httpserver.ThreadPool object at 0xccf1f10> paste.recursive.forward: <paste.recursive.Forwarder from /> paste.recursive.include: <paste.recursive.Includer from /> paste.recursive.include_app_iter: <paste.recursive.IncluderAppIter from /> paste.recursive.script_name: '' paste.throw_errors: True webob._parsed_query_vars: (MultiDict([]), '') wsgi process: 'Multithreaded' ------------------------------------------------------------ ERROR
====================================================================== ERROR: TMHMM 2.0 ( tmhmm2 ) > Test-1 ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/xxx/repositories/galaxy-central/test/functional/test_toolbox.py", line 160, in test_tool self.do_it( td ) File "/Users/xxx/repositories/galaxy-central/test/functional/test_toolbox.py", line 24, in do_it self.new_history() File "/Users/xxx/repositories/galaxy-central/test/base/twilltestcase.py", line 291, in new_history self.check_history_for_string('Your history is empty') File "/Users/xxx/repositories/galaxy-central/test/base/twilltestcase.py", line 215, in check_history_for_string self.visit_page( "history" ) File "/Users/xxx/repositories/galaxy-central/test/base/twilltestcase.py", line 1040, in visit_page tc.code( 200 ) File "/Users/xxx/repositories/galaxy-central/eggs/twill-0.9-py2.5.egg/twill/commands.py", line 133, in code should_be)) TwillAssertionError: code is 500 != 200
---------------------------------------------------------------------- Ran 1 test in 0.824s
FAILED (errors=1) functional_tests.py INFO 2010-10-28 11:57:02,079 Shutting down functional_tests.py INFO 2010-10-28 11:57:02,079 Shutting down embedded web server ...
###############################################################################
Here is my suggested fix:
diff -r 82743fcbf23c lib/galaxy/web/framework/__init__.py --- a/lib/galaxy/web/framework/__init__.py Thu Oct 28 11:41:18 2010 +0100 +++ b/lib/galaxy/web/framework/__init__.py Thu Oct 28 11:56:16 2010 +0100 @@ -660,6 +660,9 @@ ## return template.render( **data ) def render( environ, start_response ): response_write = start_response( self.response.wsgi_status(), self.response.wsgi_headeritems() ) + if response_write is None: + log.error( "Error: this request returned None from start_response: %s" % self.request.browser_url ) + return [] class StreamBuffer( object ): def write( self, d ): response_write( d.encode( 'utf-8' ) )
###############################################################################
With the patch, I get:
$ ./run_functional_tests.sh -id tmhmm2 ... functional_tests.py INFO 2010-10-28 11:52:37,742 Embedded web server started functional_tests.py INFO 2010-10-28 11:52:37,800 Functional tests will be run against localhost:9383 nose.plugins.manager DEBUG 2010-10-28 11:52:37,825 DefaultPluginManager load plugin sqlalchemy = sqlalchemy.test.noseplugin:NoseSQLAlchemy nose.plugins.manager DEBUG 2010-10-28 11:52:37,829 DefaultPluginManager load plugin nosehtml = nosehtml.plugin:NoseHTML TMHMM 2.0 ( tmhmm2 ) > Test-1 ... galaxy.web.framework ERROR 2010-10-28 11:52:38,685 Error: this request returned None from start_response: http://localhost:9383/history ERROR
====================================================================== ERROR: TMHMM 2.0 ( tmhmm2 ) > Test-1 ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/xxx/repositories/galaxy-central/test/functional/test_toolbox.py", line 160, in test_tool self.do_it( td ) File "/Users/xxx/repositories/galaxy-central/test/functional/test_toolbox.py", line 24, in do_it self.new_history() File "/Users/xxx/repositories/galaxy-central/test/base/twilltestcase.py", line 291, in new_history self.check_history_for_string('Your history is empty') File "/Users/xxx/repositories/galaxy-central/test/base/twilltestcase.py", line 217, in check_history_for_string tc.find(subpatt) File "/Users/xxx/repositories/galaxy-central/eggs/twill-0.9-py2.5.egg/twill/commands.py", line 239, in find raise TwillAssertionError("no match to '%s'" % (what,)) TwillAssertionError: no match to 'Your' -------------------- >> begin captured logging << -------------------- galaxy.web.framework: ERROR: Error: this request returned None from start_response: http://localhost:9383/history --------------------- >> end captured logging << ---------------------
---------------------------------------------------------------------- Ran 1 test in 0.821s
FAILED (errors=1) functional_tests.py INFO 2010-10-28 11:52:38,691 Shutting down functional_tests.py INFO 2010-10-28 11:52:38,691 Shutting down embedded web server ...
###############################################################################
I'm still puzzled about what is going wrong - this affects other Galaxy tests as well - not just mine. Is there something obvious wrong with the setup on this machine? Actually using Galaxy running on this Mac seems to work.
Thanks,
Peter _______________________________________________ galaxy-dev mailing list galaxy-dev@lists.bx.psu.edu http://lists.bx.psu.edu/listinfo/galaxy-dev