mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-13 00:44:55 +08:00
Moinor fixes and adjustments to the tool shed's install and test framework.
This commit is contained in:
@@ -259,6 +259,11 @@ def check_and_update_repository_metadata( app, info_only=False, verbosity=1 ):
|
||||
# Create a new dictionary for the most recent test run.
|
||||
tool_test_results_dict = {}
|
||||
test_environment_dict = tool_test_results_dict.get( 'test_environment', {} )
|
||||
# Add the current time as the approximate time that this test run occurs. A similar value will also be
|
||||
# set to the repository_metadata.time_last_tested column, but we also store it here because the Tool Shed
|
||||
# may be configured to store multiple test run results, so each must be associated with a time stamp.
|
||||
now = time.strftime( "%Y-%m-%d %H:%M:%S" )
|
||||
test_environment_dict[ 'time_tested' ] = now
|
||||
test_environment_dict[ 'tool_shed_database_version' ] = get_database_version( app )
|
||||
test_environment_dict[ 'tool_shed_mercurial_version' ] = __version__.version
|
||||
test_environment_dict[ 'tool_shed_revision' ] = get_repository_current_revision( os.getcwd() )
|
||||
|
||||
@@ -1052,17 +1052,22 @@ def build_tool_test_results_folder( trans, folder_id, tool_test_results_dicts, l
|
||||
"""Return a folder hierarchy containing tool dependencies."""
|
||||
# This container is displayed only in the tool shed.
|
||||
if tool_test_results_dicts:
|
||||
multiple_tool_test_results_dicts = len( tool_test_results_dicts ) > 1
|
||||
test_results_dict_id = 0
|
||||
folder_id += 1
|
||||
tool_test_results_root_folder = Folder( id=folder_id, key='root', label='root', parent=None )
|
||||
multiple_tool_test_results_dicts = len( tool_test_results_dicts ) > 1
|
||||
if multiple_tool_test_results_dicts:
|
||||
folder_id += 1
|
||||
test_runs_folder = Folder( id=folder_id, key='test_runs', label='Test runs', parent=tool_test_results_root_folder )
|
||||
tool_test_results_root_folder.folders.append( test_runs_folder )
|
||||
for index, tool_test_results_dict in enumerate( tool_test_results_dicts ):
|
||||
test_environment_dict = tool_test_results_dict.get( 'test_environment', None )
|
||||
if test_environment_dict is not None:
|
||||
time_tested = test_environment_dict.get( 'time_tested', 'unknown_%d' % index )
|
||||
if multiple_tool_test_results_dicts:
|
||||
folder_id += 1
|
||||
containing_folder = Folder( id=folder_id, key='test_results', label=time_tested, parent=tool_test_results_root_folder )
|
||||
containing_folder = Folder( id=folder_id, key='test_results', label=time_tested, parent=test_runs_folder )
|
||||
test_runs_folder.folders.append( containing_folder )
|
||||
else:
|
||||
containing_folder = tool_test_results_root_folder
|
||||
test_results_dict_id += 1
|
||||
@@ -1150,6 +1155,7 @@ def build_tool_test_results_folder( trans, folder_id, tool_test_results_dicts, l
|
||||
key='installation_errors',
|
||||
label='Installation errors',
|
||||
parent=containing_folder )
|
||||
containing_folder.installation_errors.append( installation_error_base_folder )
|
||||
if current_repository_errors:
|
||||
folder_id += 1
|
||||
subfolder = Folder( id=folder_id,
|
||||
@@ -1200,9 +1206,6 @@ def build_tool_test_results_folder( trans, folder_id, tool_test_results_dicts, l
|
||||
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 )
|
||||
containing_folder.installation_errors.append( installation_error_base_folder )
|
||||
if multiple_tool_test_results_dicts:
|
||||
tool_test_results_root_folder.folders.append( containing_folder )
|
||||
else:
|
||||
tool_test_results_root_folder = None
|
||||
return folder_id, tool_test_results_root_folder
|
||||
|
||||
@@ -1206,7 +1206,8 @@ def test_repository_tools( app, repository, repository_dict, tool_test_results_d
|
||||
response_dict = register_test_result( galaxy_tool_shed_url, tool_test_results_dicts, tool_test_results_dict, repository_dict, params )
|
||||
log.debug( 'Revision %s of repository %s installed and passed functional tests.' % ( str( changeset_revision ), str( name ) ) )
|
||||
else:
|
||||
tool_test_results_dict[ 'failed_tests' ].append( extract_log_data( result, from_tool_test=True ) )
|
||||
# The extract_log_data() netod returns a list.
|
||||
tool_test_results_dict[ 'failed_tests' ] = extract_log_data( result, from_tool_test=True )
|
||||
results_dict[ 'repositories_failed' ].append( dict( name=name, owner=owner, changeset_revision=changeset_revision ) )
|
||||
set_do_not_test = not is_latest_downloadable_revision( galaxy_tool_shed_url, repository_dict )
|
||||
params = dict( tools_functionally_correct=False,
|
||||
|
||||
Reference in New Issue
Block a user