3 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/88c1da16340b/ Changeset: 88c1da16340b User: Dave Bouvier Date: 2013-05-14 19:44:24 Summary: Expand the installation errors dict. Affected #: 1 file diff -r d3be8f8f8096ad723644019bd742904046df54ba -r 88c1da16340bf08dca453316fbcc7ff0868de57d 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 @@ -625,6 +625,17 @@ # repository, with tool and repository dependencies also selected for installation. result, _ = run_tests( test_config ) success = result.wasSuccessful() + repository_status = get_tool_test_results_from_api( galaxy_tool_shed_url, metadata_revision_id ) + if 'test_environment' not in repository_status: + repository_status[ 'test_environment' ] = {} + test_environment = get_test_environment( repository_status[ 'test_environment' ] ) + test_environment[ 'galaxy_database_version' ] = get_database_version( app ) + test_environment[ 'galaxy_revision'] = get_repository_current_revision( os.getcwd() ) + repository_status[ 'test_environment' ] = test_environment + repository_status[ 'passed_tests' ] = [] + repository_status[ 'failed_tests' ] = [] + repository_status[ 'installation_errors' ] = dict( current_repository=[], repository_dependencies=[], tool_dependencies=[] ) + repository = test_db_util.get_installed_repository_by_name_owner_changeset_revision( name, owner, changeset_revision ) # If the installation succeeds, configure and run functional tests for this repository. This is equivalent to # sh run_functional_tests.sh -installed if success: @@ -684,18 +695,8 @@ # }, # ] # } - repository_status = get_tool_test_results_from_api( galaxy_tool_shed_url, metadata_revision_id ) - if 'test_environment' not in repository_status: - repository_status[ 'test_environment' ] = {} - test_environment = get_test_environment( repository_status[ 'test_environment' ] ) - test_environment[ 'galaxy_database_version' ] = get_database_version( app ) - test_environment[ 'galaxy_revision'] = get_repository_current_revision( os.getcwd() ) - repository_status[ 'test_environment' ] = test_environment - repository_status[ 'passed_tests' ] = [] - repository_status[ 'failed_tests' ] = [] - repository_status[ 'installation_errors' ] = [] - repository = test_db_util.get_installed_repository_by_name_owner_changeset_revision( name, owner, changeset_revision ) - missing_tool_dependencies = repository.includes_tool_dependencies and repository.missing_tool_dependencies + failed_tool_dependencies = repository.includes_tool_dependencies and repository.tool_dependencies_with_installation_errors + failed_repository_dependencies = repository.repository_dependencies_with_installation_errors if 'missing_test_components' not in repository_status: repository_status[ 'missing_test_components' ] = [] if not has_test_data: @@ -708,9 +709,10 @@ tool_version = tool[ 'version' ] tool_guid = tool[ 'guid' ] # In keeping with the standard display layout, add the error message to the dict for each tool individually. - failed_tests = dict( tool_id=tool_id, tool_version=tool_version, tool_guid=tool_guid, - missing_components="Repository %s is missing a test-data directory." % name ) - repository_status[ 'missing_test_components' ].append( failed_tests ) + missing_components = dict( tool_id=tool_id, tool_version=tool_version, tool_guid=tool_guid, + missing_components="Repository %s is missing a test-data directory." % name ) + if missing_components not in repository_status[ 'missing_test_components' ]: + repository_status[ 'missing_test_components' ].append( missing_components ) # Record the status of this repository in the tool shed. register_test_result( galaxy_tool_shed_url, metadata_revision_id, repository_status, passed_tests=False ) # Run the cleanup method. This removes tool functional test methods from the test_toolbox module and uninstalls the @@ -719,17 +721,26 @@ # Set the test_toolbox.toolbox module-level variable to the new app.toolbox. test_toolbox.toolbox = app.toolbox repositories_failed.append( dict( name=name, owner=owner, changeset_revision=changeset_revision ) ) - elif missing_tool_dependencies: + elif failed_tool_dependencies or failed_repository_dependencies: # If a tool dependency fails to install correctly, this should be considered an installation error, # and functional tests should be skipped, since the tool dependency needs to be correctly installed # for the test to be considered reliable. log.error( 'One or more tool dependencies of this repository are marked as missing.' ) log.error( 'Updating repository and skipping functional tests.' ) # In keeping with the standard display layout, add the error message to the dict for each tool individually. - for dependency in repository.missing_tool_dependencies: - test_result = dict( name=name, owner=owner, changeset_revision=changeset_revision, + for dependency in repository.tool_dependencies_with_installation_errors: + test_result = dict( type=dependency.type, + name=dependency.name, + version=dependency.version, error_message=dependency.error_message ) - repository_status[ 'installation_errors' ].append( test_result ) + repository_status[ 'installation_errors' ][ 'tool_dependencies' ].append( test_result ) + for dependency in repository.repository_dependencies_with_installation_errors: + test_result = dict( tool_shed=dependency.tool_shed, + name=dependency.name, + owner=dependency.owner, + changeset_revision=dependency.changeset_revision, + error_message=dependency.error_message ) + repository_status[ 'installation_errors' ][ 'repository_dependencies' ].append( test_result ) # Record the status of this repository in the tool shed. register_test_result( galaxy_tool_shed_url, metadata_revision_id, repository_status, passed_tests=False ) # Run the cleanup method. This removes tool functional test methods from the test_toolbox module and uninstalls the @@ -838,6 +849,14 @@ else: # Even if the repository failed to install, execute the uninstall method, in case a dependency did succeed. log.debug( 'Uninstalling repository %s', repository_info_dict[ 'name' ] ) + repository = test_db_util.get_installed_repository_by_name_owner_changeset_revision( name, owner, changeset_revision ) + test_result = dict( tool_shed=repository.tool_shed, + name=repository.name, + owner=repository.owner, + changeset_revision=repository.changeset_revision, + error_message=repository.error_message ) + repository_status[ 'installation_errors' ][ 'repository_dependencies' ].append( test_result ) + register_test_result( galaxy_tool_shed_url, metadata_revision_id, repository_status, passed_tests=False ) success = execute_uninstall_method( app ) if not success: log.error( 'Repository %s failed to uninstall.', repository_info_dict[ 'name' ] ) https://bitbucket.org/galaxy/galaxy-central/commits/344658666b2e/ Changeset: 344658666b2e User: Dave Bouvier Date: 2013-05-14 19:45:17 Summary: Display the information in the installation errors dict on repository manage page under the tool test results folder. Affected #: 2 files diff -r 88c1da16340bf08dca453316fbcc7ff0868de57d -r 344658666b2ea9e0607b9532d8c9c0d1874f2c39 lib/galaxy/webapps/tool_shed/util/container_util.py --- a/lib/galaxy/webapps/tool_shed/util/container_util.py +++ b/lib/galaxy/webapps/tool_shed/util/container_util.py @@ -26,6 +26,10 @@ self.invalid_repository_dependencies = [] self.invalid_tool_dependencies = [] self.invalid_tools = [] + self.installation_errors = [] + 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 = [] @@ -195,6 +199,18 @@ return [ self.toolshed, self.repository_name, self.repository_owner, self.changeset_revision, asbool( str( self.prior_installation_required ) ) ] +class RepositoryInstallationError( object ): + """Repository installation error object""" + + def __init__( self, id=None, tool_shed=None, name=None, owner=None, changeset_revision=None, error_message=None ): + self.id = id + self.tool_shed = tool_shed + self.name = name + self.owner = owner + self.changeset_revision = changeset_revision + self.error_message = error_message + + class TestEnvironment( object ): """Tool test environment object""" @@ -250,6 +266,17 @@ return [ self.name, self.version, self.type ] +class ToolDependencyInstallationError( object ): + """Tool dependency installation error object""" + + def __init__( self, id=None, type=None, name=None, version=None, error_message=None ): + self.id = id + self.type = type + self.name = name + self.version = version + self.error_message = error_message + + class Workflow( object ): """Workflow object.""" @@ -1059,6 +1086,68 @@ tool_id=missing_test_components_dict.get( 'tool_id', '' ), tool_version=missing_test_components_dict.get( 'tool_version', '' ) ) folder.missing_test_components.append( missing_test_component ) + installation_error_dicts = tool_test_results_dict.get( 'installation_errors', {} ) + if installation_error_dicts: + current_repository_errors = installation_error_dicts.get( 'current_repository', [] ) + repository_dependency_errors = installation_error_dicts.get( 'repository_dependencies', [] ) + tool_dependency_errors = installation_error_dicts.get( 'tool_dependencies', [] ) + if current_repository_errors or repository_dependency_errors or tool_dependency_errors: + folder_id += 1 + installation_error_base_folder = Folder( id=folder_id, + key='installation_errors', + label='Installation errors', + parent=test_results_folder ) + if current_repository_errors: + folder_id += 1 + subfolder = Folder( id=folder_id, + key='current_repository_errors', + label='This repository', + parent=installation_error_base_folder ) + repository_error_id = 0 + for repository_error_dict in current_repository_errors: + repository_error_id += 1 + repository_installation_error = RepositoryInstallationError( id=repository_error_id, + tool_shed=repository_error_dict.get( 'tool_shed', '' ), + name=repository_error_dict.get( 'name', '' ), + owner=repository_error_dict.get( 'owner', '' ), + changeset_revision=repository_error_dict.get( 'changeset_revision', '' ), + error_message=repository_error_dict.get( 'error_message', '' ) ) + subfolder.current_repository_installation_errors.append( repository_installation_error ) + installation_error_base_folder.folders.append( subfolder ) + if repository_dependency_errors: + folder_id += 1 + subfolder = Folder( id=folder_id, + key='repository_dependency_errors', + label='Repository dependencies', + parent=installation_error_base_folder ) + repository_error_id = 0 + for repository_error_dict in repository_dependency_errors: + repository_error_id += 1 + repository_installation_error = RepositoryInstallationError( id=repository_error_id, + tool_shed=repository_error_dict.get( 'tool_shed', '' ), + name=repository_error_dict.get( 'name', '' ), + owner=repository_error_dict.get( 'owner', '' ), + changeset_revision=repository_error_dict.get( 'changeset_revision', '' ), + error_message=repository_error_dict.get( 'error_message', '' ) ) + subfolder.repository_installation_errors.append( repository_installation_error ) + installation_error_base_folder.folders.append( subfolder ) + if tool_dependency_errors: + folder_id += 1 + subfolder = Folder( id=folder_id, + key='tool_dependency_errors', + label='Tool dependencies', + parent=installation_error_base_folder ) + tool_dependency_error_id = 0 + for tool_dependency_error_dict in tool_dependency_errors: + tool_dependency_error_id += 1 + tool_dependency_installation_error = ToolDependencyInstallationError( id=tool_dependency_error_id, + type=tool_dependency_error_dict.get( 'type', '' ), + name=tool_dependency_error_dict.get( 'name', '' ), + version=tool_dependency_error_dict.get( 'version', '' ), + error_message=tool_dependency_error_dict.get( 'error_message', '' ) ) + subfolder.tool_dependency_installation_errors.append( tool_dependency_installation_error ) + installation_error_base_folder.folders.append( subfolder ) + test_results_folder.installation_errors.append( installation_error_base_folder ) else: tool_test_results_root_folder = None return folder_id, tool_test_results_root_folder diff -r 88c1da16340bf08dca453316fbcc7ff0868de57d -r 344658666b2ea9e0607b9532d8c9c0d1874f2c39 templates/webapps/tool_shed/repository/common.mako --- a/templates/webapps/tool_shed/repository/common.mako +++ b/templates/webapps/tool_shed/repository/common.mako @@ -220,10 +220,12 @@ elif folder.label in [ 'Installed repository dependencies', 'Repository dependencies', 'Missing repository dependencies' ]: if folder.description: folder_label = "%s<i> - %s</i>" % ( folder_label, folder.description ) - elif folder.label not in [ 'Installed repository dependencies' ]: + elif folder.label not in [ 'Installed repository dependencies' ] and folder.parent.label not in [ 'Installation errors' ]: folder_label = "%s<i> - installation of these additional repositories is required</i>" % folder_label if trans.webapp.name == 'galaxy': col_span_str = 'colspan="4"' + elif folder.label == 'Installation errors': + folder_label = "%s<i> - no functional tests were run for any tools in this changeset revision</i>" % folder_label elif folder.label == 'Invalid repository dependencies': folder_label = "%s<i> - click the repository dependency to see why it is invalid</i>" % folder_label elif folder.label == 'Invalid tool dependencies': @@ -345,6 +347,26 @@ ${render_missing_test_component( missing_test_component, pad, my_row, row_counter )} %endfor %endif + %if folder.installation_errors: + %for installation_error in folder.installation_errors: + ${render_folder( installation_error, pad, my_row, row_counter )} + %endfor + %endif + %if folder.tool_dependency_installation_errors: + %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 + %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 + %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 </%def><%def name="render_datatype( datatype, pad, parent, row_counter, row_is_header=False )"> @@ -608,6 +630,65 @@ %></%def> +<%def name="render_tool_dependency_installation_error( installation_error, pad, parent, row_counter, row_is_header=False )"> + <% encoded_id = trans.security.encode_id( installation_error.id ) %> + <tr class="datasetRow" + %if parent is not None: + parent="${parent}" + %endif + id="libraryItem-${encoded_id}"> + <td style="padding-left: ${pad+20}px;"> + <table class="grid" id="td_installation_errors"> + <tr bgcolor="#FFFFCC"> + <th>Type</th><th>Name</th><th>Version</th> + </tr> + <tr> + <td>${installation_error.name | h}</td> + <td>${installation_error.type | h}</td> + <td>${installation_error.version | h}</td> + </tr> + <tr><th>Error</th></tr> + <tr><td colspan="3">${installation_error.error_message | 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 )"> + <% encoded_id = trans.security.encode_id( installation_error.id ) %> + <tr class="datasetRow" + %if parent is not None: + parent="${parent}" + %endif + id="libraryItem-${encoded_id}"> + <td style="padding-left: ${pad+20}px;"> + <table class="grid" id="repository_installation_errors"> + %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>${installation_error.tool_shed | h}</td> + <td>${installation_error.name | h}</td> + <td>${installation_error.owner | h}</td> + <td>${installation_error.changeset_revision | h}</td> + </tr> + %endif + <tr><th>Error</th></tr> + <tr><td colspan="4">${installation_error.error_message | h}</td></tr> + </table> + </td> + </tr> + <% + my_row = row_counter.count + row_counter.increment() + %> +</%def> + <%def name="render_passed_test( passed_test, pad, parent, row_counter, row_is_header=False )"><% encoded_id = trans.security.encode_id( passed_test.id ) %><tr class="datasetRow" https://bitbucket.org/galaxy/galaxy-central/commits/1cabd9fd107c/ Changeset: 1cabd9fd107c User: Dave Bouvier Date: 2013-05-14 19:48:05 Summary: Merged. Affected #: 1 file diff -r 344658666b2ea9e0607b9532d8c9c0d1874f2c39 -r 1cabd9fd107c14caa379e591ff3fea66c3cc5ce4 lib/tool_shed/util/metadata_util.py --- a/lib/tool_shed/util/metadata_util.py +++ b/lib/tool_shed/util/metadata_util.py @@ -9,6 +9,7 @@ from galaxy.tools.data_manager.manager import DataManager from galaxy.util import inflector from galaxy.util import json +from galaxy.web import url_for from galaxy.webapps.tool_shed.util import container_util import tool_shed.util.shed_util_common as suc from tool_shed.util import common_util @@ -1050,6 +1051,9 @@ is_valid = True error_message = '' toolshed = repository_elem.get( 'toolshed' ) + if not toolshed: + # Default to the current tool shed. + toolshed = str( url_for( '/', qualified=True ) ).rstrip( '/' ) name = repository_elem.get( 'name' ) owner = repository_elem.get( 'owner' ) changeset_revision = repository_elem.get( 'changeset_revision' ) 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.