1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/a0e80a712c37/ Changeset: a0e80a712c37 User: greg Date: 2013-12-19 18:49:50 Summary: Add a tool shed container to display successful repository and tool dependency installations and improve statistics and reporting in the tool shed's install and test runs. Affected #: 8 files
diff -r c1963ee06cb0fc066c111b23d99a3ea49d66f90b -r a0e80a712c37754d2d33260919469a7dccb2f1b1 lib/galaxy/model/tool_shed_install/__init__.py --- a/lib/galaxy/model/tool_shed_install/__init__.py +++ b/lib/galaxy/model/tool_shed_install/__init__.py @@ -265,8 +265,7 @@ """Return the repository's tool dependencies that are currently installed, but possibly in an error state.""" installed_dependencies = [] for tool_dependency in self.tool_dependencies: - if tool_dependency.status in [ ToolDependency.installation_status.INSTALLED, - ToolDependency.installation_status.ERROR ]: + if tool_dependency.status in [ ToolDependency.installation_status.INSTALLED ]: installed_dependencies.append( tool_dependency ) return installed_dependencies
@@ -442,6 +441,16 @@ return dependencies_being_installed
@property + def tool_dependencies_installed_or_in_error( self ): + """Return the repository's tool dependencies that are currently installed, but possibly in an error state.""" + installed_dependencies = [] + for tool_dependency in self.tool_dependencies: + if tool_dependency.status in [ ToolDependency.installation_status.INSTALLED, + ToolDependency.installation_status.ERROR ]: + installed_dependencies.append( tool_dependency ) + return installed_dependencies + + @property def tool_dependencies_missing_or_being_installed( self ): dependencies_missing_or_being_installed = [] for tool_dependency in self.tool_dependencies:
diff -r c1963ee06cb0fc066c111b23d99a3ea49d66f90b -r a0e80a712c37754d2d33260919469a7dccb2f1b1 lib/galaxy/tools/__init__.py --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -2733,7 +2733,7 @@ def build_dependency_shell_commands( self ): """Return a list of commands to be run to populate the current environment to include this tools requirements.""" if self.tool_shed_repository: - installed_tool_dependencies = self.tool_shed_repository.installed_tool_dependencies + installed_tool_dependencies = self.tool_shed_repository.tool_dependencies_installed_or_in_error else: installed_tool_dependencies = None return self.app.toolbox.dependency_manager.dependency_shell_commands( self.requirements,
diff -r c1963ee06cb0fc066c111b23d99a3ea49d66f90b -r a0e80a712c37754d2d33260919469a7dccb2f1b1 lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py --- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py +++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py @@ -255,7 +255,7 @@ tool_shed_repository.uninstalled = True # Remove all installed tool dependencies and tool dependencies stuck in the INSTALLING state, but don't touch any # repository dependencies. - tool_dependencies_to_uninstall = tool_shed_repository.installed_tool_dependencies + tool_dependencies_to_uninstall = tool_shed_repository.tool_dependencies_installed_or_in_error tool_dependencies_to_uninstall.extend( tool_shed_repository.tool_dependencies_being_installed ) for tool_dependency in tool_dependencies_to_uninstall: uninstalled, error_message = tool_dependency_util.remove_tool_dependency( trans.app, tool_dependency )
diff -r c1963ee06cb0fc066c111b23d99a3ea49d66f90b -r a0e80a712c37754d2d33260919469a7dccb2f1b1 lib/tool_shed/util/container_util.py --- a/lib/tool_shed/util/container_util.py +++ b/lib/tool_shed/util/container_util.py @@ -21,26 +21,29 @@ self.key = key self.label = label self.parent = parent + self.current_repository_installation_errors = [] + self.current_repository_successful_installations = [] self.description = None self.datatypes = [] + self.failed_tests = [] self.folders = [] + self.invalid_data_managers = [] self.invalid_repository_dependencies = [] self.invalid_tool_dependencies = [] self.invalid_tools = [] - self.current_repository_installation_errors = [] - self.repository_installation_errors = [] - self.tool_dependency_installation_errors = [] - self.valid_tools = [] - self.valid_data_managers = [] - self.invalid_data_managers = [] - self.tool_dependencies = [] - self.failed_tests = [] self.missing_test_components = [] self.not_tested = [] self.passed_tests = [] + self.readme_files = [] + self.repository_dependencies = [] + self.repository_installation_errors = [] + self.repository_successful_installations = [] self.test_environments = [] - self.repository_dependencies = [] - self.readme_files = [] + self.tool_dependencies = [] + self.tool_dependency_installation_errors = [] + self.tool_dependency_successful_installations = [] + self.valid_tools = [] + self.valid_data_managers = [] self.workflows = []
def contains_folder( self, folder ): @@ -230,6 +233,17 @@ self.error_message = error_message
+class RepositorySuccessfulInstallation( object ): + """Repository installation object""" + + def __init__( self, id=None, tool_shed=None, name=None, owner=None, changeset_revision=None ): + self.id = id + self.tool_shed = tool_shed + self.name = name + self.owner = owner + self.changeset_revision = changeset_revision + + class TestEnvironment( object ): """Tool test environment object"""
@@ -294,6 +308,16 @@ self.error_message = error_message
+class ToolDependencySuccessfulInstallation( object ): + """Tool dependency installation object""" + + def __init__( self, id=None, type=None, name=None, version=None, installation_directory=None ): + self.id = id + self.type = type + self.name = name + self.version = version + self.installation_directory = installation_directory + class Workflow( object ): """Workflow object."""
@@ -1097,7 +1121,8 @@ # {'python_version': '2.7.4', 'tool_shed_mercurial_version': '2.2.3', 'system': 'Linux 3.8.0-30-generic', # 'tool_shed_database_version': 21, 'architecture': 'x86_64', 'galaxy_revision': '11573:a62c54ddbe2a', # 'galaxy_database_version': 117, 'time_tested': '2013-12-03 09:11:48', 'tool_shed_revision': '11556:228156daa575'}, - # 'installation_errors': {'current_repository': [], 'repository_dependencies': [], 'tool_dependencies': []} + # 'installation_errors': {'current_repository': [], 'repository_dependencies': [], 'tool_dependencies': []}, + # 'successful_installations': {'current_repository': [], 'repository_dependencies': [], 'tool_dependencies': []} # } test_environment_dict = tool_test_results_dict.get( 'test_environment', None ) if test_environment_dict is None: @@ -1335,6 +1360,82 @@ version=td_version, error_message=td_error_message ) tool_dependencies_folder.tool_dependency_installation_errors.append( tool_dependency_installation_error ) + successful_installation_dict = tool_test_results_dict.get( 'successful_installations', {} ) + if len( successful_installation_dict ) > 0: + # 'successful_installation': + # {'current_repository': [], + # 'repository_dependencies': [], + # 'tool_dependencies': + # [{'installation_directory': 'some path' 'type': 'package', 'name': 'MIRA', 'version': '4.0'}] + # } + current_repository_successful_installation_dicts = successful_installation_dict.get( 'current_repository', [] ) + repository_dependency_successful_installation_dicts = successful_installation_dict.get( 'repository_dependencies', [] ) + tool_dependency_successful_installation_dicts = successful_installation_dict.get( 'tool_dependencies', [] ) + if len( current_repository_successful_installation_dicts ) > 0 or \ + len( repository_dependency_successful_installation_dicts ) > 0 or \ + len( tool_dependency_successful_installation_dicts ) > 0: + repository_installation_success_id = 0 + folder_id += 1 + successful_installation_base_folder = Folder( id=folder_id, + key='successful_installations', + label='Successful installations', + parent=containing_folder ) + containing_folder.folders.append( successful_installation_base_folder ) + # Displaying the successful installation of the current repository is not really necessary, so we'll skip it. + if len( repository_dependency_successful_installation_dicts ) > 0: + folder_id += 1 + repository_dependencies_folder = Folder( id=folder_id, + key='repository_dependency_successful_installations', + label='Repository dependencies', + parent=successful_installation_base_folder ) + successful_installation_base_folder.folders.append( repository_dependencies_folder ) + for repository_dependency_successful_installation_dict in repository_dependency_successful_installation_dicts: + repository_installation_success_id += 1 + try: + rd_tool_shed = str( repository_dependency_successful_installation_dict.get( 'tool_shed', '' ) ) + rd_name = str( repository_dependency_successful_installation_dict.get( 'name', '' ) ) + rd_owner = str( repository_dependency_successful_installation_dict.get( 'owner', '' ) ) + rd_changeset_revision = str( repository_dependency_successful_installation_dict.get( 'changeset_revision', '' ) ) + except Exception, e: + rd_tool_shed = 'unknown' + rd_name = 'unknown' + rd_owner = 'unknown' + rd_changeset_revision = 'unknown' + repository_installation_success = \ + RepositoryInstallationSuccess( id=repository_installation_success_id, + tool_shed=rd_tool_shed, + name=rd_name, + owner=rd_owner, + changeset_revision=rd_changeset_revision ) + repository_dependencies_folder.repository_successful_installations.append( repository_installation_success ) + if len( tool_dependency_successful_installation_dicts ) > 0: + # [{'installation_directory': 'some path' 'type': 'package', 'name': 'MIRA', 'version': '4.0'}] + folder_id += 1 + tool_dependencies_folder = Folder( id=folder_id, + key='tool_dependency_successful_installations', + label='Tool dependencies', + parent=successful_installation_base_folder ) + successful_installation_base_folder.folders.append( tool_dependencies_folder ) + tool_dependency_error_id = 0 + for tool_dependency_successful_installation_dict in tool_dependency_successful_installation_dicts: + tool_dependency_error_id += 1 + try: + td_type = str( tool_dependency_successful_installation_dict.get( 'type', '' ) ) + td_name = str( tool_dependency_successful_installation_dict.get( 'name', '' ) ) + td_version = str( tool_dependency_successful_installation_dict.get( 'version', '' ) ) + td_installation_directory = tool_dependency_successful_installation_dict.get( 'installation_directory', '' ) + except Exception, e: + td_type = 'unknown' + td_name = 'unknown' + td_version = 'unknown' + td_installation_directory = str( e ) + tool_dependency_successful_installation = \ + ToolDependencySuccessfulInstallation( id=tool_dependency_error_id, + type=td_type, + name=td_name, + version=td_version, + installation_directory=td_installation_directory ) + tool_dependencies_folder.tool_dependency_successful_installations.append( tool_dependency_successful_installation ) else: tool_test_results_root_folder = None return folder_id, tool_test_results_root_folder
diff -r c1963ee06cb0fc066c111b23d99a3ea49d66f90b -r a0e80a712c37754d2d33260919469a7dccb2f1b1 templates/webapps/tool_shed/repository/common.mako --- a/templates/webapps/tool_shed/repository/common.mako +++ b/templates/webapps/tool_shed/repository/common.mako @@ -396,17 +396,27 @@ %for tool_dependency_installation_error in folder.tool_dependency_installation_errors: ${render_tool_dependency_installation_error( tool_dependency_installation_error, pad, my_row, row_counter )} %endfor - %endif + %endif + %if folder.tool_dependency_successful_installations: + %for tool_dependency_successful_installation in folder.tool_dependency_successful_installations: + ${render_tool_dependency_successful_installation( tool_dependency_successful_installation, pad, my_row, row_counter )} + %endfor + %endif %if folder.repository_installation_errors: %for repository_installation_error in folder.repository_installation_errors: ${render_repository_installation_error( repository_installation_error, pad, my_row, row_counter, is_current_repository=False )} %endfor - %endif + %endif %if folder.current_repository_installation_errors: %for repository_installation_error in folder.current_repository_installation_errors: ${render_repository_installation_error( repository_installation_error, pad, my_row, row_counter, is_current_repository=True )} %endfor - %endif + %endif + %if folder.repository_successful_installations: + %for repository_successful_installation in folder.repository_successful_installations: + ${render_repository_successful_installation( repository_successful_installation, pad, my_row, row_counter )} + %endfor + %endif </%def><%def name="render_datatype( datatype, pad, parent, row_counter, row_is_header=False )"> @@ -714,6 +724,36 @@ %></%def>
+<%def name="render_tool_dependency_successful_installation( successful_installation, pad, parent, row_counter, row_is_header=False )"> + <% + encoded_id = trans.security.encode_id( successful_installation.id ) + %> + <tr class="datasetRow" + %if parent is not None: + parent="${parent}" + %endif + id="libraryItem-rtdsi-${encoded_id}"> + <td style="padding-left: ${pad+20}px;"> + <table id="test_environment"> + <tr bgcolor="#FFFFCC"> + <th>Type</th><th>Name</th><th>Version</th> + </tr> + <tr> + <td>${successful_installation.name | h}</td> + <td>${successful_installation.type | h}</td> + <td>${successful_installation.version | h}</td> + </tr> + <tr><th>Installation directory</th></tr> + <tr><td colspan="3">${successful_installation.installation_directory | h}</td></tr> + </table> + </td> + </tr> + <% + my_row = row_counter.count + row_counter.increment() + %> +</%def> + <%def name="render_repository_installation_error( installation_error, pad, parent, row_counter, row_is_header=False, is_current_repository=False )"><% from galaxy.util import unicodify @@ -748,6 +788,37 @@ %></%def>
+<%def name="render_repository_successful_installation( successful_installation, pad, parent, row_counter, row_is_header=False, is_current_repository=False )"> + <% + encoded_id = trans.security.encode_id( successful_installation.id ) + %> + <tr class="datasetRow" + %if parent is not None: + parent="${parent}" + %endif + id="libraryItem-rrsi-${encoded_id}"> + <td style="padding-left: ${pad+20}px;"> + <table id="test_environment"> + %if not is_current_repository: + <tr bgcolor="#FFFFCC"> + <th>Tool shed</th><th>Name</th><th>Owner</th><th>Changeset revision</th> + </tr> + <tr> + <td>${successful_installation.tool_shed | h}</td> + <td>${successful_installation.name | h}</td> + <td>${successful_installation.owner | h}</td> + <td>${successful_installation.changeset_revision | h}</td> + </tr> + %endif + </table> + </td> + </tr> + <% + my_row = row_counter.count + row_counter.increment() + %> +</%def> + <%def name="render_not_tested( not_tested, pad, parent, row_counter, row_is_header=False )"><% encoded_id = trans.security.encode_id( not_tested.id )
diff -r c1963ee06cb0fc066c111b23d99a3ea49d66f90b -r a0e80a712c37754d2d33260919469a7dccb2f1b1 test/install_and_test_tool_shed_repositories/base/util.py --- a/test/install_and_test_tool_shed_repositories/base/util.py +++ b/test/install_and_test_tool_shed_repositories/base/util.py @@ -119,7 +119,6 @@ # a definition for that tool shed. galaxy_tool_shed_url = os.environ.get( 'GALAXY_INSTALL_TEST_TOOL_SHED_URL', None ) tool_shed_api_key = os.environ.get( 'GALAXY_INSTALL_TEST_TOOL_SHED_API_KEY', None ) -exclude_list_file = os.environ.get( 'GALAXY_INSTALL_TEST_EXCLUDE_REPOSITORIES', 'install_test_exclude.xml' )
if 'GALAXY_INSTALL_TEST_SECRET' not in os.environ: galaxy_encode_secret = 'changethisinproductiontoo' @@ -182,6 +181,46 @@ return passed_tests return []
+def display_repositories_by_owner( repository_dicts ): + # Group summary display by repository owner. + repository_dicts_by_owner = {} + for repository_dict in repository_dicts: + name = str( repository_dict[ 'name' ] ) + owner = str( repository_dict[ 'owner' ] ) + changeset_revision = str( repository_dict[ 'changeset_revision' ] ) + if owner in repository_dicts_by_owner: + repository_dicts_by_owner[ owner ].append( repository_dict ) + else: + repository_dicts_by_owner[ owner ] = [ repository_dict ] + # Display grouped summary. + for owner, grouped_repository_dicts in repository_dicts_by_owner.items(): + print "# " + for repository_dict in grouped_repository_dicts: + 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 display_tool_dependencies_by_name( tool_dependency_dicts ): + # Group summary display by repository owner. + tool_dependency_dicts_by_name = {} + for tool_dependency_dict in tool_dependency_dicts: + name = str( tool_dependency_dict[ 'name' ] ) + type = str( tool_dependency_dict[ 'type' ] ) + version = str( tool_dependency_dict[ 'version' ] ) + if name in tool_dependency_dicts_by_name: + tool_dependency_dicts_by_name[ name ].append( tool_dependency_dict ) + else: + tool_dependency_dicts_by_name[ name ] = [ tool_dependency_dict ] + # Display grouped summary. + for name, grouped_tool_dependency_dicts in tool_dependency_dicts_by_name.items(): + print "# " + for tool_dependency_dict in grouped_tool_dependency_dicts: + type = str( tool_dependency_dict[ 'type' ] ) + name = str( tool_dependency_dict[ 'name' ] ) + version = str( tool_dependency_dict[ 'version' ] ) + print "# %s %s version %s" % ( type, name, version ) + def get_api_url( base, parts=[], params=None ): if 'api' in parts and parts.index( 'api' ) != 0: parts.pop( parts.index( 'api' ) ) @@ -474,18 +513,14 @@ def initialize_install_and_test_statistics_dict( test_framework ): # Initialize a dictionary for the summary that will be printed to stdout. install_and_test_statistics_dict = {} + install_and_test_statistics_dict[ 'total_repositories_processed' ] = 0 + install_and_test_statistics_dict[ 'successful_repository_installations' ] = [] + install_and_test_statistics_dict[ 'successful_tool_dependency_installations' ] = [] + install_and_test_statistics_dict[ 'repositories_with_installation_error' ] = [] + install_and_test_statistics_dict[ 'tool_dependencies_with_installation_error' ] = [] if test_framework == REPOSITORIES_WITH_TOOLS: - install_and_test_statistics_dict[ 'total_repositories_processed' ] = 0 install_and_test_statistics_dict[ 'all_tests_passed' ] = [] install_and_test_statistics_dict[ 'at_least_one_test_failed' ] = [] - install_and_test_statistics_dict[ 'successful_installations' ] = [] - install_and_test_statistics_dict[ 'repositories_with_installation_error' ] = [] - install_and_test_statistics_dict[ 'tool_dependencies_with_installation_error' ] = [] - elif test_framework == TOOL_DEPENDENCY_DEFINITIONS: - install_and_test_statistics_dict[ 'total_repositories_processed' ] = 0 - install_and_test_statistics_dict[ 'successful_installations' ] = [] - install_and_test_statistics_dict[ 'repositories_with_installation_error' ] = [] - install_and_test_statistics_dict[ 'tool_dependencies_with_installation_error' ] = [] return install_and_test_statistics_dict
def initialize_tool_tests_results_dict( app, tool_test_results_dict ): @@ -516,6 +551,9 @@ tool_test_results_dict[ 'installation_errors' ] = dict( current_repository=[], repository_dependencies=[], tool_dependencies=[] ) + tool_test_results_dict[ 'successful_installations' ] = dict( current_repository=[], + repository_dependencies=[], + tool_dependencies=[] ) return tool_test_results_dict
def install_repository( app, repository_dict ): @@ -563,7 +601,17 @@
def parse_exclude_list( xml_filename ): """Return a list of repositories to exclude from testing.""" - # This method should return a list with the following structure: + # This method expects an xml document that looks something like this: + # <?xml version="1.0"?> + # <blacklist> + # <repositories tool_shed="http://testtoolshed.g2.bx.psu.edu"> + # <reason> + # <text>Some reason</text> + # <repository name="some_name" owner="some_owner" /> + # </reason> + # </repositories> + # </blacklist> + # A list is returned with the following structure: # [{ 'reason': The default reason or the reason specified in this section, # 'repositories': [( name, owner, changeset revision if changeset revision else None ), # ( name, owner, changeset revision if changeset revision else None )]}] @@ -640,26 +688,6 @@ result = test_runner.run( tests ) return result, test_config.plugins._plugins
-def show_summary_output( repository_dicts ): - # Group summary display by repository owner. - repository_dicts_by_owner = {} - for repository_dict in repository_dicts: - name = str( repository_dict[ 'name' ] ) - owner = str( repository_dict[ 'owner' ] ) - changeset_revision = str( repository_dict[ 'changeset_revision' ] ) - if owner in repository_dicts_by_owner: - repository_dicts_by_owner[ owner ].append( repository_dict ) - else: - repository_dicts_by_owner[ owner ] = [ repository_dict ] - # Display grouped summary. - for owner, grouped_repository_dicts in repository_dicts_by_owner.items(): - print "# " - for repository_dict in grouped_repository_dicts: - 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 uninstall_repository_and_repository_dependencies( app, repository_dict ): """Uninstall a repository and all of its repository dependencies.""" # This method assumes that the repositor defined by the received repository_dict is not a repository @@ -740,7 +768,7 @@ tool_dependency_install_path = tool_dependency.installation_directory( app ) uninstalled, error_message = tool_dependency_util.remove_tool_dependency( app, tool_dependency ) if error_message: - log.debug( 'There was an error attempting to remove directory: %s' % str( tool_dependency_install_path ) ) + log.debug( 'Error attempting to remove directory: %s' % str( tool_dependency_install_path ) ) log.debug( error_message ) else: log.debug( 'Successfully removed tool dependency installation directory: %s' % str( tool_dependency_install_path ) )
diff -r c1963ee06cb0fc066c111b23d99a3ea49d66f90b -r a0e80a712c37754d2d33260919469a7dccb2f1b1 test/install_and_test_tool_shed_repositories/repositories_with_tools/functional_tests.py --- a/test/install_and_test_tool_shed_repositories/repositories_with_tools/functional_tests.py +++ b/test/install_and_test_tool_shed_repositories/repositories_with_tools/functional_tests.py @@ -66,6 +66,9 @@ default_galaxy_locales = 'en' default_galaxy_test_file_dir = "test-data" os.environ[ 'GALAXY_INSTALL_TEST_TMP_DIR' ] = galaxy_test_tmp_dir +# This file is copied to the Galaxy root directory by buildbot. +# It is managed by cfengine and is not locally available. +exclude_list_file = os.environ.get( 'GALAXY_INSTALL_TEST_EXCLUDE_REPOSITORIES', 'repositories_with_tools_exclude.xml' )
# This script can be run in such a way that no Tool Shed database records should be changed. if '-info_only' in sys.argv or 'GALAXY_INSTALL_TEST_INFO_ONLY' in os.environ: @@ -144,7 +147,7 @@ if error_message: return None, error_message # Handle repositories not to be tested. - if os.path.exists( install_and_test_base_util.exclude_list_file ): + if os.path.exists( exclude_list_file ): # Entries in the exclude_list look something like this. # { 'reason': The default reason or the reason specified in this section, # 'repositories': @@ -157,8 +160,8 @@ # undeleted, this script will then test them the next time it runs. We don't need to check if a repository has been deleted # here because our call to the Tool Shed API filters by downloadable='true', in which case deleted will always be False. log.debug( 'Loading the list of repositories excluded from testing from the file %s...' % \ - str( install_and_test_base_util.exclude_list_file ) ) - exclude_list = install_and_test_base_util.parse_exclude_list( install_and_test_base_util.exclude_list_file ) + str( exclude_list_file ) ) + exclude_list = install_and_test_base_util.parse_exclude_list( exclude_list_file ) else: exclude_list = [] # Generate a test method that will use Twill to install each repository into the embedded Galaxy application that was @@ -299,7 +302,7 @@ test_toolbox.toolbox = app.toolbox else: # This repository and all of its dependencies were successfully installed. - install_and_test_statistics_dict[ 'successful_installations' ].append( repository_identifier_dict ) + install_and_test_statistics_dict[ 'successful_repository_installations' ].append( repository_identifier_dict ) # Configure and run functional tests for this repository. This is equivalent to sh run_functional_tests.sh -installed remove_install_tests() log.debug( 'Installation of %s succeeded, running all defined functional tests.' % str( repository.name ) ) @@ -560,33 +563,33 @@ total_repositories_processed = install_and_test_statistics_dict[ 'total_repositories_processed' ] all_tests_passed = install_and_test_statistics_dict[ 'all_tests_passed' ] at_least_one_test_failed = install_and_test_statistics_dict[ 'at_least_one_test_failed' ] - successful_installations = install_and_test_statistics_dict[ 'successful_installations' ] + successful_repository_installations = install_and_test_statistics_dict[ 'successful_repository_installations' ] repositories_with_installation_error = install_and_test_statistics_dict[ 'repositories_with_installation_error' ] tool_dependencies_with_installation_error = install_and_test_statistics_dict[ 'tool_dependencies_with_installation_error' ] now = time.strftime( "%Y-%m-%d %H:%M:%S" ) print "####################################################################################" print "# %s - installation script for repositories containing tools completed." % now print "# Repository revisions processed: %s" % str( total_repositories_processed ) - if successful_installations: + if successful_repository_installations: print "# ----------------------------------------------------------------------------------" - print "# The following %d revisions with all dependencies were successfully installed:" % len( successful_installations ) - install_and_test_base_util.show_summary_output( successful_installations ) + print "# The following %d revisions were successfully installed:" % len( successful_repository_installations ) + install_and_test_base_util.display_repositories_by_owner( successful_repository_installations ) if all_tests_passed: print '# ----------------------------------------------------------------------------------' - print "# %d repositories successfully passed all functional tests:" % len( all_tests_passed ) - install_and_test_base_util.show_summary_output( all_tests_passed ) + print "# The following %d revisions successfully passed all functional tests:" % len( all_tests_passed ) + install_and_test_base_util.display_repositories_by_owner( all_tests_passed ) if at_least_one_test_failed: print '# ----------------------------------------------------------------------------------' - print "# %d repositories failed at least 1 functional test:" % len( at_least_one_test_failed ) - install_and_test_base_util.show_summary_output( at_least_one_test_failed ) + print "# The following %d revisions failed at least 1 functional test:" % len( at_least_one_test_failed ) + install_and_test_base_util.display_repositories_by_owner( at_least_one_test_failed ) if repositories_with_installation_error: print '# ----------------------------------------------------------------------------------' - print "# %d repositories have installation errors:" % len( repositories_with_installation_error ) - install_and_test_base_util.show_summary_output( repositories_with_installation_error ) + print "# The following %d revisions have installation errors:" % len( repositories_with_installation_error ) + install_and_test_base_util.display_repositories_by_owner( repositories_with_installation_error ) if tool_dependencies_with_installation_error: print "# ----------------------------------------------------------------------------------" print "# The following %d tool dependencies have installation errors:" % len( tool_dependencies_with_installation_error ) - install_and_test_base_util.show_summary_output( tool_dependencies_with_installation_error ) + install_and_test_base_util.display_tool_dependencies_by_name( tool_dependencies_with_installation_error ) print "####################################################################################" log.debug( "Shutting down..." ) # Gracefully shut down the embedded web server and UniverseApplication.
diff -r c1963ee06cb0fc066c111b23d99a3ea49d66f90b -r a0e80a712c37754d2d33260919469a7dccb2f1b1 test/install_and_test_tool_shed_repositories/tool_dependency_definitions/functional_tests.py --- a/test/install_and_test_tool_shed_repositories/tool_dependency_definitions/functional_tests.py +++ b/test/install_and_test_tool_shed_repositories/tool_dependency_definitions/functional_tests.py @@ -64,6 +64,9 @@ default_galaxy_locales = 'en' default_galaxy_test_file_dir = "test-data" os.environ[ 'GALAXY_INSTALL_TEST_TMP_DIR' ] = galaxy_test_tmp_dir +# This file is copied to the Galaxy root directory by buildbot. +# It is managed by cfengine and is not locally available. +exclude_list_file = os.environ.get( 'GALAXY_INSTALL_TEST_EXCLUDE_REPOSITORIES', 'tool_dependency_definition_exclude.xml' )
# This script can be run in such a way that no Tool Shed database records should be changed. if '-info_only' in sys.argv or 'GALAXY_INSTALL_TEST_INFO_ONLY' in os.environ: @@ -83,7 +86,7 @@ if error_message: return None, error_message # Handle repositories not to be tested. - if os.path.exists( install_and_test_base_util.exclude_list_file ): + if os.path.exists( exclude_list_file ): # Entries in the exclude_list look something like this. # { 'reason': The default reason or the reason specified in this section, # 'repositories': @@ -96,8 +99,8 @@ # undeleted, this script will then test them the next time it runs. We don't need to check if a repository has been deleted # here because our call to the Tool Shed API filters by downloadable='true', in which case deleted will always be False. log.debug( 'Loading the list of repositories excluded from testing from the file %s...' % \ - str( install_and_test_base_util.exclude_list_file ) ) - exclude_list = install_and_test_base_util.parse_exclude_list( install_and_test_base_util.exclude_list_file ) + str( exclude_list_file ) ) + exclude_list = install_and_test_base_util.parse_exclude_list( exclude_list_file ) else: exclude_list = [] # Generate a test method that will use Twill to install each repository into the embedded Galaxy application that was @@ -176,7 +179,8 @@ # Even if the repository failed to install, execute the uninstall method, in case a dependency did succeed. log.debug( 'Attempting to uninstall revision %s of repository %s owned by %s.' % ( changeset_revision, name, owner ) ) try: - repository = test_db_util.get_installed_repository_by_name_owner_changeset_revision( name, owner, changeset_revision ) + repository = \ + test_db_util.get_installed_repository_by_name_owner_changeset_revision( name, owner, changeset_revision ) except Exception, e: error_message = 'Unable to find revision %s of repository %s owned by %s: %s.' % \ ( changeset_revision, name, owner, str( e ) ) @@ -199,9 +203,34 @@ log.debug( 'Installation failed for revision %s of repository %s owned by %s.' % \ ( changeset_revision, name, owner ) ) else: + # The repository was successfully installed. log.debug( 'Installation succeeded for revision %s of repository %s owned by %s.' % \ ( changeset_revision, name, owner ) ) + install_and_test_statistics_dict[ 'successful_repository_installations' ].append( repository_identifier_dict ) + tool_test_results_dict[ 'successful_installations' ][ 'current_repository' ]\ + .append( repository_identifier_dict ) + params = dict( test_install_error=False, + do_not_test=False ) + if repository.missing_repository_dependencies: + params[ 'test_install_error' ] = True + # Keep statistics for this repository's repository dependencies that resulted in installation errors. + for missing_repository_dependency in repository.missing_repository_dependencies: + tool_shed = str( missing_repository_dependency.tool_shed ) + name = str( missing_repository_dependency.name ) + owner = str( missing_repository_dependency.owner ) + changset_revision = str( missing_repository_dependency.changeset_revision ) + error_message = unicodify( missing_repository_dependency.error_message ) + missing_repository_dependency_info_dict = dict( tool_shed=tool_shed, + name=name, + owner=owner, + changset_revision=changset_revision, + error_message=error_message ) + install_and_test_statistics_dict[ 'repositories_with_installation_error' ]\ + .append( missing_repository_dependency_dict ) + tool_test_results_dict[ 'installation_errors' ][ 'repository_dependencies' ]\ + .append( missing_repository_dependency_info_dict ) if repository.missing_tool_dependencies: + params[ 'test_install_error' ] = True # Keep statistics for this repository's tool dependencies that resulted in installation errors. for missing_tool_dependency in repository.missing_tool_dependencies: name = str( missing_tool_dependency.name ) @@ -212,22 +241,47 @@ name=name, version=version, error_message=error_message ) - install_and_test_statistics_dict[ 'tool_dependencies_with_installation_error' ].append( missing_tool_dependency_info_dict ) - else: - # This repository and all of its dependencies were successfully installed. - install_and_test_statistics_dict[ 'successful_installations' ].append( repository_identifier_dict ) - tool_test_results_dict[ 'passed_tests' ].append( repository_identifier_dict ) - params = dict( test_install_error=False, - do_not_test=False ) - # TODO: do something useful with response_dict - response_dict = install_and_test_base_util.register_test_result( install_and_test_base_util.galaxy_tool_shed_url, - tool_test_results_dicts, - tool_test_results_dict, - repository_dict, - params, - can_update_tool_shed ) - - install_and_test_statistics_dict[ 'total_repositories_processed' ] = total_repositories_processed + install_and_test_statistics_dict[ 'tool_dependencies_with_installation_error' ]\ + .append( missing_tool_dependency_info_dict ) + tool_test_results_dict[ 'installation_errors' ][ 'tool_dependencies' ]\ + .append( missing_tool_dependency_info_dict ) + if repository.installed_repository_dependencies: + # Keep statistics for this repository's tool dependencies that resulted in successful installations. + for repository_dependency in repository.installed_repository_dependencies: + tool_shed = str( repository_dependency.tool_shed ) + name = str( repository_dependency.name ) + owner = str( repository_dependency.owner ) + changeset_revision = str( repository_dependency.changeset_revision ) + repository_dependency_info_dict = dict( tool_shed=tool_shed, + name=name, + owner=owner, + changeset_revision=changeset_revision ) + install_and_test_statistics_dict[ 'successful_repository_installations' ]\ + .append( repository_dependency_info_dict ) + tool_test_results_dict[ 'successful_installations' ][ 'repository_dependencies' ]\ + .append( repository_dependency_info_dict ) + if repository.installed_tool_dependencies: + # Keep statistics for this repository's tool dependencies that resulted in successful installations. + for tool_dependency in repository.installed_tool_dependencies: + name = str( tool_dependency.name ) + type = str( tool_dependency.type ) + version = str( tool_dependency.version ) + installation_directory = tool_dependency.installation_directory( app ) + tool_dependency_info_dict = dict( type=type, + name=name, + version=version, + installation_directory=installation_directory ) + install_and_test_statistics_dict[ 'successful_tool_dependency_installations' ]\ + .append( tool_dependency_info_dict ) + tool_test_results_dict[ 'successful_installations' ][ 'tool_dependencies' ]\ + .append( tool_dependency_info_dict ) + # TODO: do something useful with response_dict + response_dict = install_and_test_base_util.register_test_result( install_and_test_base_util.galaxy_tool_shed_url, + tool_test_results_dicts, + tool_test_results_dict, + repository_dict, + params, + can_update_tool_shed ) return install_and_test_statistics_dict, error_message
def main(): @@ -446,25 +500,30 @@ log.debug( error_message ) else: total_repositories_processed = install_and_test_statistics_dict[ 'total_repositories_processed' ] - successful_installations = install_and_test_statistics_dict[ 'successful_installations' ] + successful_repository_installations = install_and_test_statistics_dict[ 'successful_repository_installations' ] + successful_tool_dependency_installations = install_and_test_statistics_dict[ 'successful_tool_dependency_installations' ] repositories_with_installation_error = install_and_test_statistics_dict[ 'repositories_with_installation_error' ] tool_dependencies_with_installation_error = install_and_test_statistics_dict[ 'tool_dependencies_with_installation_error' ] now = time.strftime( "%Y-%m-%d %H:%M:%S" ) print "####################################################################################" print "# %s - installation script for repositories of type tool_dependency_definition completed." % now print "# Repository revisions processed: %s" % str( total_repositories_processed ) - if successful_installations: + if successful_repository_installations: print "# ----------------------------------------------------------------------------------" - print "# The following %d revisions with all dependencies were successfully installed:" % len( successful_installations ) - install_and_test_base_util.show_summary_output( successful_installations ) + print "# The following %d revisions were successfully installed:" % len( successful_repository_installations ) + install_and_test_base_util.display_repositories_by_owner( successful_repository_installations ) if repositories_with_installation_error: print "# ----------------------------------------------------------------------------------" print "# The following %d revisions have installation errors:" % len( repositories_with_installation_error ) - install_and_test_base_util.show_summary_output( repositories_with_installation_error ) + install_and_test_base_util.successful_repository_installations( repositories_with_installation_error ) + if successful_tool_dependency_installations: + print "# ----------------------------------------------------------------------------------" + print "# The following %d tool dependencies were successfully installed:" % len( successful_tool_dependency_installations ) + install_and_test_base_util.display_tool_dependencies_by_name( successful_tool_dependency_installations ) if tool_dependencies_with_installation_error: print "# ----------------------------------------------------------------------------------" print "# The following %d tool dependencies have installation errors:" % len( tool_dependencies_with_installation_error ) - install_and_test_base_util.show_summary_output( tool_dependencies_with_installation_error ) + install_and_test_base_util.display_tool_dependencies_by_name( tool_dependencies_with_installation_error ) print "####################################################################################" log.debug( "Shutting down..." ) # Gracefully shut down the embedded web server and UniverseApplication. @@ -506,6 +565,36 @@ # "architecture": "x86_64", # "system": "Darwin 12.2.0" # }, + # "successful_installation": + # { + # 'tool_dependencies': + # [ + # { + # 'type': 'Type of tool dependency, e.g. package, set_environment, etc.', + # 'name': 'Name of the tool dependency.', + # 'version': 'Version if this is a package, otherwise blank.', + # 'installation_directory': 'The installation directory path.' + # }, + # ], + # 'repository_dependencies': + # [ + # { + # 'tool_shed': 'The tool shed that this repository was installed from.', + # 'name': 'The name of the repository that failed to install.', + # 'owner': 'Owner of the failed repository.', + # 'changeset_revision': 'Changeset revision of the failed repository.' + # }, + # ], + # 'current_repository': + # [ + # { + # 'tool_shed': 'The tool shed that this repository was installed from.', + # 'name': 'The name of the repository that failed to install.', + # 'owner': 'Owner of the failed repository.', + # 'changeset_revision': 'Changeset revision of the failed repository.' + # }, + # ], + # } # "installation_errors": # { # 'tool_dependencies': @@ -537,12 +626,6 @@ # 'error_message': 'The error message that was returned when the repository failed to install.', # }, # ], - # { - # "name": "The name of the repository.", - # "owner": "The owner of the repository.", - # "changeset_revision": "The changeset revision of the repository.", - # "error_message": "The message stored in tool_dependency.error_message." - # }, # } # } sys.exit( main() )
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.
galaxy-commits@lists.galaxyproject.org