commit/galaxy-central: greg: Handle exceptions when uninstalling repositories in the tool shed's install nad test framework.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/422f9675cb50/ Changeset: 422f9675cb50 User: greg Date: 2013-12-17 01:27:28 Summary: Handle exceptions when uninstalling repositories in the tool shed's install nad test framework. Affected #: 1 file diff -r 46521f5722c621a8b84d2a8101af87d82cc5eba8 -r 422f9675cb5025e20b402ad92aa591a87ca3a883 test/install_and_test_tool_shed_repositories/functional_tests.py --- a/test/install_and_test_tool_shed_repositories/functional_tests.py +++ b/test/install_and_test_tool_shed_repositories/functional_tests.py @@ -1220,9 +1220,9 @@ for owner, grouped_repository_dicts in repository_dicts_by_owner.items(): print "# " for repository_dict in grouped_repository_dicts: - name = repository_dict[ 'name' ] - owner = repository_dict[ 'owner' ] - changeset_revision = repository_dict[ 'changeset_revision' ] + name = str( repository_dict[ 'name' ] ) + owner = str( repository_dict[ 'owner' ] ) + changeset_revision = str( repository_dict[ 'changeset_revision' ] ) print "# Revision %s of repository %s owned by %s" % ( changeset_revision, name, owner ) def test_repository_tools( app, repository, repository_dict, tool_test_results_dicts, tool_test_results_dict, results_dict ): @@ -1328,15 +1328,20 @@ owner=owner, changeset_revision=changeset_revision ) log.debug( 'Revision %s of repository %s owned by %s selected for uninstallation.' % ( changeset_revision, name, owner ) ) - test_install_repositories.generate_uninstall_method( uninstall_repository_dict ) - # Set up nose to run the generated uninstall method as a functional test. - test_config = nose.config.Config( env=os.environ, plugins=nose.plugins.manager.DefaultPluginManager() ) - test_config.configure( sys.argv ) - # Run the uninstall method. This method uses the Galaxy web interface to uninstall the previously installed - # repository and all of its repository dependencies, deleting each of them from disk. - result, _ = run_tests( test_config ) - success = result.wasSuccessful() - if success: + try: + test_install_repositories.generate_uninstall_method( uninstall_repository_dict ) + # Set up nose to run the generated uninstall method as a functional test. + test_config = nose.config.Config( env=os.environ, plugins=nose.plugins.manager.DefaultPluginManager() ) + test_config.configure( sys.argv ) + # Run the uninstall method. This method uses the Galaxy web interface to uninstall the previously installed + # repository and all of its repository dependencies, deleting each of them from disk. + result, _ = run_tests( test_config ) + repository_uninstall_successful = result.wasSuccessful() + except Exception, e: + repository_uninstall_successful = False + log.exception( 'Uninstallation of revision %s of repository %s owned by %s failed: %s.' % \ + ( rd_changeset_revision, rd_name, rd_owner, str( e ) ) ) + if repository_uninstall_successful: # Now that the repository is uninstalled we can attempt to uninstall each of its repository dependencies. # We have to do this through Twill in order to maintain app.toolbox and shed_tool_conf.xml in a state that # is valid for future tests. Since some of the repository's repository dependencies may require other of @@ -1356,15 +1361,19 @@ ( rd_changeset_revision, rd_name, rd_owner ) ) # Generate a test method to uninstall the repository dependency through the embedded Galaxy application's # web interface. - test_install_repositories.generate_uninstall_method( uninstall_repository_dict ) - # Set up nose to run the generated uninstall method as a functional test. - test_config = nose.config.Config( env=os.environ, plugins=nose.plugins.manager.DefaultPluginManager() ) - test_config.configure( sys.argv ) - # Run the uninstall method. - result, _ = run_tests( test_config ) - success = result.wasSuccessful() - if not success: - log.debug( 'Uninstallation of revision %s of repository %s owned by %s failed: %s' % \ + try: + test_install_repositories.generate_uninstall_method( uninstall_repository_dict ) + # Set up nose to run the generated uninstall method as a functional test. + test_config = nose.config.Config( env=os.environ, plugins=nose.plugins.manager.DefaultPluginManager() ) + test_config.configure( sys.argv ) + # Run the uninstall method. + result, _ = run_tests( test_config ) + if not result.wasSuccessful(): + # We won't set ok here because we'll continue to uninstall whatever we can. + log.debug( 'Uninstallation of revision %s of repository %s owned by %s failed.' % \ + ( rd_changeset_revision, rd_name, rd_owner ) ) + except Exception, e: + log.exception( 'Uninstallation of revision %s of repository %s owned by %s failed: %s.' % \ ( rd_changeset_revision, rd_name, rd_owner, str( e ) ) ) else: log.debug( 'Uninstallation of revision %s of repository %s owned by %s failed.' % ( changeset_revision, name, owner ) ) Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org