commit/galaxy-central: greg: Enhance the display of functional test results in the tol shed for tests run against contained tools when the repository is installed into Galaxy.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/3a3eab0b0adb/ changeset: 3a3eab0b0adb user: greg date: 2013-03-05 22:37:51 summary: Enhance the display of functional test results in the tol shed for tests run against contained tools when the repository is installed into Galaxy. affected #: 4 files diff -r 26006e793a32a35328d941f6cea573b0108faab7 -r 3a3eab0b0adbda30e72fdda0c5de899728bcd5e6 lib/galaxy/webapps/tool_shed/controllers/repository.py --- a/lib/galaxy/webapps/tool_shed/controllers/repository.py +++ b/lib/galaxy/webapps/tool_shed/controllers/repository.py @@ -2452,7 +2452,6 @@ revision_label = suc.get_revision_label( trans, repository, changeset_revision ) repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans, id, changeset_revision ) if repository_metadata: - repository_metadata_id = trans.security.encode_id( repository_metadata.id ) metadata = repository_metadata.metadata # Get a dictionary of all repositories upon which the contents of the current repository_metadata record depend. repository_dependencies = suc.get_repository_dependencies_for_changeset_revision( trans=trans, @@ -2468,7 +2467,6 @@ message += orphan_message status = 'warning' else: - repository_metadata_id = None metadata = None is_malicious = suc.changeset_is_malicious( trans, id, repository.tip( trans.app ) ) if is_malicious: @@ -2492,7 +2490,7 @@ return trans.fill_template( '/webapps/tool_shed/repository/view_repository.mako', repo=repo, repository=repository, - repository_metadata_id=repository_metadata_id, + repository_metadata=repository_metadata, metadata=metadata, containers_dict=containers_dict, avg_rating=avg_rating, diff -r 26006e793a32a35328d941f6cea573b0108faab7 -r 3a3eab0b0adbda30e72fdda0c5de899728bcd5e6 templates/webapps/tool_shed/repository/display_tool_functional_test_results.mako --- a/templates/webapps/tool_shed/repository/display_tool_functional_test_results.mako +++ b/templates/webapps/tool_shed/repository/display_tool_functional_test_results.mako @@ -5,6 +5,7 @@ <% from galaxy.web.framework.helpers import time_ago + from tool_shed.util.shed_util_common import to_safe_string changeset_revision = repository_metadata.changeset_revision has_metadata = repository.metadata_revisions @@ -157,23 +158,61 @@ <div class="form-row"><table class="grid"> %for test_results_dict in test_errors: + <% + test_id = test_results_dict.get( 'test_id', 'unknown' ) + if test_id != 'unknown': + # The test_id looks something like: + # test_tool_000003 (functional.test_toolbox.TestForTool_localhost:9009/repos/test/bwa_mappers/bwa_color_wrapper/1.0.2) + # Highlight the tool id and version. + test_id_items = test_id.split( '/' ) + tool_id = test_id_items[ -2 ] + tool_id = '<b>%s</b>' % tool_id + test_id_items[ -2 ] = tool_id + tool_version = test_id_items[ -1 ] + tool_version = '<b>%s</b>' % ( tool_version.rstrip( ')' ) ) + tool_version = '%s)' % tool_version + test_id_items[ -1 ] = tool_version + test_id = '/'.join( test_id_items ) + test_id_items = test_id.split( ' ' ) + test_num = test_id_items[ 0 ] + test_num = '<b>%s</b>' % test_num + test_id_items[ 0 ] = test_num + test_id = ' '.join( test_id_items ) + + test_status = '<font color="green">Test passed</font>' + stdout = test_results_dict.get( 'stdout', '' ) + if stdout: + stdout = to_safe_string( stdout, to_html=True ) + stderr = test_results_dict.get( 'stderr', '' ) + if stderr: + stderr = to_safe_string( stderr, to_html=True ) + test_status = '<font color="red">Test failed</font>' + traceback = test_results_dict.get( 'traceback', '' ) + if traceback: + traceback = to_safe_string( traceback, to_html=True ) + test_status = '<font color="red">Test failed</font>' + %><tr><td bgcolor="#FFFFCC"><b>Test id</b></td> - <td bgcolor="#FFFFCC">${test_results_dict.get( 'test_id', 'unknown' )}</td> + <td bgcolor="#FFFFCC">${test_id}</td> + </tr> + <tr> + <td><b>Status</b></td> + <td>${test_status}</td></tr> %if repository_metadata.tools_functionally_correct: <tr><td><b>Stdout</b></td> - <td>${test_results_dict.get( 'stdout', '' )}</td> + <td>${stdout}</td></tr> %else: <tr><td><b>Stderr</b></td> - <td>${test_results_dict.get( 'stderr', '' )}</td> + <td>${stderr}</td></tr><tr><td><b>Traceback</b></td> - <td>${test_results_dict.get( 'traceback', '' )}</td> + <td>${traceback}</td></tr> %endif %endfor diff -r 26006e793a32a35328d941f6cea573b0108faab7 -r 3a3eab0b0adbda30e72fdda0c5de899728bcd5e6 templates/webapps/tool_shed/repository/manage_repository.mako --- a/templates/webapps/tool_shed/repository/manage_repository.mako +++ b/templates/webapps/tool_shed/repository/manage_repository.mako @@ -88,6 +88,9 @@ %if can_browse_repository_reviews: <a class="action-button" href="${h.url_for( controller='repository_review', action='manage_repository_reviews', id=trans.app.security.encode_id( repository.id ) )}">Browse reviews of this repository</a> %endif + %if can_display_tool_functional_test_results: + <a class="action-button" href="${h.url_for( controller='repository', action='display_tool_functional_test_results', repository_id=trans.security.encode_id( repository.id ), repository_metadata_id=trans.security.encode_id( repository_metadata.id ) )}">View tool functional test results</a> + %endif %if can_upload: <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ) )}">Upload files to repository</a> %endif @@ -112,9 +115,6 @@ %if can_undeprecate: <a class="action-button" href="${h.url_for( controller='repository', action='deprecate', id=trans.security.encode_id( repository.id ), mark_deprecated=False )}">Mark repository as not deprecated</a> %endif - %if can_display_tool_functional_test_results: - <a class="action-button" href="${h.url_for( controller='repository', action='display_tool_functional_test_results', repository_id=trans.security.encode_id( repository.id ), repository_metadata_id=trans.security.encode_id( repository_metadata.id ) )}">View tool functional test results</a> - %endif %if can_download: <a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.app.security.encode_id( repository.id ), changeset_revision=changeset_revision, file_type='gz' )}">Download as a .tar.gz file</a><a class="action-button" href="${h.url_for( controller='repository', action='download', repository_id=trans.app.security.encode_id( repository.id ), changeset_revision=changeset_revision, file_type='bz2' )}">Download as a .tar.bz2 file</a> diff -r 26006e793a32a35328d941f6cea573b0108faab7 -r 3a3eab0b0adbda30e72fdda0c5de899728bcd5e6 templates/webapps/tool_shed/repository/view_repository.mako --- a/templates/webapps/tool_shed/repository/view_repository.mako +++ b/templates/webapps/tool_shed/repository/view_repository.mako @@ -25,6 +25,14 @@ can_view_change_log = trans.webapp.name == 'tool_shed' and not is_new changeset_revision_is_repository_tip = changeset_revision == repository.tip( trans.app ) + if repository_metadata: + if repository_metadata.includes_tools and repository_metadata.tool_test_errors is not None: + can_display_tool_functional_test_results = True + else: + can_display_tool_functional_test_results = False + else: + can_display_tool_functional_test_results = False + if can_push: browse_label = 'Browse or delete repository tip files' else: @@ -80,6 +88,9 @@ %if can_browse_repository_reviews: <a class="action-button" href="${h.url_for( controller='repository_review', action='manage_repository_reviews', id=trans.app.security.encode_id( repository.id ) )}">Browse reviews of this repository</a> %endif + %if can_display_tool_functional_test_results: + <a class="action-button" href="${h.url_for( controller='repository', action='display_tool_functional_test_results', repository_id=trans.security.encode_id( repository.id ), repository_metadata_id=trans.security.encode_id( repository_metadata.id ) )}">View tool functional test results</a> + %endif %if can_upload: <a class="action-button" href="${h.url_for( controller='upload', action='upload', repository_id=trans.security.encode_id( repository.id ) )}">Upload files to repository</a> %endif 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