commit/galaxy-central: greg: Fixes for comparing datetime values in the tool shed's install and test framework.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/af196ff2cc63/ Changeset: af196ff2cc63 User: greg Date: 2014-01-08 15:25:17 Summary: Fixes for comparing datetime values in the tool shed's install and test framework. Affected #: 2 files diff -r 6aeb657bc40ee0884f538308e1bfbec0b197c44b -r af196ff2cc63fcc59b07c1579891ffe7bed2013a lib/galaxy/webapps/tool_shed/model/__init__.py --- a/lib/galaxy/webapps/tool_shed/model/__init__.py +++ b/lib/galaxy/webapps/tool_shed/model/__init__.py @@ -271,6 +271,13 @@ return True return False + def to_dict( self, view='collection', value_mapper=None ): + rval = super( RepositoryMetadata, self ).to_dict( view=view, value_mapper=value_mapper ) + if 'time_last_tested' in rval: + time_last_tested = rval[ 'time_last_tested' ] + rval[ 'time_last_tested' ] = time_last_tested.isoformat() + return rval + class SkipToolTest( object, Dictifiable ): dict_collection_visible_keys = ( 'id', 'repository_metadata_id', 'initial_changeset_revision' ) diff -r 6aeb657bc40ee0884f538308e1bfbec0b197c44b -r af196ff2cc63fcc59b07c1579891ffe7bed2013a 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 @@ -898,16 +898,16 @@ log.debug( 'due to the following error getting tool_test_results:\n%s' % str( error_message ) ) else: # Check the required repository's time_last_tested value to see if its tool_test_results column - # has been updated within the past 12 hours. - """ - twelve_hours_ago = datetime.utcnow() - timedelta( hours=12 ) + # has been updated within the past 12 hours. The RepositoryMetadata class's to_dict() method + # returns the value of time_last_tested in datetime.isoformat(). + twelve_hours_ago = ( datetime.utcnow() - timedelta( hours=12 ) ).isoformat() time_last_tested, error_message = get_time_last_tested( galaxy_tool_shed_url, repository_metadata_id ) if time_last_tested is not None and time_last_tested < twelve_hours_ago: log.debug( 'The install containers for version %s of repository dependency %s owned by %s have been ' % \ ( changeset_revision, name, owner ) ) log.debug( 'populated within the past 12 hours (likely in this test run), so skipping this check.' ) continue - if time_last_tested is None: + elif time_last_tested is None: log.debug( 'The time_last_tested column value is None for version %s of repository dependency %s owned by %s.' % \ ( changeset_revision, name, owner ) ) elif time_last_tested < twelve_hours_ago: @@ -916,7 +916,6 @@ else: log.debug( 'Version %s of repository dependency %s owned by %s was last tested more than 12 hours ago.' % \ ( changeset_revision, name, owner ) ) - """ # Inspect the tool_test_results_dict for the last test run to see if it has not yet been populated. if len( tool_test_results_dicts ) == 0: tool_test_results_dict = {} @@ -977,8 +976,8 @@ else: log.debug( 'Cannot retrieve revision %s of required repository %s owned by %s from the database ' % \ ( changeset_revision, name, owner ) ) - log.debug( 'so tool_test_results cannot be saved.' ) - log.debug( 'The attributes used to retrieve the record are:\n' ) + log.debug( 'so tool_test_results cannot be saved at this time.' ) + log.debug( 'The attributes used to retrieve the record are:' ) log.debug( 'tool_shed: %s name: %s owner: %s changeset_revision: %s' % \ ( cleaned_tool_shed_url, name, owner, 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.
participants (1)
-
commits-noreply@bitbucket.org