From 23919dfbc6cb480ca44e0326ffeb98fe279f19c6 Mon Sep 17 00:00:00 2001 From: Nate Coraor Date: Mon, 16 Apr 2012 14:56:24 -0400 Subject: [PATCH] Fix job manager/handler shutdown, functional tests due to referer -> redirect rename, and check_galaxy script for dataset display -> html table change. --- lib/galaxy/jobs/handler.py | 4 ++-- lib/galaxy/jobs/manager.py | 1 - scripts/check_galaxy.py | 2 +- test/base/twilltestcase.py | 14 +++++++------- test/functional/test_admin_features.py | 6 +++--- 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/lib/galaxy/jobs/handler.py b/lib/galaxy/jobs/handler.py index 878973aadcd..82e6e233528 100644 --- a/lib/galaxy/jobs/handler.py +++ b/lib/galaxy/jobs/handler.py @@ -255,7 +255,7 @@ class JobHandlerQueue( object ): else: log.info( "sending stop signal to worker thread" ) self.running = False - if not self.track_jobs_in_database: + if not self.app.config.track_jobs_in_database: self.queue.put( self.STOP_SIGNAL ) self.sleeper.wake() log.info( "job handler queue stopped" ) @@ -352,7 +352,7 @@ class JobHandlerStopQueue( object ): else: log.info( "sending stop signal to worker thread" ) self.running = False - if not self.track_jobs_in_database: + if not self.app.config.track_jobs_in_database: self.queue.put( self.STOP_SIGNAL ) self.sleeper.wake() log.info( "job handler stop queue stopped" ) diff --git a/lib/galaxy/jobs/manager.py b/lib/galaxy/jobs/manager.py index a2840ad5bf0..b5d0cdc0a9d 100644 --- a/lib/galaxy/jobs/manager.py +++ b/lib/galaxy/jobs/manager.py @@ -186,7 +186,6 @@ class JobManagerQueue( object ): self.queue.put( self.STOP_SIGNAL ) self.sleeper.wake() log.info( "job manager queue stopped" ) - self.dispatcher.shutdown() class JobManagerStopQueue( object ): """ diff --git a/scripts/check_galaxy.py b/scripts/check_galaxy.py index f4f418516c0..e2ce1001aa3 100755 --- a/scripts/check_galaxy.py +++ b/scripts/check_galaxy.py @@ -249,7 +249,7 @@ class Browser: #return((p.id, p.status)) def diff(self): - self.get("/datasets/%s/display/index" % self.id) + self.get("/datasets/%s/display/display?to_ext=bed" % self.id) data = tc.browser.get_html() tmp = tempfile.mkstemp() dprint("tmp file: %s" % tmp[1]) diff --git a/test/base/twilltestcase.py b/test/base/twilltestcase.py index 9cfa774f8a9..976a500251e 100644 --- a/test/base/twilltestcase.py +++ b/test/base/twilltestcase.py @@ -826,13 +826,13 @@ class TwillTestCase( unittest.TestCase ): self.assertTrue( genome_build == dbkey ) # Functions associated with user accounts - def create( self, cntrller='user', email='test@bx.psu.edu', password='testuser', username='admin-user', webapp='galaxy', referer='' ): + def create( self, cntrller='user', email='test@bx.psu.edu', password='testuser', username='admin-user', webapp='galaxy', redirect='' ): # HACK: don't use panels because late_javascripts() messes up the twill browser and it # can't find form fields (and hence user can't be logged in). self.visit_url( "%s/user/create?cntrller=%s&use_panels=False" % ( self.url, cntrller ) ) tc.fv( '1', 'email', email ) tc.fv( '1', 'webapp', webapp ) - tc.fv( '1', 'referer', referer ) + tc.fv( '1', 'redirect', redirect ) tc.fv( '1', 'password', password ) tc.fv( '1', 'confirm', password ) tc.fv( '1', 'username', username ) @@ -936,10 +936,10 @@ class TwillTestCase( unittest.TestCase ): self.visit_url( "%s/%s" % ( self.url, url ) ) self.check_page_for_string( 'Default history permissions have been changed.' ) self.home() - def login( self, email='test@bx.psu.edu', password='testuser', username='admin-user', webapp='galaxy', referer='' ): + def login( self, email='test@bx.psu.edu', password='testuser', username='admin-user', webapp='galaxy', redirect='' ): # test@bx.psu.edu is configured as an admin user previously_created, username_taken, invalid_username = \ - self.create( email=email, password=password, username=username, webapp=webapp, referer=referer ) + self.create( email=email, password=password, username=username, webapp=webapp, redirect=redirect ) if previously_created: # The acount has previously been created, so just login. # HACK: don't use panels because late_javascripts() messes up the twill browser and it @@ -947,7 +947,7 @@ class TwillTestCase( unittest.TestCase ): self.visit_url( "%s/user/login?use_panels=False" % self.url ) tc.fv( '1', 'email', email ) tc.fv( '1', 'webapp', webapp ) - tc.fv( '1', 'referer', referer ) + tc.fv( '1', 'redirect', redirect ) tc.fv( '1', 'password', password ) tc.submit( 'login_button' ) def logout( self ): @@ -1212,14 +1212,14 @@ class TwillTestCase( unittest.TestCase ): # Dataset Security stuff # Tests associated with users def create_new_account_as_admin( self, email='test4@bx.psu.edu', password='testuser', - username='regular-user4', webapp='galaxy', referer='' ): + username='regular-user4', webapp='galaxy', redirect='' ): """Create a new account for another user""" # HACK: don't use panels because late_javascripts() messes up the twill browser and it # can't find form fields (and hence user can't be logged in). self.visit_url( "%s/user/create?cntrller=admin" % self.url ) tc.fv( '1', 'email', email ) tc.fv( '1', 'webapp', webapp ) - tc.fv( '1', 'referer', referer ) + tc.fv( '1', 'redirect', redirect ) tc.fv( '1', 'password', password ) tc.fv( '1', 'confirm', password ) tc.fv( '1', 'username', username ) diff --git a/test/functional/test_admin_features.py b/test/functional/test_admin_features.py index 9cddedb3bf1..3b151b047dc 100644 --- a/test/functional/test_admin_features.py +++ b/test/functional/test_admin_features.py @@ -30,7 +30,7 @@ class TestDataSecurity( TwillTestCase ): password=password, username='admin-user', webapp='galaxy', - referer='' ) + redirect='' ) if not username_taken: raise AssertionError, "The public name (%s) is already being used by another user, but no error was displayed" \ % 'admin-user' @@ -40,14 +40,14 @@ class TestDataSecurity( TwillTestCase ): password=password, username='h', webapp='galaxy', - referer='' ) + redirect='' ) if not invalid_username: raise AssertionError, "The public name (%s) is is invalid, but no error was displayed" % username previously_created, username_taken, invalid_username = self.create_new_account_as_admin( email=email, password=password, username='regular-user3', webapp='galaxy', - referer='' ) + redirect='' ) # Get the user object for later tests global regular_user3 regular_user3 = get_user( email )