commit/galaxy-central: inithello: Functional tests to verify batch reset of repository metadata on tool shed and galaxy side. Made functional test scripts possible to run independently. Cleaned up common methods in tool_shed/base/twilltestcase.py.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/e6030730bb85/ changeset: e6030730bb85 user: inithello date: 2012-12-18 18:41:13 summary: Functional tests to verify batch reset of repository metadata on tool shed and galaxy side. Made functional test scripts possible to run independently. Cleaned up common methods in tool_shed/base/twilltestcase.py. affected #: 16 files diff -r 8e1eec8c56cc5f62f5541c754f31607675347285 -r e6030730bb85b532534f7229c79751efadcd1eb7 test/tool_shed/base/test_db_util.py --- a/test/tool_shed/base/test_db_util.py +++ b/test/tool_shed/base/test_db_util.py @@ -14,6 +14,10 @@ def flush( obj ): sa_session.add( obj ) sa_session.flush() +def get_all_repositories(): + return sa_session.query( model.Repository ).all() +def get_all_installed_repositories(): + return ga_session.query( galaxy.model.ToolShedRepository ).all() def get_category_by_name( name ): return sa_session.query( model.Category ) \ .filter( model.Category.table.c.name == name ) \ diff -r 8e1eec8c56cc5f62f5541c754f31607675347285 -r e6030730bb85b532534f7229c79751efadcd1eb7 test/tool_shed/base/twilltestcase.py --- a/test/tool_shed/base/twilltestcase.py +++ b/test/tool_shed/base/twilltestcase.py @@ -139,21 +139,13 @@ errmsg = "%i occurrences of '%s' found (min. %i, max. %i).\npage content written to '%s' " % \ ( pattern_count, pattern, min_count, max_count, fname ) raise AssertionError( errmsg ) - def create_category( self, category_name, category_description ): + def create_category( self, **kwd ): + category = test_db_util.get_category_by_name( kwd[ 'name' ] ) + if category is not None: + return category self.visit_url( '/admin/manage_categories?operation=create' ) - tc.fv( "1", "name", category_name ) - tc.fv( "1", "description", category_description ) - tc.submit( "create_category_button" ) - def create_repository( self, repository_name, repository_description, repository_long_description=None, categories=[], strings_displayed=[], strings_not_displayed=[] ): - self.visit_url( '/repository/create_repository' ) - tc.fv( "1", "name", repository_name ) - tc.fv( "1", "description", repository_description ) - if repository_long_description is not None: - tc.fv( "1", "long_description", repository_long_description ) - for category in categories: - tc.fv( "1", "category_id", "+%s" % category ) - tc.submit( "create_repository_button" ) - self.check_for_strings( strings_displayed, strings_not_displayed ) + self.submit_form( form_no=1, button="create_category_button", **kwd ) + return test_db_util.get_category_by_name( kwd[ 'name' ] ) def create_user_in_galaxy( self, cntrller='user', email='test@bx.psu.edu', password='testuser', username='admin-user', redirect='' ): self.visit_galaxy_url( "/user/create?cntrller=%s&use_panels=False" % cntrller ) tc.fv( '1', 'email', email ) @@ -325,6 +317,14 @@ return os.path.abspath( os.path.join( filepath, filename ) ) else: return os.path.abspath( os.path.join( self.file_dir, filename ) ) + def get_or_create_repository( self, owner=None, strings_displayed=[], strings_not_displayed=[], **kwd ): + repository = test_db_util.get_repository_by_name_and_owner( kwd[ 'name' ], owner ) + if repository is None: + self.visit_url( '/repository/create_repository' ) + self.submit_form( 1, 'create_repository_button', **kwd ) + self.check_for_strings( strings_displayed, strings_not_displayed ) + repository = test_db_util.get_repository_by_name_and_owner( kwd[ 'name' ], owner ) + return repository def get_repo_path( self, repository ): # An entry in the hgweb.config file looks something like: repos/test/mira_assembler = database/community_files/000/repo_123 lhs = "repos/%s/%s" % ( repository.user.username, repository.name ) @@ -387,7 +387,12 @@ tc.fv( "3", "allow_push", '+%s' % username ) tc.submit( 'user_access_button' ) self.check_for_strings( strings_displayed, strings_not_displayed ) - def install_repository( self, name, owner, install_tool_dependencies=False, changeset_revision=None, strings_displayed=[], strings_not_displayed=[] ): + def install_repository( self, name, owner, category_name, install_tool_dependencies=False, changeset_revision=None, strings_displayed=[], strings_not_displayed=[] ): + if test_db_util.get_installed_repository_by_name_owner( name, owner ) is not None: + return + self.browse_tool_shed( url=self.url ) + self.browse_category( test_db_util.get_category_by_name( category_name ) ) + self.preview_repository_in_tool_shed( name, common.test_user_1_name, strings_displayed=[] ) repository = test_db_util.get_repository_by_name_and_owner( name, owner ) repository_id = self.security.encode_id( repository.id ) if changeset_revision is None: @@ -446,6 +451,14 @@ url = '/admin_toolshed/reset_repository_metadata?id=%s' % self.security.encode_id( repository.id ) self.visit_galaxy_url( url ) self.check_for_strings( [ 'Metadata has been reset' ] ) + def reset_metadata_on_selected_repositories( self, repository_ids ): + self.visit_url( '/admin/reset_metadata_on_selected_repositories_in_tool_shed' ) + kwd = dict( repository_ids=repository_ids ) + self.submit_form( form_no=1, button="reset_metadata_on_selected_repositories_button", **kwd ) + def reset_metadata_on_selected_installed_repositories( self, repository_ids ): + self.visit_galaxy_url( '/admin_toolshed/reset_metadata_on_selected_installed_repositories' ) + kwd = dict( repository_ids=repository_ids ) + self.submit_form( form_no=1, button="reset_metadata_on_selected_repositories_button", **kwd ) def reset_repository_metadata( self, repository ): url = '/repository/reset_all_metadata?id=%s' % self.security.encode_id( repository.id ) self.visit_url( url ) @@ -496,25 +509,10 @@ self.check_for_strings( strings_displayed, strings_not_displayed ) def verify_installed_repository_metadata_unchanged( self, name, owner ): installed_repository = test_db_util.get_installed_repository_by_name_owner( name, owner ) - differs = False metadata = installed_repository.metadata self.reset_installed_repository_metadata( installed_repository ) new_metadata = installed_repository.metadata - # This test assumes that the different metadata components will always appear in the same order. If this is ever not - # the case, this test must be updated. - for metadata_key in [ 'datatypes', 'tools', 'tool_dependencies', 'repository_dependencies', 'workflows' ]: - if ( metadata_key in metadata and metadata_key not in new_metadata ) or \ - ( metadata_key not in metadata and metadata_key in new_metadata ): - differs = True - break - elif metadata_key not in metadata and metadata_key not in new_metadata: - continue - else: - if metadata[ metadata_key ] != new_metadata[ metadata_key ]: - differs = True - break - if differs: - raise AssertionError( 'Metadata for installed repository %s differs after metadata reset.' % name ) + assert metadata == new_metadata, 'Metadata for installed repository %s differs after metadata reset.' % name def verify_installed_repository_on_browse_page( self, installed_repository, strings_displayed=[], strings_not_displayed=[] ): url = '/admin_toolshed/browse_repositories' self.visit_galaxy_url( url ) @@ -544,10 +542,14 @@ self.visit_galaxy_url( url ) self.check_for_strings( strings, strings_not_displayed ) def verify_unchanged_repository_metadata( self, repository ): - self.check_repository_changelog( repository ) - html = self.last_page() + old_metadata = dict() + new_metadata = dict() + for metadata in self.get_repository_metadata( repository ): + old_metadata[ metadata.changeset_revision ] = metadata.metadata self.reset_repository_metadata( repository ) - self.check_repository_changelog( repository, strings_displayed=[ html ] ) + for metadata in self.get_repository_metadata( repository ): + new_metadata[ metadata.changeset_revision ] = metadata.metadata + assert old_metadata == new_metadata, 'Metadata changed after reset on repository %s.' % repository.name def visit_galaxy_url( self, url ): url = '%s%s' % ( self.galaxy_url, url ) self.visit_url( url ) diff -r 8e1eec8c56cc5f62f5541c754f31607675347285 -r e6030730bb85b532534f7229c79751efadcd1eb7 test/tool_shed/functional/test_0000_basic_repository_features.py --- a/test/tool_shed/functional/test_0000_basic_repository_features.py +++ b/test/tool_shed/functional/test_0000_basic_repository_features.py @@ -11,7 +11,7 @@ """Create necessary user accounts and login as an admin user.""" self.login( email=common.test_user_1_email, username=common.test_user_1_name ) test_user_1 = test_db_util.get_user( common.test_user_1_email ) - assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email + assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % common.test_user_1_email test_user_1_private_role = test_db_util.get_private_role( test_user_1 ) self.logout() self.login( email=common.admin_email, username=common.admin_username ) @@ -20,22 +20,21 @@ admin_user_private_role = test_db_util.get_private_role( admin_user ) def test_0005_create_categories( self ): """Create categories for this test suite""" - self.create_category( 'Test 0000 Basic Repository Features 1', 'Test 0000 Basic Repository Features 1' ) - self.create_category( 'Test 0000 Basic Repository Features 2', 'Test 0000 Basic Repository Features 2' ) + self.create_category( name='Test 0000 Basic Repository Features 1', description='Test 0000 Basic Repository Features 1' ) + self.create_category( name='Test 0000 Basic Repository Features 2', description='Test 0000 Basic Repository Features 2' ) def test_0010_create_repository( self ): """Create the filtering repository""" self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - test_user_1 = test_db_util.get_user( common.test_user_1_email ) - assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email - test_user_1_private_role = test_db_util.get_private_role( test_user_1 ) + category = test_db_util.get_category_by_name( 'Test 0000 Basic Repository Features 1' ) strings_displayed = [ 'Repository %s' % "'%s'" % repository_name, 'Repository %s has been created' % "'%s'" % repository_name ] - self.create_repository( repository_name, - repository_description, - repository_long_description=repository_long_description, - categories=[ 'Test 0000 Basic Repository Features 1' ], - strings_displayed=strings_displayed ) + self.get_or_create_repository( name=repository_name, + description=repository_description, + long_description=repository_long_description, + owner=common.test_user_1_name, + category_id=self.security.encode_id( category.id ), + strings_displayed=strings_displayed ) def test_0015_edit_repository( self ): """Edit the repository name, description, and long description""" repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) diff -r 8e1eec8c56cc5f62f5541c754f31607675347285 -r e6030730bb85b532534f7229c79751efadcd1eb7 test/tool_shed/functional/test_0010_repository_with_tool_dependencies.py --- a/test/tool_shed/functional/test_0010_repository_with_tool_dependencies.py +++ b/test/tool_shed/functional/test_0010_repository_with_tool_dependencies.py @@ -21,17 +21,18 @@ admin_user_private_role = test_db_util.get_private_role( admin_user ) def test_0005_create_category( self ): """Create a category for this test suite""" - self.create_category( 'Test 0010 Repository With Tool Dependencies', 'Tests for a repository with tool dependencies.' ) + self.create_category( name='Test 0010 Repository With Tool Dependencies', description='Tests for a repository with tool dependencies.' ) def test_0010_create_freebayes_repository_and_upload_tool_xml( self ): '''Create freebayes repository and upload freebayes.xml without tool_data_table_conf.xml.sample. This should result in an error message and invalid tool.''' self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - self.create_repository( repository_name, - repository_description, - repository_long_description=repository_long_description, - categories=[ 'Test 0010 Repository With Tool Dependencies' ], - strings_displayed=[] ) - repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + category = test_db_util.get_category_by_name( 'Test 0010 Repository With Tool Dependencies' ) + repository = self.get_or_create_repository( name=repository_name, + description=repository_description, + long_description=repository_long_description, + owner=common.test_user_1_name, + category_id=self.security.encode_id( category.id ), + strings_displayed=[] ) self.upload_file( repository, 'freebayes/freebayes.xml', valid_tools_only=False, diff -r 8e1eec8c56cc5f62f5541c754f31607675347285 -r e6030730bb85b532534f7229c79751efadcd1eb7 test/tool_shed/functional/test_0020_basic_repository_dependencies.py --- a/test/tool_shed/functional/test_0020_basic_repository_dependencies.py +++ b/test/tool_shed/functional/test_0020_basic_repository_dependencies.py @@ -25,17 +25,18 @@ admin_user_private_role = test_db_util.get_private_role( admin_user ) def test_0005_create_category( self ): """Create a category for this test suite""" - self.create_category( 'Test 0020 Basic Repository Dependencies', 'Testing basic repository dependency features.' ) + self.create_category( name='Test 0020 Basic Repository Dependencies', description='Testing basic repository dependency features.' ) def test_0010_create_emboss_datatypes_repository_and_upload_tarball( self ): '''Create and populate the emboss_datatypes repository.''' self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - self.create_repository( datatypes_repository_name, - datatypes_repository_description, - repository_long_description=datatypes_repository_long_description, - categories=[ 'Test 0020 Basic Repository Dependencies' ], - strings_displayed=[] ) - repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) + category = test_db_util.get_category_by_name( 'Test 0020 Basic Repository Dependencies' ) + repository = self.get_or_create_repository( name=datatypes_repository_name, + description=datatypes_repository_description, + long_description=datatypes_repository_long_description, + owner=common.test_user_1_name, + category_id=self.security.encode_id( category.id ), + strings_displayed=[] ) self.upload_file( repository, 'emboss/datatypes/datatypes_conf.xml', commit_message='Uploaded datatypes_conf.xml.' ) def test_0015_verify_datatypes_in_datatypes_repository( self ): '''Verify that the emboss_datatypes repository contains datatype entries.''' @@ -43,12 +44,13 @@ self.display_manage_repository_page( repository, strings_displayed=[ 'Datatypes', 'equicktandem', 'hennig86', 'vectorstrip' ] ) def test_0020_create_emboss_5_repository_and_upload_files( self ): '''Create and populate the emboss_5_0020 repository.''' - self.create_repository( emboss_repository_name, - emboss_repository_description, - repository_long_description=emboss_repository_long_description, - categories=[ 'Test 0020 Basic Repository Dependencies' ], - strings_displayed=[] ) - repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + category = test_db_util.get_category_by_name( 'Test 0020 Basic Repository Dependencies' ) + repository = self.get_or_create_repository( name=emboss_repository_name, + description=emboss_repository_description, + long_description=emboss_repository_long_description, + owner=common.test_user_1_name, + category_id=self.security.encode_id( category.id ), + strings_displayed=[] ) self.upload_file( repository, 'emboss/emboss.tar', commit_message='Uploaded emboss_5.tar' ) def test_0025_generate_and_upload_repository_dependencies_xml( self ): '''Generate and upload the repository_dependencies.xml file''' diff -r 8e1eec8c56cc5f62f5541c754f31607675347285 -r e6030730bb85b532534f7229c79751efadcd1eb7 test/tool_shed/functional/test_0030_repository_dependency_revisions.py --- a/test/tool_shed/functional/test_0030_repository_dependency_revisions.py +++ b/test/tool_shed/functional/test_0030_repository_dependency_revisions.py @@ -27,48 +27,36 @@ admin_user_private_role = test_db_util.get_private_role( admin_user ) def test_0005_create_category( self ): """Create a category for this test suite""" - self.create_category( 'Test 0030 Repository Dependency Revisions', 'Testing repository dependencies by revision.' ) + self.create_category( name='Test 0030 Repository Dependency Revisions', description='Testing repository dependencies by revision.' ) def test_0010_create_repositories( self ): '''Create the emboss_5_0030, emboss_6_0030, emboss_datatypes_0030, and emboss_0030 repositories and populate the emboss_datatypes repository.''' self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - emboss_5_repository = test_db_util.get_repository_by_name_and_owner( emboss_5_repository_name, common.test_user_1_name ) - if emboss_5_repository is None: - self.create_repository( emboss_5_repository_name, - emboss_repository_description, - repository_long_description=emboss_repository_long_description, - categories=[ 'Test 0030 Repository Dependency Revisions' ], - strings_displayed=[] ) - emboss_5_repository = test_db_util.get_repository_by_name_and_owner( emboss_5_repository_name, common.test_user_1_name ) - self.upload_file( emboss_5_repository, 'emboss/emboss.tar', commit_message='Uploaded tool tarball.' ) - emboss_6_repository = test_db_util.get_repository_by_name_and_owner( emboss_6_repository_name, common.test_user_1_name ) - if emboss_6_repository is None: - self.create_repository( emboss_6_repository_name, - emboss_repository_description, - repository_long_description=emboss_repository_long_description, - categories=[ 'Test 0030 Repository Dependency Revisions' ], - strings_displayed=[] ) - emboss_6_repository = test_db_util.get_repository_by_name_and_owner( emboss_6_repository_name, common.test_user_1_name ) - self.upload_file( emboss_6_repository, 'emboss/emboss.tar', commit_message='Uploaded tool tarball..' ) - datatypes_repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) - if datatypes_repository is None: - self.create_repository( datatypes_repository_name, - datatypes_repository_description, - repository_long_description=datatypes_repository_long_description, - categories=[ 'Test 0030 Repository Dependency Revisions' ], - strings_displayed=[] ) - datatypes_repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) - if self.repository_is_new( datatypes_repository ): - self.upload_file( datatypes_repository, 'emboss/datatypes/datatypes_conf.xml', commit_message='Uploaded datatypes_conf.xml.' ) - emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) - if emboss_repository is None: - self.create_repository( emboss_repository_name, - emboss_repository_description, - repository_long_description=emboss_repository_long_description, - categories=[ 'Test 0030 Repository Dependency Revisions' ], - strings_displayed=[] ) - emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) - self.upload_file( emboss_repository, 'emboss/emboss.tar', commit_message='Uploaded tool tarball.' ) + category = test_db_util.get_category_by_name( 'Test 0030 Repository Dependency Revisions' ) + emboss_5_repository = self.get_or_create_repository( name=emboss_5_repository_name, + description=emboss_repository_description, + long_description=emboss_repository_long_description, + owner=common.test_user_1_name, + category_id=self.security.encode_id( category.id ) ) + emboss_6_repository = self.get_or_create_repository( name=emboss_6_repository_name, + description=emboss_repository_description, + long_description=emboss_repository_long_description, + owner=common.test_user_1_name, + category_id=self.security.encode_id( category.id ) ) + datatypes_repository = self.get_or_create_repository( name=datatypes_repository_name, + description=emboss_repository_description, + long_description=emboss_repository_long_description, + owner=common.test_user_1_name, + category_id=self.security.encode_id( category.id ) ) + emboss_repository = self.get_or_create_repository( name=emboss_repository_name, + description=emboss_repository_description, + long_description=emboss_repository_long_description, + owner=common.test_user_1_name, + category_id=self.security.encode_id( category.id ) ) + self.upload_file( emboss_5_repository, 'emboss/emboss.tar', commit_message='Uploaded tool tarball.' ) + self.upload_file( emboss_6_repository, 'emboss/emboss.tar', commit_message='Uploaded tool tarball.' ) + self.upload_file( datatypes_repository, 'emboss/datatypes/datatypes_conf.xml', commit_message='Uploaded datatypes_conf.xml.' ) + self.upload_file( emboss_repository, 'emboss/emboss.tar', commit_message='Uploaded tool tarball.' ) def test_0015_generate_repository_dependencies_for_emboss_5( self ): '''Generate a repository_dependencies.xml file specifying emboss_datatypes and upload it to the emboss_5 repository.''' datatypes_repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) diff -r 8e1eec8c56cc5f62f5541c754f31607675347285 -r e6030730bb85b532534f7229c79751efadcd1eb7 test/tool_shed/functional/test_0040_repository_circular_dependencies.py --- a/test/tool_shed/functional/test_0040_repository_circular_dependencies.py +++ b/test/tool_shed/functional/test_0040_repository_circular_dependencies.py @@ -25,17 +25,17 @@ admin_user_private_role = test_db_util.get_private_role( admin_user ) def test_0005_create_category( self ): """Create a category for this test suite""" - self.create_category( 'test_0040_repository_circular_dependencies', 'Testing handling of circular repository dependencies.' ) + self.create_category( name='test_0040_repository_circular_dependencies', description='Testing handling of circular repository dependencies.' ) def test_0010_create_freebayes_repository_name( self ): '''Create and populate freebayes_0040.''' self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - self.create_repository( freebayes_repository_name, - freebayes_repository_name_description, - repository_long_description=freebayes_repository_name_long_description, - categories=[ 'test_0040_repository_circular_dependencies' ], - strings_displayed=[] ) - repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) + repository = self.get_or_create_repository( name=freebayes_repository_name, + description=freebayes_repository_name_description, + long_description=freebayes_repository_name_long_description, + owner=common.test_user_1_name, + categories=[ 'test_0040_repository_circular_dependencies' ], + strings_displayed=[] ) self.upload_file( repository, 'freebayes/freebayes.tar', strings_displayed=[], @@ -44,12 +44,12 @@ '''Create and populate filtering_0040.''' self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - self.create_repository( filtering_repository_name, - filtering_repository_description, - repository_long_description=filtering_repository_long_description, - categories=[ 'test_0040_repository_circular_dependencies' ], - strings_displayed=[] ) - repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) + repository = self.get_or_create_repository( name=filtering_repository_name, + description=filtering_repository_description, + long_description=filtering_repository_long_description, + owner=common.test_user_1_name, + categories=[ 'test_0040_repository_circular_dependencies' ], + strings_displayed=[] ) self.upload_file( repository, 'filtering/filtering_1.1.0.tar', strings_displayed=[], diff -r 8e1eec8c56cc5f62f5541c754f31607675347285 -r e6030730bb85b532534f7229c79751efadcd1eb7 test/tool_shed/functional/test_0050_circular_dependencies_4_levels.py --- /dev/null +++ b/test/tool_shed/functional/test_0050_circular_dependencies_4_levels.py @@ -0,0 +1,158 @@ +from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os +import tool_shed.base.test_db_util as test_db_util + +emboss_datatypes_repository_name = 'emboss_datatypes_0050' +emboss_datatypes_repository_description = "Datatypes for emboss" +emboss_datatypes_repository_long_description = "Long description of Emboss' datatypes" + +emboss_repository_name = 'emboss_0050' +emboss_repository_description = "Galaxy's emboss tool" +emboss_repository_long_description = "Long description of Galaxy's emboss tool" + +filtering_repository_name = 'filtering_0050' +filtering_repository_description = "Galaxy's filtering tool" +filtering_repository_long_description = "Long description of Galaxy's filtering tool" + +freebayes_repository_name = 'freebayes_0050' +freebayes_repository_description = "Galaxy's freebayes tool" +freebayes_repository_long_description = "Long description of Galaxy's freebayes tool" + +default_category = 'test_0050_repository_n_level_circular_dependencies' +default_category_description = 'Testing handling of circular repository dependencies to n levels.' + +class TestRepositoryCircularDependenciesToNLevels( ShedTwillTestCase ): + '''Verify that the code correctly handles circular dependencies down to n levels.''' + def test_0000_initiate_users( self ): + """Create necessary user accounts.""" + self.logout() + self.login( email=common.test_user_1_email, username=common.test_user_1_name ) + test_user_1 = test_db_util.get_user( common.test_user_1_email ) + assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email + test_user_1_private_role = test_db_util.get_private_role( test_user_1 ) + self.logout() + self.login( email=common.admin_email, username=common.admin_username ) + admin_user = test_db_util.get_user( common.admin_email ) + assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email + admin_user_private_role = test_db_util.get_private_role( admin_user ) + def test_0005_create_category( self ): + """Create a category for this test suite""" + self.create_category( name=default_category, description=default_category_description ) + def test_0010_create_emboss_datatypes_repository( self ): + '''Create and populate emboss_datatypes_0050.''' + self.logout() + self.login( email=common.test_user_1_email, username=common.test_user_1_name ) + repository = self.get_or_create_repository( name=emboss_datatypes_repository_name, + description=emboss_datatypes_repository_description, + long_description=emboss_datatypes_repository_long_description, + owner=common.test_user_1_name, + categories=[ default_category ], + strings_displayed=[] ) + self.upload_file( repository, + 'emboss/datatypes/datatypes_conf.xml', + strings_displayed=[], + commit_message='Uploaded datatypes_conf.xml.' ) + def test_0015_create_emboss_repository( self ): + '''Create and populate emboss_0050.''' + repository = self.get_or_create_repository( name=emboss_repository_name, + description=emboss_repository_description, + long_description=emboss_repository_long_description, + owner=common.test_user_1_name, + categories=[ default_category ], + strings_displayed=[] ) + self.upload_file( repository, + 'emboss/emboss.tar', + strings_displayed=[], + commit_message='Uploaded tool tarball.' ) + datatypes_repository = test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name ) + repository_dependencies_path = self.generate_temp_path( 'test_0050', additional_paths=[ 'emboss' ] ) + self.generate_repository_dependency_xml( [ datatypes_repository ], + self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), + dependency_description='Emboss depends on the emboss_datatypes repository.' ) + self.upload_file( repository, + 'repository_dependencies.xml', + filepath=repository_dependencies_path, + commit_message='Uploaded dependency on emboss_datatypes.' ) + def test_0020_create_filtering_repository( self ): + '''Create and populate filtering_0050.''' + filtering_repository = self.get_or_create_repository( name=filtering_repository_name, + description=filtering_repository_description, + long_description=filtering_repository_long_description, + owner=common.test_user_1_name, + categories=[ default_category ], + strings_displayed=[] ) + self.upload_file( filtering_repository, + 'filtering/filtering_1.1.0.tar', + strings_displayed=[], + commit_message='Uploaded filtering.tar.' ) + emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + repository_dependencies_path = self.generate_temp_path( 'test_0050', additional_paths=[ 'filtering' ] ) + self.generate_repository_dependency_xml( [ emboss_repository ], + self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), + dependency_description='Filtering depends on the emboss repository.' ) + self.upload_file( filtering_repository, + 'repository_dependencies.xml', + filepath=repository_dependencies_path, + commit_message='Uploaded dependency on emboss.' ) + def test_0025_create_freebayes_repository( self ): + '''Create and populate freebayes_0050.''' + repository = self.get_or_create_repository( name=freebayes_repository_name, + description=freebayes_repository_description, + long_description=freebayes_repository_long_description, + owner=common.test_user_1_name, + categories=[ default_category ], + strings_displayed=[] ) + self.upload_file( repository, + 'freebayes/freebayes.tar', + strings_displayed=[], + commit_message='Uploaded freebayes.tar.' ) + emboss_datatypes_repository = test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name ) + emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + filtering_repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) + repository_dependencies_path = self.generate_temp_path( 'test_0050', additional_paths=[ 'freebayes' ] ) + self.generate_repository_dependency_xml( [ filtering_repository ], + self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), + dependency_description='Emboss depends on the filtering repository.' ) + self.upload_file( emboss_repository, + 'repository_dependencies.xml', + filepath=repository_dependencies_path, + commit_message='Uploaded dependency on filtering.' ) + previous_tip = self.get_repository_tip( repository ) + self.generate_repository_dependency_xml( [ emboss_datatypes_repository, emboss_repository, filtering_repository, repository ], + self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), + dependency_description='Freebayes depends on the filtering repository.' ) + self.upload_file( repository, + 'repository_dependencies.xml', + filepath=repository_dependencies_path, + commit_message='Uploaded dependency on filtering.' ) + self.display_manage_repository_page( repository, strings_not_displayed=[ previous_tip ] ) + def test_0030_verify_repository_dependencies( self ): + '''Verify that the generated dependency circle does not cause an infinite loop. + + Expected structure: + + id: 2 key: http://localhost:8634__ESEP__freebayes_0050__ESEP__user1__ESEP__2e73d8e1b59d + ['http://localhost:8634', 'emboss_datatypes_0050', 'user1', '596029c334b1'] + ['http://localhost:8634', 'emboss_0050', 'user1', '9f1503046640'] + id: 3 key: http://localhost:8634__ESEP__filtering_0050__ESEP__user1__ESEP__eefdd8bc0db9 + ['http://localhost:8634', 'emboss_0050', 'user1', '9f1503046640'] + id: 4 key: http://localhost:8634__ESEP__emboss_0050__ESEP__user1__ESEP__9f1503046640 + ['http://localhost:8634', 'emboss_datatypes_0050', 'user1', '596029c334b1'] + ''' + emboss_datatypes_repository = test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name ) + emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + filtering_repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) + freebayes_repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) + for repository in [ emboss_datatypes_repository, emboss_repository, filtering_repository ]: + self.check_repository_dependency( freebayes_repository, repository, self.get_repository_tip( repository ) ) + for changeset_revision in self.get_repository_metadata_revisions( emboss_repository ): + self.check_repository_dependency( freebayes_repository, emboss_repository, changeset_revision ) + self.display_manage_repository_page( freebayes_repository, + strings_displayed=[ 'Freebayes depends on the filtering repository.' ] ) + def test_0035_verify_repository_metadata( self ): + '''Verify that resetting the metadata does not change it.''' + emboss_datatypes_repository = test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name ) + emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + filtering_repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) + freebayes_repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) + for repository in [ emboss_datatypes_repository, emboss_repository, freebayes_repository, filtering_repository ]: + self.verify_unchanged_repository_metadata( repository ) diff -r 8e1eec8c56cc5f62f5541c754f31607675347285 -r e6030730bb85b532534f7229c79751efadcd1eb7 test/tool_shed/functional/test_0050_circular_n_levels.py --- a/test/tool_shed/functional/test_0050_circular_n_levels.py +++ /dev/null @@ -1,157 +0,0 @@ -from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os -import tool_shed.base.test_db_util as test_db_util - -emboss_datatypes_repository_name = 'emboss_datatypes_0050' -emboss_datatypes_repository_description = "Datatypes for emboss" -emboss_datatypes_repository_long_description = "Long description of Emboss' datatypes" - -emboss_repository_name = 'emboss_0050' -emboss_repository_description = "Galaxy's emboss tool" -emboss_repository_long_description = "Long description of Galaxy's emboss tool" - -freebayes_repository_name = 'freebayes_0050' -freebayes_repository_description = "Galaxy's freebayes tool" -freebayes_repository_long_description = "Long description of Galaxy's freebayes tool" - -filtering_repository_name = 'filtering_0050' -filtering_repository_description = "Galaxy's filtering tool" -filtering_repository_long_description = "Long description of Galaxy's filtering tool" - -default_category = 'test_0050_repository_n_level_circular_dependencies' -default_category_description = 'Testing handling of circular repository dependencies to n levels.' - -class TestRepositoryCircularDependenciesToNLevels( ShedTwillTestCase ): - '''Verify that the code correctly handles circular dependencies down to n levels.''' - def test_0000_initiate_users( self ): - """Create necessary user accounts.""" - self.logout() - self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - test_user_1 = test_db_util.get_user( common.test_user_1_email ) - assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email - test_user_1_private_role = test_db_util.get_private_role( test_user_1 ) - self.logout() - self.login( email=common.admin_email, username=common.admin_username ) - admin_user = test_db_util.get_user( common.admin_email ) - assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email - admin_user_private_role = test_db_util.get_private_role( admin_user ) - def test_0005_create_category( self ): - """Create a category for this test suite""" - self.create_category( default_category, default_category_description ) - def test_0010_create_emboss_datatypes_repository( self ): - '''Create and populate emboss_datatypes_0050.''' - self.logout() - self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - self.create_repository( emboss_datatypes_repository_name, - emboss_datatypes_repository_description, - repository_long_description=emboss_datatypes_repository_long_description, - categories=[ default_category ], - strings_displayed=[] ) - repository = test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name ) - self.upload_file( repository, - 'emboss/datatypes/datatypes_conf.xml', - strings_displayed=[], - commit_message='Uploaded datatypes_conf.xml.' ) - def test_0015_create_emboss_repository( self ): - '''Create and populate emboss_0050.''' - self.create_repository( emboss_repository_name, - emboss_repository_description, - repository_long_description=emboss_repository_long_description, - categories=[ default_category ], - strings_displayed=[] ) - repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) - self.upload_file( repository, - 'emboss/emboss.tar', - strings_displayed=[], - commit_message='Uploaded tool tarball.' ) - datatypes_repository = test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name ) - repository_dependencies_path = self.generate_temp_path( 'test_0050', additional_paths=[ 'emboss' ] ) - self.generate_repository_dependency_xml( [ datatypes_repository ], - self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), - dependency_description='Emboss depends on the emboss_datatypes repository.' ) - self.upload_file( repository, - 'repository_dependencies.xml', - filepath=repository_dependencies_path, - commit_message='Uploaded dependency on emboss_datatypes.' ) - def test_0020_create_filtering_repository( self ): - '''Create and populate filtering_0050.''' - self.create_repository( filtering_repository_name, - filtering_repository_description, - repository_long_description=filtering_repository_long_description, - categories=[ default_category ], - strings_displayed=[] ) - filtering_repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) - self.upload_file( filtering_repository, - 'filtering/filtering_1.1.0.tar', - strings_displayed=[], - commit_message='Uploaded filtering.tar.' ) - emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) - repository_dependencies_path = self.generate_temp_path( 'test_0050', additional_paths=[ 'filtering' ] ) - self.generate_repository_dependency_xml( [ emboss_repository ], - self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), - dependency_description='Filtering depends on the emboss repository.' ) - self.upload_file( filtering_repository, - 'repository_dependencies.xml', - filepath=repository_dependencies_path, - commit_message='Uploaded dependency on emboss.' ) - def test_0025_create_freebayes_repository( self ): - '''Create and populate freebayes_0050.''' - self.create_repository( freebayes_repository_name, - freebayes_repository_description, - repository_long_description=freebayes_repository_long_description, - categories=[ default_category ], - strings_displayed=[] ) - repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) - self.upload_file( repository, - 'freebayes/freebayes.tar', - strings_displayed=[], - commit_message='Uploaded freebayes.tar.' ) - emboss_datatypes_repository = test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name ) - emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) - filtering_repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) - repository_dependencies_path = self.generate_temp_path( 'test_0050', additional_paths=[ 'freebayes' ] ) - self.generate_repository_dependency_xml( [ filtering_repository ], - self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), - dependency_description='Emboss depends on the filtering repository.' ) - self.upload_file( emboss_repository, - 'repository_dependencies.xml', - filepath=repository_dependencies_path, - commit_message='Uploaded dependency on filtering.' ) - previous_tip = self.get_repository_tip( repository ) - self.generate_repository_dependency_xml( [ emboss_datatypes_repository, emboss_repository, filtering_repository, repository ], - self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), - dependency_description='Freebayes depends on the filtering repository.' ) - self.upload_file( repository, - 'repository_dependencies.xml', - filepath=repository_dependencies_path, - commit_message='Uploaded dependency on filtering.' ) - self.display_manage_repository_page( repository, strings_not_displayed=[ previous_tip ] ) - def test_0030_verify_repository_dependencies( self ): - '''Verify that the generated dependency circle does not cause an infinite loop. - - Expected structure: - - id: 2 key: http://localhost:8634__ESEP__freebayes_0050__ESEP__user1__ESEP__2e73d8e1b59d - ['http://localhost:8634', 'emboss_datatypes_0050', 'user1', '596029c334b1'] - ['http://localhost:8634', 'emboss_0050', 'user1', '9f1503046640'] - id: 3 key: http://localhost:8634__ESEP__filtering_0050__ESEP__user1__ESEP__eefdd8bc0db9 - ['http://localhost:8634', 'emboss_0050', 'user1', '9f1503046640'] - id: 4 key: http://localhost:8634__ESEP__emboss_0050__ESEP__user1__ESEP__9f1503046640 - ['http://localhost:8634', 'emboss_datatypes_0050', 'user1', '596029c334b1'] - ''' - emboss_datatypes_repository = test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name ) - emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) - filtering_repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) - freebayes_repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) - for repository in [ emboss_datatypes_repository, emboss_repository, filtering_repository ]: - self.check_repository_dependency( freebayes_repository, repository, self.get_repository_tip( repository ) ) - for changeset_revision in self.get_repository_metadata_revisions( emboss_repository ): - self.check_repository_dependency( freebayes_repository, emboss_repository, changeset_revision ) - self.display_manage_repository_page( freebayes_repository, strings_displayed=[ 'Freebayes depends on the filtering repository.' ] ) - def test_0035_verify_repository_metadata( self ): - '''Verify that resetting the metadata does not change it.''' - emboss_datatypes_repository = test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name ) - emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) - filtering_repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) - freebayes_repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) - for repository in [ emboss_datatypes_repository, emboss_repository, freebayes_repository, filtering_repository ]: - self.verify_unchanged_repository_metadata( repository ) diff -r 8e1eec8c56cc5f62f5541c754f31607675347285 -r e6030730bb85b532534f7229c79751efadcd1eb7 test/tool_shed/functional/test_0060_workflows.py --- a/test/tool_shed/functional/test_0060_workflows.py +++ b/test/tool_shed/functional/test_0060_workflows.py @@ -23,16 +23,17 @@ admin_user_private_role = test_db_util.get_private_role( admin_user ) def test_0005_create_categories( self ): """Create categories for this test suite""" - self.create_category( 'Test 0060 Workflow Features', 'Test 0060 - Workflow Features' ) + self.create_category( name='Test 0060 Workflow Features', description='Test 0060 - Workflow Features' ) def test_0010_create_repository( self ): """Create and populate the filtering repository""" self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - self.create_repository( repository_name, - repository_description, - repository_long_description=repository_long_description, - categories=[ 'Test 0060 Workflow Features' ], - strings_displayed=[] ) + self.get_or_create_repository( name=repository_name, + description=repository_description, + long_description=repository_long_description, + owner=common.test_user_1_name, + categories=[ 'Test 0060 Workflow Features' ], + strings_displayed=[] ) def test_0015_upload_workflow( self ): '''Upload a workflow with a missing tool, and verify that the tool specified is marked as missing.''' repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) diff -r 8e1eec8c56cc5f62f5541c754f31607675347285 -r e6030730bb85b532534f7229c79751efadcd1eb7 test/tool_shed/functional/test_0300_reset_all_metadata.py --- /dev/null +++ b/test/tool_shed/functional/test_0300_reset_all_metadata.py @@ -0,0 +1,255 @@ +from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os +import tool_shed.base.test_db_util as test_db_util + +datatypes_repository_name = 'emboss_datatypes_0020' +datatypes_repository_description = "Galaxy applicable data formats used by Emboss tools." +datatypes_repository_long_description = "Galaxy applicable data formats used by Emboss tools. This repository contains no tools." +emboss_repository_description = 'Galaxy wrappers for Emboss version 5.0.0 tools' +emboss_repository_long_description = 'Galaxy wrappers for Emboss version 5.0.0 tools' +workflow_filename = 'Workflow_for_0060_filter_workflow_repository.ga' +workflow_name = 'Workflow for 0060_filter_workflow_repository' + +class TestResetAllRepositoryMetadata( ShedTwillTestCase ): + '''Verify that the "Reset selected metadata" feature works.''' + def test_0000_initiate_users( self ): + """Create necessary user accounts.""" + self.logout() + self.login( email=common.test_user_1_email, username=common.test_user_1_name ) + test_user_1 = test_db_util.get_user( common.test_user_1_email ) + assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email + test_user_1_private_role = test_db_util.get_private_role( test_user_1 ) + self.logout() + self.login( email=common.admin_email, username=common.admin_username ) + admin_user = test_db_util.get_user( common.admin_email ) + assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email + admin_user_private_role = test_db_util.get_private_role( admin_user ) + def test_0005_create_repositories_and_categories( self ): + category_0000 = self.create_category( name='Test 0000 Basic Repository Features 1', description='Test 0000 Basic Repository Features 1' ) + category_0001 = self.create_category( name='Test 0000 Basic Repository Features 2', description='Test 0000 Basic Repository Features 2' ) + category_0010 = self.create_category( name='Test 0010 Repository With Tool Dependencies', description='Tests for a repository with tool dependencies.' ) + category_0020 = self.create_category( name='Test 0020 Basic Repository Dependencies', description='Testing basic repository dependency features.' ) + category_0030 = self.create_category( name='Test 0030 Repository Dependency Revisions', description='Testing repository dependencies by revision.' ) + category_0040 = self.create_category( name='test_0040_repository_circular_dependencies', description='Testing handling of circular repository dependencies.' ) + category_0050 = self.create_category( name='test_0050_repository_n_level_circular_dependencies', description='Testing handling of circular repository dependencies to n levels.' ) + category_0060 = self.create_category( name='Test 0060 Workflow Features', description='Test 0060 - Workflow Features' ) + self.logout() + self.login( email=common.test_user_1_email, username=common.test_user_1_name ) + repository = self.get_or_create_repository( name='filtering_0000', + description="Galaxy's filtering tool", + long_description="Long description of Galaxy's filtering tool", + owner=common.test_user_1_name, + category_id=self.security.encode_id( category_0000.id ) ) + if self.repository_is_new( repository ): + self.upload_file( repository, 'filtering/filtering_1.1.0.tar', commit_message="Uploaded filtering 1.1.0" ) + self.upload_file( repository, 'filtering/filtering_2.2.0.tar', commit_message="Uploaded filtering 2.2.0" ) + repository = self.get_or_create_repository( name='freebayes_0010', + description="Galaxy's freebayes tool", + long_description="Long description of Galaxy's freebayes tool", + owner=common.test_user_1_name, + category_id=self.security.encode_id( category_0000.id ), + strings_displayed=[] ) + if self.repository_is_new( repository ): + self.upload_file( repository, 'freebayes/freebayes.xml', valid_tools_only=False, commit_message='Uploaded.', strings_displayed=[] ) + self.upload_file( repository, 'freebayes/tool_data_table_conf.xml.sample', valid_tools_only=False, commit_message='Uploaded.', strings_displayed=[] ) + self.upload_file( repository, 'freebayes/sam_fa_indices.loc.sample', valid_tools_only=False, commit_message='Uploaded.', strings_displayed=[] ) + self.upload_file( repository, 'freebayes/tool_dependencies.xml', commit_message='Uploaded.' ) + repository = self.get_or_create_repository( name='emboss_datatypes_0020', + description="Galaxy applicable data formats used by Emboss tools.", + long_description="Galaxy applicable data formats used by Emboss tools. This repository contains no tools.", + owner=common.test_user_1_name, + category_id=self.security.encode_id( category_0010.id ), + strings_displayed=[] ) + if self.repository_is_new( repository ): + self.upload_file( repository, 'emboss/datatypes/datatypes_conf.xml', commit_message='Uploaded datatypes_conf.xml.' ) + repository = self.get_or_create_repository( name='emboss_0020', + description='Galaxy wrappers for Emboss version 5.0.0 tools', + long_description='Galaxy wrappers for Emboss version 5.0.0 tools', + owner=common.test_user_1_name, + category_id=self.security.encode_id( category_0020.id ), + strings_displayed=[] ) + self.upload_file( repository, 'emboss/emboss.tar', commit_message='Uploaded emboss_5.tar' ) + datatypes_repository = self.get_or_create_repository( name='emboss_datatypes_0030', + description=datatypes_repository_description, + long_description=datatypes_repository_long_description, + owner=common.test_user_1_name, + category_id=self.security.encode_id( category_0030.id ), + strings_displayed=[] ) + if self.repository_is_new( datatypes_repository ): + self.upload_file( datatypes_repository, 'emboss/datatypes/datatypes_conf.xml', commit_message='Uploaded datatypes_conf.xml.' ) + emboss_5_repository = self.get_or_create_repository( name='emboss_5_0030', + description=emboss_repository_description, + long_description=emboss_repository_long_description, + owner=common.test_user_1_name, + category_id=self.security.encode_id( category_0030.id ), + strings_displayed=[] ) + self.upload_file( emboss_5_repository, 'emboss/emboss.tar', commit_message='Uploaded emboss.tar' ) + repository_dependencies_path = self.generate_temp_path( 'test_0330', additional_paths=[ 'emboss', '5' ] ) + self.generate_repository_dependency_xml( [ datatypes_repository ], + self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ) ) + self.upload_file( emboss_5_repository, + 'repository_dependencies.xml', + filepath=repository_dependencies_path, + commit_message='Uploaded repository_dependencies.xml' ) + emboss_6_repository = self.get_or_create_repository( name='emboss_6_0030', + description=emboss_repository_description, + long_description=emboss_repository_long_description, + owner=common.test_user_1_name, + category_id=self.security.encode_id( category_0030.id ), + strings_displayed=[] ) + self.upload_file( emboss_6_repository, 'emboss/emboss.tar', commit_message='Uploaded emboss.tar' ) + repository_dependencies_path = self.generate_temp_path( 'test_0330', additional_paths=[ 'emboss', '6' ] ) + self.generate_repository_dependency_xml( [ datatypes_repository ], + self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ) ) + self.upload_file( emboss_6_repository, + 'repository_dependencies.xml', + filepath=repository_dependencies_path, + commit_message='Uploaded repository_dependencies.xml' ) + emboss_repository = self.get_or_create_repository( name='emboss_0030', + description=emboss_repository_description, + long_description=emboss_repository_long_description, + owner=common.test_user_1_name, + category_id=self.security.encode_id( category_0030.id ), + strings_displayed=[] ) + self.upload_file( emboss_repository, 'emboss/emboss.tar', commit_message='Uploaded emboss.tar' ) + repository_dependencies_path = self.generate_temp_path( 'test_0330', additional_paths=[ 'emboss', '5' ] ) + self.generate_repository_dependency_xml( [ emboss_5_repository ], + self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ) ) + self.upload_file( emboss_repository, + 'repository_dependencies.xml', + filepath=repository_dependencies_path, + commit_message='Uploaded repository_dependencies.xml' ) + self.generate_repository_dependency_xml( [ emboss_6_repository ], + self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ) ) + self.upload_file( emboss_repository, + 'repository_dependencies.xml', + filepath=repository_dependencies_path, + commit_message='Uploaded repository_dependencies.xml' ) + repository = self.get_or_create_repository( name='freebayes_0040', + description="Galaxy's freebayes tool", + long_description="Long description of Galaxy's freebayes tool", + owner=common.test_user_1_name, + category_id=self.security.encode_id( category_0040.id ), + strings_displayed=[] ) + if self.repository_is_new( repository ): + self.upload_file( repository, 'freebayes/freebayes.tar', commit_message='Uploaded freebayes.tar.' ) + repository = self.get_or_create_repository( name='filtering_0040', + description="Galaxy's filtering tool", + long_description="Long description of Galaxy's filtering tool", + owner=common.test_user_1_name, + category_id=self.security.encode_id( category_0040.id ), + strings_displayed=[] ) + self.upload_file( repository, 'filtering/filtering_1.1.0.tar', commit_message='Uploaded filtering.tar.' ) + freebayes_repository = test_db_util.get_repository_by_name_and_owner( 'freebayes_0040', common.test_user_1_name ) + filtering_repository = test_db_util.get_repository_by_name_and_owner( 'filtering_0040', common.test_user_1_name ) + repository_dependencies_path = self.generate_temp_path( 'test_0340', additional_paths=[ 'dependencies' ] ) + self.generate_repository_dependency_xml( [ freebayes_repository ], + self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), + dependency_description='Filtering 1.1.0 depends on the freebayes repository.' ) + self.upload_file( filtering_repository, + 'repository_dependencies.xml', + filepath=repository_dependencies_path, + commit_message='Uploaded dependency on freebayes' ) + self.generate_repository_dependency_xml( [ filtering_repository ], + self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), + dependency_description='Freebayes depends on the filtering repository.' ) + self.upload_file( freebayes_repository, + 'repository_dependencies.xml', + filepath=repository_dependencies_path, + commit_message='Uploaded dependency on filtering' ) + datatypes_repository = self.get_or_create_repository( name='emboss_datatypes_0050', + description="Datatypes for emboss", + long_description="Long description of Emboss' datatypes", + owner=common.test_user_1_name, + category_id=self.security.encode_id( category_0050.id ), + strings_displayed=[] ) + if self.repository_is_new( datatypes_repository ): + emboss_repository = self.get_or_create_repository( name='emboss_0050', + description="Galaxy's emboss tool", + long_description="Long description of Galaxy's emboss tool", + owner=common.test_user_1_name, + category_id=self.security.encode_id( category_0050.id ), + strings_displayed=[] ) + filtering_repository = self.get_or_create_repository( name='filtering_0050', + description="Galaxy's filtering tool", + long_description="Long description of Galaxy's filtering tool", + owner=common.test_user_1_name, + category_id=self.security.encode_id( category_0050.id ), + strings_displayed=[] ) + freebayes_repository = self.get_or_create_repository( name='freebayes_0050', + description="Galaxy's freebayes tool", + long_description="Long description of Galaxy's freebayes tool", + owner=common.test_user_1_name, + category_id=self.security.encode_id( category_0050.id ), + strings_displayed=[] ) + self.upload_file( datatypes_repository, 'emboss/datatypes/datatypes_conf.xml', commit_message='Uploaded datatypes_conf.xml.' ) + self.upload_file( emboss_repository, 'emboss/emboss.tar', commit_message='Uploaded tool tarball.' ) + self.upload_file( freebayes_repository, 'freebayes/freebayes.tar', commit_message='Uploaded freebayes.tar.' ) + self.upload_file( filtering_repository, 'filtering/filtering_1.1.0.tar', commit_message='Uploaded filtering.tar.' ) + repository_dependencies_path = self.generate_temp_path( 'test_0350', additional_paths=[ 'emboss' ] ) + self.generate_repository_dependency_xml( [ datatypes_repository ], + self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), + dependency_description='Emboss depends on the emboss_datatypes repository.' ) + self.upload_file( emboss_repository, + 'repository_dependencies.xml', + filepath=repository_dependencies_path, + commit_message='Uploaded dependency on emboss_datatypes.' ) + repository_dependencies_path = self.generate_temp_path( 'test_0350', additional_paths=[ 'filtering' ] ) + self.generate_repository_dependency_xml( [ emboss_repository ], + self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), + dependency_description='Filtering depends on the emboss repository.' ) + self.upload_file( filtering_repository, + 'repository_dependencies.xml', + filepath=repository_dependencies_path, + commit_message='Uploaded dependency on emboss.' ) + repository_dependencies_path = self.generate_temp_path( 'test_0350', additional_paths=[ 'freebayes' ] ) + self.generate_repository_dependency_xml( [ filtering_repository ], + self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), + dependency_description='Emboss depends on the filtering repository.' ) + self.upload_file( emboss_repository, + 'repository_dependencies.xml', + filepath=repository_dependencies_path, + commit_message='Uploaded dependency on filtering.' ) + self.generate_repository_dependency_xml( [ datatypes_repository, emboss_repository, filtering_repository, freebayes_repository ], + self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), + dependency_description='Freebayes depends on the filtering repository.' ) + self.upload_file( freebayes_repository, + 'repository_dependencies.xml', + filepath=repository_dependencies_path, + commit_message='Uploaded dependency on filtering.' ) + workflow_repository = self.get_or_create_repository( name='filtering_0060', + description="Galaxy's filtering tool", + long_description="Long description of Galaxy's filtering tool", + owner=common.test_user_1_name, + category_id=self.security.encode_id( category_0060.id ), + strings_displayed=[] ) + if self.repository_is_new( workflow_repository ): + workflow = file( self.get_filename( 'filtering_workflow/Workflow_for_0060_filter_workflow_repository.ga' ), 'r' ).read() + workflow = workflow.replace( '__TEST_TOOL_SHED_URL__', self.url.replace( 'http://', '' ) ) + workflow_filepath = self.generate_temp_path( 'test_0360', additional_paths=[ 'filtering_workflow' ] ) + os.makedirs( workflow_filepath ) + file( os.path.join( workflow_filepath, workflow_filename ), 'w+' ).write( workflow ) + self.upload_file( workflow_repository, + workflow_filename, + filepath=workflow_filepath, + commit_message='Uploaded filtering workflow.' ) + self.upload_file( workflow_repository, + 'filtering/filtering_2.2.0.tar', + commit_message='Uploaded filtering tool.' ) + def test_0010_reset_metadata_on_all_repositories( self ): + '''Reset metadata on all repositories, then verify that it has not changed.''' + self.logout() + self.login( email=common.admin_email, username=common.admin_username ) + old_metadata = dict() + new_metadata = dict() + repositories = test_db_util.get_all_repositories() + for repository in repositories: + old_metadata[ self.security.encode_id( repository.id ) ] = dict() + for metadata in self.get_repository_metadata( repository ): + old_metadata[ self.security.encode_id( repository.id ) ][ metadata.changeset_revision ] = metadata.metadata + self.reset_metadata_on_selected_repositories( old_metadata.keys() ) + for repository in repositories: + new_metadata[ self.security.encode_id( repository.id ) ] = dict() + for metadata in self.get_repository_metadata( repository ): + new_metadata[ self.security.encode_id( repository.id ) ][ metadata.changeset_revision ] = metadata.metadata + if old_metadata[ self.security.encode_id( repository.id ) ] != new_metadata[ self.security.encode_id( repository.id ) ]: + raise AssertionError( 'Metadata changed after reset for repository %s.' % repository.name ) diff -r 8e1eec8c56cc5f62f5541c754f31607675347285 -r e6030730bb85b532534f7229c79751efadcd1eb7 test/tool_shed/functional/test_1000_install_basic_repository.py --- a/test/tool_shed/functional/test_1000_install_basic_repository.py +++ b/test/tool_shed/functional/test_1000_install_basic_repository.py @@ -5,30 +5,58 @@ '''Test installing a basic repository.''' def test_0000_initiate_users( self ): """Create necessary user accounts.""" + self.logout() + self.login( email=common.test_user_1_email, username=common.test_user_1_name ) + test_user_1 = test_db_util.get_user( common.test_user_1_email ) + assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email + test_user_1_private_role = test_db_util.get_private_role( test_user_1 ) + self.logout() + self.login( email=common.admin_email, username=common.admin_username ) + admin_user = test_db_util.get_user( common.admin_email ) + assert admin_user is not None, 'Problem retrieving user with email %s from the database' % common.admin_email + admin_user_private_role = test_db_util.get_private_role( admin_user ) self.galaxy_logout() self.galaxy_login( email=common.admin_email, username=common.admin_username ) - admin_user = test_db_util.get_galaxy_user( common.admin_email ) - assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email - admin_user_private_role = test_db_util.get_galaxy_private_role( admin_user ) - def test_0005_browse_tool_sheds( self ): + galaxy_admin_user = test_db_util.get_galaxy_user( common.admin_email ) + assert galaxy_admin_user is not None, 'Problem retrieving user with email %s from the database' % common.admin_email + galaxy_admin_user_private_role = test_db_util.get_galaxy_private_role( galaxy_admin_user ) + def test_0005_ensure_repositories_and_categories_exist( self ): + '''Create the 0000 category and upload the filtering repository to it, if necessary.''' + category = self.create_category( name='Test 0000 Basic Repository Features 1', description='Test 0000 Basic Repository Features 1' ) + self.create_category( name='Test 0000 Basic Repository Features 2', description='Test 0000 Basic Repository Features 2' ) + self.logout() + self.login( email=common.test_user_1_email, username=common.test_user_1_name ) + repository = self.get_or_create_repository( name='filtering_0000', + description="Galaxy's filtering tool", + long_description="Long description of Galaxy's filtering tool", + owner=common.test_user_1_name, + category_id=self.security.encode_id( category.id ) ) + if self.repository_is_new( repository ): + self.upload_file( repository, 'filtering/filtering_1.1.0.tar', commit_message="Uploaded filtering 1.1.0" ) + self.upload_file( repository, 'filtering/filtering_0000.txt', commit_message="Uploaded readme for 1.1.0", remove_repo_files_not_in_tar='No' ) + self.upload_file( repository, 'filtering/filtering_2.2.0.tar', commit_message="Uploaded filtering 2.2.0", remove_repo_files_not_in_tar='No' ) + self.upload_file( repository, 'readme.txt', commit_message="Uploaded readme for 2.2.0", remove_repo_files_not_in_tar='No' ) + def test_0010_browse_tool_sheds( self ): """Browse the available tool sheds in this Galaxy instance.""" + self.galaxy_logout() + self.galaxy_login( email=common.admin_email, username=common.admin_username ) self.visit_galaxy_url( '/admin_toolshed/browse_tool_sheds' ) self.check_page_for_string( 'Embedded tool shed for functional tests' ) self.browse_tool_shed( url=self.url, strings_displayed=[ 'Test 0000 Basic Repository Features 1', 'Test 0000 Basic Repository Features 2' ] ) - def test_0010_browse_test_0000_category( self ): + def test_0015_browse_test_0000_category( self ): '''Browse the category created in test 0000. It should contain the filtering_0000 repository also created in that test.''' category = test_db_util.get_category_by_name( 'Test 0000 Basic Repository Features 1' ) self.browse_category( category, strings_displayed=[ 'filtering_0000' ] ) - def test_0015_preview_filtering_repository( self ): + def test_0020_preview_filtering_repository( self ): '''Load the preview page for the filtering_0000 repository in the tool shed.''' self.preview_repository_in_tool_shed( 'filtering_0000', common.test_user_1_name, strings_displayed=[ 'filtering_0000', 'Valid tools' ] ) - def test_0020_install_filtering_repository( self ): - self.install_repository( 'filtering_0000', common.test_user_1_name ) + def test_0025_install_filtering_repository( self ): + self.install_repository( 'filtering_0000', common.test_user_1_name, 'Test 0000 Basic Repository Features 1' ) installed_repository = test_db_util.get_installed_repository_by_name_owner( 'filtering_0000', common.test_user_1_name ) self.verify_installed_repository_on_browse_page( installed_repository ) self.display_installed_repository_manage_page( installed_repository, strings_displayed=[ 'Installed tool shed repository', 'Tools', 'Filter1' ] ) self.verify_tool_metadata_for_installed_repository( installed_repository ) - def test_0025_verify_installed_repository_metadata( self ): + def test_0030_verify_installed_repository_metadata( self ): '''Verify that resetting the metadata on an installed repository does not change the metadata.''' self.verify_installed_repository_metadata_unchanged( 'filtering_0000', common.test_user_1_name ) diff -r 8e1eec8c56cc5f62f5541c754f31607675347285 -r e6030730bb85b532534f7229c79751efadcd1eb7 test/tool_shed/functional/test_1010_install_repository_with_tool_dependencies.py --- a/test/tool_shed/functional/test_1010_install_repository_with_tool_dependencies.py +++ b/test/tool_shed/functional/test_1010_install_repository_with_tool_dependencies.py @@ -10,15 +10,62 @@ admin_user = test_db_util.get_galaxy_user( common.admin_email ) assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email admin_user_private_role = test_db_util.get_galaxy_private_role( admin_user ) - def test_0005_browse_tool_shed( self ): + self.logout() + self.login( email=common.test_user_1_email, username=common.test_user_1_name ) + test_user_1 = test_db_util.get_user( common.test_user_1_email ) + assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email + test_user_1_private_role = test_db_util.get_private_role( test_user_1 ) + self.logout() + self.login( email=common.admin_email, username=common.admin_username ) + admin_user = test_db_util.get_user( common.admin_email ) + assert admin_user is not None, 'Problem retrieving user with email %s from the database' % common.admin_email + admin_user_private_role = test_db_util.get_private_role( admin_user ) + def test_0005_ensure_repositories_and_categories_exist( self ): + '''Create the 0010 category and upload the freebayes repository to it, if necessary.''' + category = self.create_category( name='Test 0010 Repository With Tool Dependencies', description='Tests for a repository with tool dependencies.' ) + self.logout() + self.login( email=common.test_user_1_email, username=common.test_user_1_name ) + repository = self.get_or_create_repository( name='freebayes_0010', + description="Galaxy's freebayes tool", + long_description="Long description of Galaxy's freebayes tool", + owner=common.test_user_1_name, + category_id=self.security.encode_id( category.id ) ) + if self.repository_is_new( repository ): + self.upload_file( repository, + 'freebayes/freebayes.xml', + valid_tools_only=False, + commit_message="Uploaded freebayes.xml." ) + self.upload_file( repository, + 'freebayes/tool_data_table_conf.xml.sample', + valid_tools_only=False, + commit_message="Uploaded tool_data_table_conf.xml.", + remove_repo_files_not_in_tar='No' ) + self.upload_file( repository, + 'freebayes/sam_fa_indices.loc.sample', + commit_message="Uploaded sam_fa_indices.loc.sample.", + valid_tools_only=False, + remove_repo_files_not_in_tar='No' ) + self.upload_file( repository, + 'freebayes/invalid_tool_dependencies/tool_dependencies.xml', + valid_tools_only=False, + commit_message="Uploaded invalid_tool_dependencies/tool_dependencies.xml.", + remove_repo_files_not_in_tar='No' ) + self.upload_file( repository, + 'freebayes/tool_dependencies.xml', + valid_tools_only=False, + commit_message="Uploaded tool_dependencies.xml", + remove_repo_files_not_in_tar='No' ) + def test_0010_browse_tool_shed( self ): """Browse the available tool sheds in this Galaxy instance and preview the freebayes tool.""" + self.galaxy_logout() + self.galaxy_login( email=common.admin_email, username=common.admin_username ) self.browse_tool_shed( url=self.url, strings_displayed=[ 'Test 0010 Repository With Tool Dependencies' ] ) category = test_db_util.get_category_by_name( 'Test 0010 Repository With Tool Dependencies' ) self.browse_category( category, strings_displayed=[ 'freebayes_0010' ] ) self.preview_repository_in_tool_shed( 'freebayes_0010', common.test_user_1_name, strings_displayed=[ 'freebayes_0010', 'Valid tools' ] ) def test_0015_install_freebayes_repository( self ): '''Install the freebayes repository without installing tool dependencies.''' - self.install_repository( 'freebayes_0010', common.test_user_1_name, install_tool_dependencies=False ) + self.install_repository( 'freebayes_0010', common.test_user_1_name, 'Test 0010 Repository With Tool Dependencies', install_tool_dependencies=False ) installed_repository = test_db_util.get_installed_repository_by_name_owner( 'freebayes_0010', common.test_user_1_name ) self.verify_installed_repository_on_browse_page( installed_repository ) self.display_installed_repository_manage_page( installed_repository, diff -r 8e1eec8c56cc5f62f5541c754f31607675347285 -r e6030730bb85b532534f7229c79751efadcd1eb7 test/tool_shed/functional/test_1020_install_repository_with_repository_dependencies.py --- a/test/tool_shed/functional/test_1020_install_repository_with_repository_dependencies.py +++ b/test/tool_shed/functional/test_1020_install_repository_with_repository_dependencies.py @@ -1,24 +1,71 @@ from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os import tool_shed.base.test_db_util as test_db_util +datatypes_repository_name = 'emboss_datatypes_0020' +datatypes_repository_description = "Galaxy applicable data formats used by Emboss tools." +datatypes_repository_long_description = "Galaxy applicable data formats used by Emboss tools. This repository contains no tools." + +emboss_repository_name = 'emboss_0020' +emboss_repository_description = 'Galaxy wrappers for Emboss version 5.0.0 tools' +emboss_repository_long_description = 'Galaxy wrappers for Emboss version 5.0.0 tools' + class ToolWithRepositoryDependencies( ShedTwillTestCase ): '''Test installing a repository with repository dependencies.''' def test_0000_initiate_users( self ): """Create necessary user accounts.""" + self.logout() + self.login( email=common.test_user_1_email, username=common.test_user_1_name ) + test_user_1 = test_db_util.get_user( common.test_user_1_email ) + assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email + test_user_1_private_role = test_db_util.get_private_role( test_user_1 ) + self.logout() + self.login( email=common.admin_email, username=common.admin_username ) + admin_user = test_db_util.get_user( common.admin_email ) + assert admin_user is not None, 'Problem retrieving user with email %s from the database' % common.admin_email + admin_user_private_role = test_db_util.get_private_role( admin_user ) self.galaxy_logout() self.galaxy_login( email=common.admin_email, username=common.admin_username ) - admin_user = test_db_util.get_galaxy_user( common.admin_email ) - assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email - admin_user_private_role = test_db_util.get_galaxy_private_role( admin_user ) - def test_0005_browse_tool_shed( self ): + galaxy_admin_user = test_db_util.get_galaxy_user( common.admin_email ) + assert galaxy_admin_user is not None, 'Problem retrieving user with email %s from the database' % common.admin_email + galaxy_admin_user_private_role = test_db_util.get_galaxy_private_role( galaxy_admin_user ) + def test_0005_ensure_repositories_and_categories_exist( self ): + '''Create the 0020 category and any missing repositories.''' + category = self.create_category( name='Test 0020 Basic Repository Dependencies', description='Test 0020 Basic Repository Dependencies' ) + self.logout() + self.login( email=common.test_user_1_email, username=common.test_user_1_name ) + datatypes_repository = self.get_or_create_repository( name=datatypes_repository_name, + description=datatypes_repository_description, + long_description=datatypes_repository_long_description, + owner=common.test_user_1_name, + category_id=self.security.encode_id( category.id ), + strings_displayed=[] ) + if self.repository_is_new( datatypes_repository ): + self.upload_file( datatypes_repository, 'emboss/datatypes/datatypes_conf.xml', commit_message='Uploaded datatypes_conf.xml.' ) + emboss_repository = self.get_or_create_repository( name=emboss_repository_name, + description=emboss_repository_description, + long_description=emboss_repository_long_description, + owner=common.test_user_1_name, + category_id=self.security.encode_id( category.id ), + strings_displayed=[] ) + self.upload_file( emboss_repository, 'emboss/emboss.tar', commit_message='Uploaded emboss_5.tar' ) + repository_dependencies_path = self.generate_temp_path( 'test_1020', additional_paths=[ 'emboss', '5' ] ) + self.generate_repository_dependency_xml( [ datatypes_repository ], + self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ) ) + self.upload_file( emboss_repository, + 'repository_dependencies.xml', + filepath=repository_dependencies_path, + commit_message='Uploaded repository_dependencies.xml' ) + def test_0010_browse_tool_shed( self ): """Browse the available tool sheds in this Galaxy instance and preview the emboss tool.""" + self.galaxy_logout() + self.galaxy_login( email=common.admin_email, username=common.admin_username ) self.browse_tool_shed( url=self.url, strings_displayed=[ 'Test 0020 Basic Repository Dependencies' ] ) category = test_db_util.get_category_by_name( 'Test 0020 Basic Repository Dependencies' ) self.browse_category( category, strings_displayed=[ 'emboss_0020' ] ) self.preview_repository_in_tool_shed( 'emboss_0020', common.test_user_1_name, strings_displayed=[ 'emboss_0020', 'Valid tools' ] ) def test_0015_install_emboss_repository( self ): '''Install the emboss repository without installing tool dependencies.''' - self.install_repository( 'emboss_0020', common.test_user_1_name, install_tool_dependencies=False ) + self.install_repository( 'emboss_0020', common.test_user_1_name, 'Test 0020 Basic Repository Dependencies', install_tool_dependencies=False ) installed_repository = test_db_util.get_installed_repository_by_name_owner( 'emboss_0020', common.test_user_1_name ) self.verify_installed_repository_on_browse_page( installed_repository ) self.display_installed_repository_manage_page( installed_repository, diff -r 8e1eec8c56cc5f62f5541c754f31607675347285 -r e6030730bb85b532534f7229c79751efadcd1eb7 test/tool_shed/functional/test_1030_install_repository_with_dependency_revisions.py --- a/test/tool_shed/functional/test_1030_install_repository_with_dependency_revisions.py +++ b/test/tool_shed/functional/test_1030_install_repository_with_dependency_revisions.py @@ -1,17 +1,100 @@ from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os import tool_shed.base.test_db_util as test_db_util +datatypes_repository_name = 'emboss_datatypes_0030' +datatypes_repository_description = "Galaxy applicable data formats used by Emboss tools." +datatypes_repository_long_description = "Galaxy applicable data formats used by Emboss tools. This repository contains no tools." + +emboss_repository_name = 'emboss_0030' +emboss_5_repository_name = 'emboss_5_0030' +emboss_6_repository_name = 'emboss_6_0030' +emboss_repository_description = 'Galaxy wrappers for Emboss version 5.0.0 tools' +emboss_repository_long_description = 'Galaxy wrappers for Emboss version 5.0.0 tools' + class RepositoryWithDependencyRevisions( ShedTwillTestCase ): '''Test installing a repository with dependency revisions.''' def test_0000_initiate_users( self ): """Create necessary user accounts.""" + self.logout() + self.login( email=common.test_user_1_email, username=common.test_user_1_name ) + test_user_1 = test_db_util.get_user( common.test_user_1_email ) + assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email + test_user_1_private_role = test_db_util.get_private_role( test_user_1 ) + self.logout() + self.login( email=common.admin_email, username=common.admin_username ) + admin_user = test_db_util.get_user( common.admin_email ) + assert admin_user is not None, 'Problem retrieving user with email %s from the database' % common.admin_email + admin_user_private_role = test_db_util.get_private_role( admin_user ) self.galaxy_logout() self.galaxy_login( email=common.admin_email, username=common.admin_username ) - admin_user = test_db_util.get_galaxy_user( common.admin_email ) - assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email - admin_user_private_role = test_db_util.get_galaxy_private_role( admin_user ) - def test_0005_browse_tool_shed( self ): + galaxy_admin_user = test_db_util.get_galaxy_user( common.admin_email ) + assert galaxy_admin_user is not None, 'Problem retrieving user with email %s from the database' % common.admin_email + galaxy_admin_user_private_role = test_db_util.get_galaxy_private_role( galaxy_admin_user ) + def test_0005_ensure_repositories_and_categories_exist( self ): + '''Create the 0030 category and add repositories to it, if necessary.''' + category = self.create_category( name='Test 0030 Repository Dependency Revisions', description='Test 0030 Repository Dependency Revisions' ) + self.logout() + self.login( email=common.test_user_1_email, username=common.test_user_1_name ) + datatypes_repository = self.get_or_create_repository( name=datatypes_repository_name, + description=datatypes_repository_description, + long_description=datatypes_repository_long_description, + owner=common.test_user_1_name, + category_id=self.security.encode_id( category.id ), + strings_displayed=[] ) + if self.repository_is_new( datatypes_repository ): + self.upload_file( datatypes_repository, 'emboss/datatypes/datatypes_conf.xml', commit_message='Uploaded datatypes_conf.xml.' ) + emboss_5_repository = self.get_or_create_repository( name=emboss_5_repository_name, + description=emboss_repository_description, + long_description=emboss_repository_long_description, + owner=common.test_user_1_name, + category_id=self.security.encode_id( category.id ), + strings_displayed=[] ) + self.upload_file( emboss_5_repository, 'emboss/emboss.tar', commit_message='Uploaded emboss.tar' ) + repository_dependencies_path = self.generate_temp_path( 'test_1030', additional_paths=[ 'emboss', '5' ] ) + self.generate_repository_dependency_xml( [ datatypes_repository ], + self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ) ) + self.upload_file( emboss_5_repository, + 'repository_dependencies.xml', + filepath=repository_dependencies_path, + commit_message='Uploaded repository_dependencies.xml' ) + emboss_6_repository = self.get_or_create_repository( name=emboss_6_repository_name, + description=emboss_repository_description, + long_description=emboss_repository_long_description, + owner=common.test_user_1_name, + category_id=self.security.encode_id( category.id ), + strings_displayed=[] ) + self.upload_file( emboss_6_repository, 'emboss/emboss.tar', commit_message='Uploaded emboss.tar' ) + repository_dependencies_path = self.generate_temp_path( 'test_1030', additional_paths=[ 'emboss', '6' ] ) + self.generate_repository_dependency_xml( [ datatypes_repository ], + self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ) ) + self.upload_file( emboss_6_repository, + 'repository_dependencies.xml', + filepath=repository_dependencies_path, + commit_message='Uploaded repository_dependencies.xml' ) + emboss_repository = self.get_or_create_repository( name=emboss_repository_name, + description=emboss_repository_description, + long_description=emboss_repository_long_description, + owner=common.test_user_1_name, + category_id=self.security.encode_id( category.id ), + strings_displayed=[] ) + self.upload_file( emboss_repository, 'emboss/emboss.tar', commit_message='Uploaded emboss.tar' ) + repository_dependencies_path = self.generate_temp_path( 'test_1030', additional_paths=[ 'emboss', '5' ] ) + self.generate_repository_dependency_xml( [ emboss_5_repository ], + self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ) ) + self.upload_file( emboss_repository, + 'repository_dependencies.xml', + filepath=repository_dependencies_path, + commit_message='Uploaded repository_dependencies.xml' ) + self.generate_repository_dependency_xml( [ emboss_6_repository ], + self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ) ) + self.upload_file( emboss_repository, + 'repository_dependencies.xml', + filepath=repository_dependencies_path, + commit_message='Uploaded repository_dependencies.xml' ) + def test_0010_browse_tool_shed( self ): """Browse the available tool sheds in this Galaxy instance and preview the emboss tool.""" + self.galaxy_logout() + self.galaxy_login( email=common.admin_email, username=common.admin_username ) self.browse_tool_shed( url=self.url, strings_displayed=[ 'Test 0030 Repository Dependency Revisions' ] ) category = test_db_util.get_category_by_name( 'Test 0030 Repository Dependency Revisions' ) self.browse_category( category, strings_displayed=[ 'emboss_0030' ] ) @@ -20,7 +103,11 @@ '''Install the emboss repository without installing tool dependencies.''' repository = test_db_util.get_repository_by_name_and_owner( 'emboss_0030', common.test_user_1_name ) revisions = self.get_repository_metadata_revisions( repository ) - self.install_repository( 'emboss_0030', common.test_user_1_name, changeset_revision=revisions[1], install_tool_dependencies=False ) + self.install_repository( 'emboss_0030', + common.test_user_1_name, + 'Test 0030 Repository Dependency Revisions', + changeset_revision=revisions[1], + install_tool_dependencies=False ) installed_repository = test_db_util.get_installed_repository_by_name_owner( 'emboss_0030', common.test_user_1_name ) self.verify_installed_repository_on_browse_page( installed_repository ) self.display_installed_repository_manage_page( installed_repository, diff -r 8e1eec8c56cc5f62f5541c754f31607675347285 -r e6030730bb85b532534f7229c79751efadcd1eb7 test/tool_shed/functional/test_1300_reset_all_metadata.py --- /dev/null +++ b/test/tool_shed/functional/test_1300_reset_all_metadata.py @@ -0,0 +1,269 @@ +from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os +import tool_shed.base.test_db_util as test_db_util + +datatypes_repository_name = 'emboss_datatypes_0020' +datatypes_repository_description = "Galaxy applicable data formats used by Emboss tools." +datatypes_repository_long_description = "Galaxy applicable data formats used by Emboss tools. This repository contains no tools." +emboss_repository_description = 'Galaxy wrappers for Emboss version 5.0.0 tools' +emboss_repository_long_description = 'Galaxy wrappers for Emboss version 5.0.0 tools' +workflow_filename = 'Workflow_for_0060_filter_workflow_repository.ga' +workflow_name = 'Workflow for 0060_filter_workflow_repository' + +class TestResetInstalledRepositoryMetadata( ShedTwillTestCase ): + '''Verify that the "Reset selected metadata" feature works.''' + def test_0000_initiate_users( self ): + """Create necessary user accounts.""" + self.logout() + self.login( email=common.test_user_1_email, username=common.test_user_1_name ) + test_user_1 = test_db_util.get_user( common.test_user_1_email ) + assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email + test_user_1_private_role = test_db_util.get_private_role( test_user_1 ) + self.logout() + self.login( email=common.admin_email, username=common.admin_username ) + admin_user = test_db_util.get_user( common.admin_email ) + assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email + admin_user_private_role = test_db_util.get_private_role( admin_user ) + def test_0005_create_repositories_and_categories( self ): + '''Ensure that the necessary categories and repositories exist for these tests.''' + category_0000 = self.create_category( name='Test 0000 Basic Repository Features 1', description='Test 0000 Basic Repository Features 1' ) + category_0001 = self.create_category( name='Test 0000 Basic Repository Features 2', description='Test 0000 Basic Repository Features 2' ) + category_0010 = self.create_category( name='Test 0010 Repository With Tool Dependencies', description='Tests for a repository with tool dependencies.' ) + category_0020 = self.create_category( name='Test 0020 Basic Repository Dependencies', description='Testing basic repository dependency features.' ) + category_0030 = self.create_category( name='Test 0030 Repository Dependency Revisions', description='Testing repository dependencies by revision.' ) + category_0040 = self.create_category( name='test_0040_repository_circular_dependencies', description='Testing handling of circular repository dependencies.' ) + category_0050 = self.create_category( name='test_0050_repository_n_level_circular_dependencies', description='Testing handling of circular repository dependencies to n levels.' ) + category_0060 = self.create_category( name='Test 0060 Workflow Features', description='Test 0060 - Workflow Features' ) + self.logout() + self.login( email=common.test_user_1_email, username=common.test_user_1_name ) + repository = self.get_or_create_repository( name='filtering_0000', + description="Galaxy's filtering tool", + long_description="Long description of Galaxy's filtering tool", + owner=common.test_user_1_name, + category_id=self.security.encode_id( category_0000.id ) ) + if self.repository_is_new( repository ): + self.upload_file( repository, 'filtering/filtering_1.1.0.tar', commit_message="Uploaded filtering 1.1.0" ) + self.upload_file( repository, 'filtering/filtering_2.2.0.tar', commit_message="Uploaded filtering 2.2.0" ) + repository = self.get_or_create_repository( name='freebayes_0010', + description="Galaxy's freebayes tool", + long_description="Long description of Galaxy's freebayes tool", + owner=common.test_user_1_name, + category_id=self.security.encode_id( category_0010.id ), + strings_displayed=[] ) + if self.repository_is_new( repository ): + self.upload_file( repository, 'freebayes/freebayes.xml', valid_tools_only=False, commit_message='Uploaded.', strings_displayed=[] ) + self.upload_file( repository, 'freebayes/tool_data_table_conf.xml.sample', valid_tools_only=False, commit_message='Uploaded.', strings_displayed=[] ) + self.upload_file( repository, 'freebayes/sam_fa_indices.loc.sample', valid_tools_only=False, commit_message='Uploaded.', strings_displayed=[] ) + self.upload_file( repository, 'freebayes/tool_dependencies.xml', commit_message='Uploaded.' ) + repository = self.get_or_create_repository( name='emboss_datatypes_0020', + description="Galaxy applicable data formats used by Emboss tools.", + long_description="Galaxy applicable data formats used by Emboss tools. This repository contains no tools.", + owner=common.test_user_1_name, + category_id=self.security.encode_id( category_0010.id ), + strings_displayed=[] ) + if self.repository_is_new( repository ): + self.upload_file( repository, 'emboss/datatypes/datatypes_conf.xml', commit_message='Uploaded datatypes_conf.xml.' ) + repository = self.get_or_create_repository( name='emboss_0020', + description='Galaxy wrappers for Emboss version 5.0.0 tools', + long_description='Galaxy wrappers for Emboss version 5.0.0 tools', + owner=common.test_user_1_name, + category_id=self.security.encode_id( category_0020.id ), + strings_displayed=[] ) + self.upload_file( repository, 'emboss/emboss.tar', commit_message='Uploaded emboss_5.tar' ) + datatypes_repository = self.get_or_create_repository( name='emboss_datatypes_0030', + description=datatypes_repository_description, + long_description=datatypes_repository_long_description, + owner=common.test_user_1_name, + category_id=self.security.encode_id( category_0030.id ), + strings_displayed=[] ) + if self.repository_is_new( datatypes_repository ): + self.upload_file( datatypes_repository, 'emboss/datatypes/datatypes_conf.xml', commit_message='Uploaded datatypes_conf.xml.' ) + emboss_5_repository = self.get_or_create_repository( name='emboss_5_0030', + description=emboss_repository_description, + long_description=emboss_repository_long_description, + owner=common.test_user_1_name, + category_id=self.security.encode_id( category_0030.id ), + strings_displayed=[] ) + self.upload_file( emboss_5_repository, 'emboss/emboss.tar', commit_message='Uploaded emboss.tar' ) + repository_dependencies_path = self.generate_temp_path( 'test_0330', additional_paths=[ 'emboss', '5' ] ) + self.generate_repository_dependency_xml( [ datatypes_repository ], + self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ) ) + self.upload_file( emboss_5_repository, + 'repository_dependencies.xml', + filepath=repository_dependencies_path, + commit_message='Uploaded repository_dependencies.xml' ) + emboss_6_repository = self.get_or_create_repository( name='emboss_6_0030', + description=emboss_repository_description, + long_description=emboss_repository_long_description, + owner=common.test_user_1_name, + category_id=self.security.encode_id( category_0030.id ), + strings_displayed=[] ) + self.upload_file( emboss_6_repository, 'emboss/emboss.tar', commit_message='Uploaded emboss.tar' ) + repository_dependencies_path = self.generate_temp_path( 'test_0330', additional_paths=[ 'emboss', '6' ] ) + self.generate_repository_dependency_xml( [ datatypes_repository ], + self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ) ) + self.upload_file( emboss_6_repository, + 'repository_dependencies.xml', + filepath=repository_dependencies_path, + commit_message='Uploaded repository_dependencies.xml' ) + emboss_repository = self.get_or_create_repository( name='emboss_0030', + description=emboss_repository_description, + long_description=emboss_repository_long_description, + owner=common.test_user_1_name, + category_id=self.security.encode_id( category_0030.id ), + strings_displayed=[] ) + self.upload_file( emboss_repository, 'emboss/emboss.tar', commit_message='Uploaded emboss.tar' ) + repository_dependencies_path = self.generate_temp_path( 'test_0330', additional_paths=[ 'emboss', '5' ] ) + self.generate_repository_dependency_xml( [ emboss_5_repository ], + self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ) ) + self.upload_file( emboss_repository, + 'repository_dependencies.xml', + filepath=repository_dependencies_path, + commit_message='Uploaded repository_dependencies.xml' ) + self.generate_repository_dependency_xml( [ emboss_6_repository ], + self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ) ) + self.upload_file( emboss_repository, + 'repository_dependencies.xml', + filepath=repository_dependencies_path, + commit_message='Uploaded repository_dependencies.xml' ) + repository = self.get_or_create_repository( name='freebayes_0040', + description="Galaxy's freebayes tool", + long_description="Long description of Galaxy's freebayes tool", + owner=common.test_user_1_name, + category_id=self.security.encode_id( category_0040.id ), + strings_displayed=[] ) + if self.repository_is_new( repository ): + self.upload_file( repository, 'freebayes/freebayes.tar', commit_message='Uploaded freebayes.tar.' ) + repository = self.get_or_create_repository( name='filtering_0040', + description="Galaxy's filtering tool", + long_description="Long description of Galaxy's filtering tool", + owner=common.test_user_1_name, + category_id=self.security.encode_id( category_0040.id ), + strings_displayed=[] ) + self.upload_file( repository, 'filtering/filtering_1.1.0.tar', commit_message='Uploaded filtering.tar.' ) + freebayes_repository = test_db_util.get_repository_by_name_and_owner( 'freebayes_0040', common.test_user_1_name ) + filtering_repository = test_db_util.get_repository_by_name_and_owner( 'filtering_0040', common.test_user_1_name ) + repository_dependencies_path = self.generate_temp_path( 'test_0340', additional_paths=[ 'dependencies' ] ) + self.generate_repository_dependency_xml( [ freebayes_repository ], + self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), + dependency_description='Filtering 1.1.0 depends on the freebayes repository.' ) + self.upload_file( filtering_repository, + 'repository_dependencies.xml', + filepath=repository_dependencies_path, + commit_message='Uploaded dependency on freebayes' ) + self.generate_repository_dependency_xml( [ filtering_repository ], + self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), + dependency_description='Freebayes depends on the filtering repository.' ) + self.upload_file( freebayes_repository, + 'repository_dependencies.xml', + filepath=repository_dependencies_path, + commit_message='Uploaded dependency on filtering' ) + datatypes_repository = self.get_or_create_repository( name='emboss_datatypes_0050', + description="Datatypes for emboss", + long_description="Long description of Emboss' datatypes", + owner=common.test_user_1_name, + category_id=self.security.encode_id( category_0050.id ), + strings_displayed=[] ) + if self.repository_is_new( datatypes_repository ): + emboss_repository = self.get_or_create_repository( name='emboss_0050', + description="Galaxy's emboss tool", + long_description="Long description of Galaxy's emboss tool", + owner=common.test_user_1_name, + category_id=self.security.encode_id( category_0050.id ), + strings_displayed=[] ) + filtering_repository = self.get_or_create_repository( name='filtering_0050', + description="Galaxy's filtering tool", + long_description="Long description of Galaxy's filtering tool", + owner=common.test_user_1_name, + category_id=self.security.encode_id( category_0050.id ), + strings_displayed=[] ) + freebayes_repository = self.get_or_create_repository( name='freebayes_0050', + description="Galaxy's freebayes tool", + long_description="Long description of Galaxy's freebayes tool", + owner=common.test_user_1_name, + category_id=self.security.encode_id( category_0050.id ), + strings_displayed=[] ) + self.upload_file( datatypes_repository, 'emboss/datatypes/datatypes_conf.xml', commit_message='Uploaded datatypes_conf.xml.' ) + self.upload_file( emboss_repository, 'emboss/emboss.tar', commit_message='Uploaded tool tarball.' ) + self.upload_file( freebayes_repository, 'freebayes/freebayes.tar', commit_message='Uploaded freebayes.tar.' ) + self.upload_file( filtering_repository, 'filtering/filtering_1.1.0.tar', commit_message='Uploaded filtering.tar.' ) + repository_dependencies_path = self.generate_temp_path( 'test_0350', additional_paths=[ 'emboss' ] ) + self.generate_repository_dependency_xml( [ datatypes_repository ], + self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), + dependency_description='Emboss depends on the emboss_datatypes repository.' ) + self.upload_file( emboss_repository, + 'repository_dependencies.xml', + filepath=repository_dependencies_path, + commit_message='Uploaded dependency on emboss_datatypes.' ) + repository_dependencies_path = self.generate_temp_path( 'test_0350', additional_paths=[ 'filtering' ] ) + self.generate_repository_dependency_xml( [ emboss_repository ], + self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), + dependency_description='Filtering depends on the emboss repository.' ) + self.upload_file( filtering_repository, + 'repository_dependencies.xml', + filepath=repository_dependencies_path, + commit_message='Uploaded dependency on emboss.' ) + repository_dependencies_path = self.generate_temp_path( 'test_0350', additional_paths=[ 'freebayes' ] ) + self.generate_repository_dependency_xml( [ filtering_repository ], + self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), + dependency_description='Emboss depends on the filtering repository.' ) + self.upload_file( emboss_repository, + 'repository_dependencies.xml', + filepath=repository_dependencies_path, + commit_message='Uploaded dependency on filtering.' ) + self.generate_repository_dependency_xml( [ datatypes_repository, emboss_repository, filtering_repository, freebayes_repository ], + self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), + dependency_description='Freebayes depends on the filtering repository.' ) + self.upload_file( freebayes_repository, + 'repository_dependencies.xml', + filepath=repository_dependencies_path, + commit_message='Uploaded dependency on filtering.' ) + workflow_repository = self.get_or_create_repository( name='filtering_0060', + description="Galaxy's filtering tool", + long_description="Long description of Galaxy's filtering tool", + owner=common.test_user_1_name, + category_id=self.security.encode_id( category_0060.id ), + strings_displayed=[] ) + if self.repository_is_new( workflow_repository ): + workflow = file( self.get_filename( 'filtering_workflow/Workflow_for_0060_filter_workflow_repository.ga' ), 'r' ).read() + workflow = workflow.replace( '__TEST_TOOL_SHED_URL__', self.url.replace( 'http://', '' ) ) + workflow_filepath = self.generate_temp_path( 'test_0360', additional_paths=[ 'filtering_workflow' ] ) + os.makedirs( workflow_filepath ) + file( os.path.join( workflow_filepath, workflow_filename ), 'w+' ).write( workflow ) + self.upload_file( workflow_repository, + workflow_filename, + filepath=workflow_filepath, + commit_message='Uploaded filtering workflow.' ) + self.upload_file( workflow_repository, + 'filtering/filtering_2.2.0.tar', + commit_message='Uploaded filtering tool.' ) + def test_0010_install_all_missing_repositories( self ): + '''Call the install_repository method to ensure that all required repositories are installed.''' + self.galaxy_logout() + self.galaxy_login( email=common.admin_email, username=common.admin_username ) + category_0000 = 'Test 0000 Basic Repository Features 1' + category_0001 = 'Test 0000 Basic Repository Features 2' + category_0010 = 'Test 0010 Repository With Tool Dependencies' + category_0020 = 'Test 0020 Basic Repository Dependencies' + category_0030 = 'Test 0030 Repository Dependency Revisions' + category_0040 = 'test_0040_repository_circular_dependencies' + category_0050 = 'test_0050_repository_n_level_circular_dependencies' + category_0060 = 'Test 0060 Workflow Features' + self.install_repository( 'filtering_0000', common.test_user_1_name, category_0000, strings_displayed=[] ) + self.install_repository( 'freebayes_0010', common.test_user_1_name, category_0010, strings_displayed=[] ) + self.install_repository( 'emboss_0020', common.test_user_1_name, category_0020, strings_displayed=[] ) + self.install_repository( 'emboss_5_0030', common.test_user_1_name, category_0030, strings_displayed=[] ) + self.install_repository( 'filtering_0040', common.test_user_1_name, category_0040, strings_displayed=[] ) + self.install_repository( 'freebayes_0050', common.test_user_1_name, category_0050, strings_displayed=[] ) + self.install_repository( 'filtering_0060', common.test_user_1_name, category_0060, strings_displayed=[] ) + def test_0015_reset_metadata_on_all_repositories( self ): + '''Reset metadata on all repositories, then verify that it has not changed.''' + repository_metadata = dict() + repositories = test_db_util.get_all_installed_repositories() + for repository in repositories: + repository_metadata[ self.security.encode_id( repository.id ) ] = repository.metadata + self.reset_metadata_on_selected_installed_repositories( repository_metadata.keys() ) + for repository in repositories: + test_db_util.ga_refresh( repository ) + old_metadata = repository_metadata[ self.security.encode_id( repository.id ) ] + assert repository.metadata == old_metadata, 'Metadata for installed repository %s changed after reset.' % repository.name + \ No newline at end of file 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)
-
Bitbucket