1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/692a1e8b6999/ changeset: 692a1e8b6999 user: inithello date: 2012-12-21 18:47:30 summary: Tool shed functional test enhancements. Functional tests for uninstalling, deactivating, reinstalling, and reactivating installed repositories. affected #: 9 files
diff -r b268bc0bbc63f525a981547d06c20911f553f1b2 -r 692a1e8b69998d99465838cb5c8b1d56f3a37d2d test/tool_shed/base/twilltestcase.py --- a/test/tool_shed/base/twilltestcase.py +++ b/test/tool_shed/base/twilltestcase.py @@ -68,13 +68,10 @@ for dependency in installed_repository.metadata[ 'tool_dependencies' ]: tool_dependency = installed_repository.metadata[ 'tool_dependencies' ][ dependency ] strings_displayed.extend( [ tool_dependency[ 'name' ], tool_dependency[ 'version' ], tool_dependency[ 'type' ] ] ) - """ - TODO: Uncomment these when Greg enhances the tool dependencies and missing tool dependencies containers to display the status. if dependencies_installed: strings_displayed.append( 'Installed' ) else: strings_displayed.append( 'Never installed' ) - """ url = '/admin_toolshed/manage_repository?id=%s' % self.security.encode_id( installed_repository.id ) self.visit_galaxy_url( url ) self.check_for_strings( strings_displayed, strings_not_displayed ) @@ -322,6 +319,14 @@ file( xml_filename, 'w' ).write( repository_dependency_xml ) def generate_temp_path( self, test_script_path, additional_paths=[] ): return os.path.join( self.tool_shed_test_tmp_dir, test_script_path, os.sep.join( additional_paths ) ) + def get_datatypes_count( self ): + url = '/admin/view_datatypes_registry' + self.visit_galaxy_url( url ) + html = self.last_page() + datatypes_count = re.search( 'registry contains (\d+) data types', html ) + if datatypes_count: + return datatypes_count.group( 1 ) + return None def get_filename( self, filename, filepath=None ): if filepath is not None: return os.path.abspath( os.path.join( filepath, filename ) ) @@ -404,15 +409,16 @@ # group(2), and the reinstalling flag in group(3) and pass them to the manage_repositories method in the Galaxy # admin_toolshed controller. install_parameters = re.search( 'initiate_repository_installation( "([^"]+)", "([^"]+)", "([^"]+)" );', html ) - iri_ids = install_parameters.group(1) - encoded_kwd = install_parameters.group(2) - reinstalling = install_parameters.group(3) - url = '/admin_toolshed/manage_repositories?operation=install&tool_shed_repository_ids=%s&encoded_kwd=%s&reinstalling=%s' % \ - ( iri_ids, encoded_kwd, reinstalling ) - self.visit_galaxy_url( url ) - def install_repository( self, name, owner, category_name, install_tool_dependencies=False, changeset_revision=None, strings_displayed=[], strings_not_displayed=[], preview_strings_displayed=[], **kwd ): - if test_db_util.get_installed_repository_by_name_owner( name, owner ) is not None: - return + if install_parameters: + iri_ids = install_parameters.group(1) + encoded_kwd = install_parameters.group(2) + reinstalling = install_parameters.group(3) + url = '/admin_toolshed/manage_repositories?operation=install&tool_shed_repository_ids=%s&encoded_kwd=%s&reinstalling=%s' % \ + ( iri_ids, encoded_kwd, reinstalling ) + self.visit_galaxy_url( url ) + def install_repository( self, name, owner, category_name, install_tool_dependencies=False, + changeset_revision=None, strings_displayed=[], strings_not_displayed=[], + preview_strings_displayed=[], post_submit_strings_displayed=[], **kwd ): 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=preview_strings_displayed ) @@ -435,6 +441,7 @@ if 'shed_tool_conf' not in kwd: kwd[ 'shed_tool_conf' ] = self.shed_tool_conf self.submit_form( 1, 'select_tool_panel_section_button', **kwd ) + self.check_for_strings( post_submit_strings_displayed, strings_not_displayed ) self.initiate_installation_process() self.wait_for_repository_installation( repository, changeset_revision ) def load_invalid_tool_page( self, repository, tool_xml, changeset_revision, strings_displayed=[], strings_not_displayed=[] ): @@ -460,6 +467,11 @@ self.visit_url( '/repository/preview_tools_in_changeset?repository_id=%s&changeset_revision=%s' % \ ( self.security.encode_id( repository.id ), changeset_revision ) ) self.check_for_strings( strings_displayed, strings_not_displayed ) + def reactivate_repository( self, installed_repository ): + url = '/admin_toolshed/browse_repositories?operation=activate+or+reinstall&id=%s' % self.security.encode_id( installed_repository.id ) + self.visit_galaxy_url( url ) + strings_displayed = [ installed_repository.name, 'repository has been activated' ] + self.check_for_strings( strings_displayed, [] ) def reinstall_repository( self, installed_repository ): url = '/admin_toolshed/reinstall_repository?id=%s' % self.security.encode_id( installed_repository.id ) self.visit_galaxy_url( url ) @@ -513,13 +525,16 @@ def uninstall_repository( self, installed_repository, remove_from_disk=True ): url = '/admin_toolshed/deactivate_or_uninstall_repository?id=%s' % self.security.encode_id( installed_repository.id ) self.visit_galaxy_url( url ) -# form = tc.browser.get_form( 'deactivate_or_uninstall_repository' ) - tc.fv ( 1, "remove_from_disk", '1' ) -# checkbox.readonly = False -# if remove_from_disk: -# checkbox.selected = True + if remove_from_disk: + tc.fv ( 1, "remove_from_disk", 'true' ) + else: + tc.fv ( 1, "remove_from_disk", 'false' ) tc.submit( 'deactivate_or_uninstall_repository_button' ) - strings_displayed = [ 'has been uninstalled', 'The repository named' ] + strings_displayed = [ 'The repository named' ] + if remove_from_disk: + strings_displayed.append( 'has been uninstalled' ) + else: + strings_displayed.append( 'has been deactivated' ) self.check_for_strings( strings_displayed, strings_not_displayed=[] ) def update_installed_repository( self, installed_repository, strings_displayed=[], strings_not_displayed=[] ): url = '/admin_toolshed/check_for_updates?id=%s' % self.security.encode_id( installed_repository.id )
diff -r b268bc0bbc63f525a981547d06c20911f553f1b2 -r 692a1e8b69998d99465838cb5c8b1d56f3a37d2d 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 @@ -26,7 +26,7 @@ def test_0005_create_category( self ): """Create a category for this test suite""" self.create_category( name='test_0040_repository_circular_dependencies', description='Testing handling of circular repository dependencies.' ) - def test_0010_create_freebayes_repository_name( self ): + def test_0010_create_freebayes_repository( self ): '''Create and populate freebayes_0040.''' self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name )
diff -r b268bc0bbc63f525a981547d06c20911f553f1b2 -r 692a1e8b69998d99465838cb5c8b1d56f3a37d2d 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 @@ -65,6 +65,7 @@ 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.''' + old_datatypes = self.get_datatypes_count() self.install_repository( 'emboss_0020', common.test_user_1_name, 'Test 0020 Basic Repository Dependencies', @@ -81,6 +82,8 @@ strings_displayed=[ 'Installed tool shed repository', 'Valid tools', 'antigenic' ] ) self.check_installed_repository_tool_dependencies( installed_repository, dependencies_installed=False ) self.verify_tool_metadata_for_installed_repository( installed_repository ) + new_datatypes = self.get_datatypes_count() + assert new_datatypes > old_datatypes, 'Installing emboss did not add datatypes to the registry' def test_0020_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( 'emboss_0020', common.test_user_1_name )
diff -r b268bc0bbc63f525a981547d06c20911f553f1b2 -r 692a1e8b69998d99465838cb5c8b1d56f3a37d2d 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 @@ -102,11 +102,10 @@ def test_0015_install_emboss_repository( self ): '''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 ) + old_datatypes = self.get_datatypes_count() self.install_repository( 'emboss_0030', common.test_user_1_name, 'Test 0030 Repository Dependency Revisions', - changeset_revision=revisions[1], install_tool_dependencies=False, new_tool_panel_section='test_1030' ) installed_repository = test_db_util.get_installed_repository_by_name_owner( 'emboss_0030', common.test_user_1_name ) @@ -121,6 +120,8 @@ self.check_installed_repository_tool_dependencies( installed_repository, dependencies_installed=False ) self.verify_tool_metadata_for_installed_repository( installed_repository ) self.update_installed_repository( installed_repository, strings_displayed=[ "there are no updates available" ] ) + new_datatypes = self.get_datatypes_count() + assert new_datatypes > old_datatypes, 'Installing emboss did not add datatypes to the registry.' def test_0025_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( 'emboss_0030', common.test_user_1_name )
diff -r b268bc0bbc63f525a981547d06c20911f553f1b2 -r 692a1e8b69998d99465838cb5c8b1d56f3a37d2d test/tool_shed/functional/test_1200_uninstall_and_reinstall_basic_repository.py --- a/test/tool_shed/functional/test_1200_uninstall_and_reinstall_basic_repository.py +++ b/test/tool_shed/functional/test_1200_uninstall_and_reinstall_basic_repository.py @@ -1,8 +1,8 @@ from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os import tool_shed.base.test_db_util as test_db_util
-class BasicToolShedFeatures( ShedTwillTestCase ): - '''Test installing a basic repository.''' +class UninstallingAndReinstallingRepositories( ShedTwillTestCase ): + '''Test uninstalling and reinstalling a basic repository.''' def test_0000_initiate_users( self ): """Create necessary user accounts.""" self.logout() @@ -54,7 +54,6 @@ def test_0015_uninstall_filtering_repository( self ): '''Uninstall the filtering repository.''' installed_repository = test_db_util.get_installed_repository_by_name_owner( 'filtering_0000', common.test_user_1_name ) - old_metadata = installed_repository.metadata self.uninstall_repository( installed_repository, remove_from_disk=True ) strings_not_displayed = [ installed_repository.name, installed_repository.description, @@ -84,7 +83,7 @@ def test_0030_reactivate_filtering_repository( self ): '''Reactivate the filtering repository and verify that it now shows up in the list of installed repositories.''' installed_repository = test_db_util.get_installed_repository_by_name_owner( 'filtering_0000', common.test_user_1_name ) - self.reinstall_repository( installed_repository ) + self.reactivate_repository( installed_repository ) strings_displayed = [ installed_repository.name, installed_repository.description, installed_repository.owner,
diff -r b268bc0bbc63f525a981547d06c20911f553f1b2 -r 692a1e8b69998d99465838cb5c8b1d56f3a37d2d test/tool_shed/functional/test_1210_uninstall_reinstall_repository_with_tool_dependencies.py --- /dev/null +++ b/test/tool_shed/functional/test_1210_uninstall_reinstall_repository_with_tool_dependencies.py @@ -0,0 +1,110 @@ +from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os +import tool_shed.base.test_db_util as test_db_util + +class UninstallingAndReinstallingRepositories( ShedTwillTestCase ): + '''Test uninstalling and reinstalling a repository with tool dependencies.''' + def test_0000_initiate_users( self ): + """Create necessary user accounts.""" + 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 ) + 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 the tool shed, 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_install_freebayes_repository( self ): + '''Install the freebayes repository into the Galaxy instance.''' + self.galaxy_logout() + self.galaxy_login( email=common.admin_email, username=common.admin_username ) + self.install_repository( 'freebayes_0010', + common.test_user_1_name, + 'Test 0010 Repository With Tool Dependencies', + new_tool_panel_section='test_1210' ) + installed_repository = test_db_util.get_installed_repository_by_name_owner( 'freebayes_0010', common.test_user_1_name ) + strings_displayed = [ installed_repository.name, + installed_repository.description, + installed_repository.owner, + installed_repository.tool_shed, + installed_repository.installed_changeset_revision ] + self.display_galaxy_browse_repositories_page( strings_displayed=strings_displayed ) + def test_0015_uninstall_freebayes_repository( self ): + '''Uninstall the freebayes repository.''' + installed_repository = test_db_util.get_installed_repository_by_name_owner( 'freebayes_0010', common.test_user_1_name ) + self.uninstall_repository( installed_repository, remove_from_disk=True ) + strings_not_displayed = [ installed_repository.name, installed_repository.installed_changeset_revision ] + self.display_galaxy_browse_repositories_page( strings_not_displayed=strings_not_displayed ) + def test_0020_reinstall_freebayes_repository( self ): + '''Reinstall the freebayes repository.''' + installed_repository = test_db_util.get_installed_repository_by_name_owner( 'freebayes_0010', common.test_user_1_name ) + self.reinstall_repository( installed_repository ) + strings_displayed = [ installed_repository.name, + installed_repository.description, + installed_repository.owner, + installed_repository.tool_shed, + installed_repository.installed_changeset_revision ] + self.display_galaxy_browse_repositories_page( strings_displayed=strings_displayed ) + self.display_installed_repository_manage_page( installed_repository, + strings_displayed=[ 'Installed tool shed repository', 'Valid tools', 'FreeBayes' ] ) + self.verify_tool_metadata_for_installed_repository( installed_repository ) + def test_0025_deactivate_freebayes_repository( self ): + '''Deactivate the freebayes repository without removing it from disk.''' + installed_repository = test_db_util.get_installed_repository_by_name_owner( 'freebayes_0010', common.test_user_1_name ) + self.uninstall_repository( installed_repository, remove_from_disk=False ) + strings_not_displayed = [ installed_repository.name, installed_repository.installed_changeset_revision ] + self.display_galaxy_browse_repositories_page( strings_not_displayed=strings_not_displayed ) + def test_0030_reactivate_freebayes_repository( self ): + '''Reactivate the freebayes repository and verify that it now shows up in the list of installed repositories.''' + installed_repository = test_db_util.get_installed_repository_by_name_owner( 'freebayes_0010', common.test_user_1_name ) + self.reactivate_repository( installed_repository ) + strings_displayed = [ installed_repository.name, + installed_repository.description, + installed_repository.owner, + installed_repository.tool_shed, + installed_repository.installed_changeset_revision ] + self.display_galaxy_browse_repositories_page( strings_displayed=strings_displayed ) + self.display_installed_repository_manage_page( installed_repository, + strings_displayed=[ 'Installed tool shed repository', 'Valid tools', 'FreeBayes' ] ) + self.verify_tool_metadata_for_installed_repository( installed_repository )
diff -r b268bc0bbc63f525a981547d06c20911f553f1b2 -r 692a1e8b69998d99465838cb5c8b1d56f3a37d2d test/tool_shed/functional/test_1220_uninstall_reinstall_repository_with_repository_dependencies.py --- /dev/null +++ b/test/tool_shed/functional/test_1220_uninstall_reinstall_repository_with_repository_dependencies.py @@ -0,0 +1,123 @@ +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 UninstallingAndReinstallingRepositories( ShedTwillTestCase ): + '''Test uninstalling and reinstalling a repository with tool dependencies.''' + def test_0000_initiate_users( self ): + """Create necessary user accounts.""" + 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 ) + 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 0020 category and upload the emboss repository to the tool shed, if necessary.''' + category = self.create_category( name='Test 0020 Basic Repository 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 ) + 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_install_emboss_repository( self ): + '''Install the emboss repository into the Galaxy instance.''' + self.galaxy_logout() + self.galaxy_login( email=common.admin_email, username=common.admin_username ) + self.install_repository( emboss_repository_name, + common.test_user_1_name, + 'Test 0020 Basic Repository Dependencies', + new_tool_panel_section='test_1210' ) + installed_repository = test_db_util.get_installed_repository_by_name_owner( emboss_repository_name, common.test_user_1_name ) + strings_displayed = [ installed_repository.name, + installed_repository.description, + installed_repository.owner, + installed_repository.tool_shed, + installed_repository.installed_changeset_revision ] + self.display_galaxy_browse_repositories_page( strings_displayed=strings_displayed ) + def test_0015_uninstall_emboss_repository( self ): + '''Uninstall the emboss repository.''' +# old_datatypes = self.get_datatypes_count() + installed_repository = test_db_util.get_installed_repository_by_name_owner( emboss_repository_name, common.test_user_1_name ) + self.uninstall_repository( installed_repository, remove_from_disk=True ) + strings_not_displayed = [ installed_repository.name, installed_repository.installed_changeset_revision ] + self.display_galaxy_browse_repositories_page( strings_not_displayed=strings_not_displayed ) +# new_datatypes = self.get_datatypes_count() +# assert new_datatypes < old_datatypes, 'Uninstalling emboss did not remove datatypes from the registry.' + def test_0020_reinstall_emboss_repository( self ): + '''Reinstall the emboss repository.''' +# old_datatypes = self.get_datatypes_count() + installed_repository = test_db_util.get_installed_repository_by_name_owner( emboss_repository_name, common.test_user_1_name ) + self.reinstall_repository( installed_repository ) + strings_displayed = [ installed_repository.name, + installed_repository.description, + installed_repository.owner, + installed_repository.tool_shed, + installed_repository.installed_changeset_revision ] + self.display_galaxy_browse_repositories_page( strings_displayed=strings_displayed ) + self.display_installed_repository_manage_page( installed_repository, + strings_displayed=[ 'Installed tool shed repository', 'Valid tools', 'emboss' ] ) + self.verify_tool_metadata_for_installed_repository( installed_repository ) +# new_datatypes = self.get_datatypes_count() +# assert new_datatypes > old_datatypes, 'Reinstalling emboss did not add datatypes to the registry.' + def test_0025_deactivate_emboss_repository( self ): + '''Deactivate the emboss repository without removing it from disk.''' +# old_datatypes = self.get_datatypes_count() + installed_repository = test_db_util.get_installed_repository_by_name_owner( emboss_repository_name, common.test_user_1_name ) + self.uninstall_repository( installed_repository, remove_from_disk=False ) + strings_not_displayed = [ installed_repository.name, + installed_repository.installed_changeset_revision ] + self.display_galaxy_browse_repositories_page( strings_not_displayed=strings_not_displayed ) +# new_datatypes = self.get_datatypes_count() +# assert new_datatypes < old_datatypes, 'Deactivating emboss did not remove datatypes from the registry.' + def test_0030_reactivate_emboss_repository( self ): + '''Reactivate the emboss repository and verify that it now shows up in the list of installed repositories.''' +# old_datatypes = self.get_datatypes_count() + installed_repository = test_db_util.get_installed_repository_by_name_owner( emboss_repository_name, common.test_user_1_name ) + self.reactivate_repository( installed_repository ) + strings_displayed = [ installed_repository.name, + installed_repository.description, + installed_repository.owner, + installed_repository.tool_shed, + installed_repository.installed_changeset_revision ] + self.display_galaxy_browse_repositories_page( strings_displayed=strings_displayed ) + self.display_installed_repository_manage_page( installed_repository, + strings_displayed=[ 'Installed tool shed repository', 'Valid tools', 'emboss' ] ) + self.verify_tool_metadata_for_installed_repository( installed_repository ) +# new_datatypes = self.get_datatypes_count() +# assert new_datatypes > old_datatypes, 'Reactivating emboss did not add datatypes to the registry.'
diff -r b268bc0bbc63f525a981547d06c20911f553f1b2 -r 692a1e8b69998d99465838cb5c8b1d56f3a37d2d test/tool_shed/functional/test_1230_uninstall_reinstall_repository_with_dependency_revisions.py --- /dev/null +++ b/test/tool_shed/functional/test_1230_uninstall_reinstall_repository_with_dependency_revisions.py @@ -0,0 +1,146 @@ +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 UninstallingAndReinstallingRepositories( ShedTwillTestCase ): + '''Test uninstalling and reinstalling a repository with repository dependency revisions.''' + def test_0000_initiate_users( self ): + """Create necessary user accounts.""" + 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 ) + 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 0030 category and upload the emboss repository to the tool shed, if necessary.''' + category = self.create_category( name='Test 0030 Repository Dependency Revisions', description='Tests for a repository with tool 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_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_install_emboss_repository( self ): + '''Install the emboss repository into the Galaxy instance.''' + self.galaxy_logout() + self.galaxy_login( email=common.admin_email, username=common.admin_username ) + self.install_repository( emboss_repository_name, + common.test_user_1_name, + 'Test 0030 Repository Dependency Revisions', + new_tool_panel_section='test_1210' ) + installed_repository = test_db_util.get_installed_repository_by_name_owner( emboss_repository_name, common.test_user_1_name ) + strings_displayed = [ installed_repository.name, + installed_repository.description, + installed_repository.owner, + installed_repository.tool_shed, + installed_repository.installed_changeset_revision ] + self.display_galaxy_browse_repositories_page( strings_displayed=strings_displayed ) + def test_0015_uninstall_emboss_repository( self ): + '''Uninstall the emboss repository.''' + installed_repository = test_db_util.get_installed_repository_by_name_owner( emboss_repository_name, common.test_user_1_name ) + self.uninstall_repository( installed_repository, remove_from_disk=True ) + strings_not_displayed = [ installed_repository.installed_changeset_revision ] + self.display_galaxy_browse_repositories_page( strings_not_displayed=strings_not_displayed ) + def test_0020_reinstall_emboss_repository( self ): + '''Reinstall the emboss repository.''' + installed_repository = test_db_util.get_installed_repository_by_name_owner( emboss_repository_name, common.test_user_1_name ) + self.reinstall_repository( installed_repository ) + strings_displayed = [ installed_repository.name, + installed_repository.description, + installed_repository.owner, + installed_repository.tool_shed, + installed_repository.installed_changeset_revision ] + self.display_galaxy_browse_repositories_page( strings_displayed=strings_displayed ) + self.display_installed_repository_manage_page( installed_repository, + strings_displayed=[ 'Installed tool shed repository', 'Valid tools', 'emboss' ] ) + self.verify_tool_metadata_for_installed_repository( installed_repository ) + def test_0025_deactivate_emboss_repository( self ): + '''Deactivate the emboss repository without removing it from disk.''' + installed_repository = test_db_util.get_installed_repository_by_name_owner( emboss_repository_name, common.test_user_1_name ) + self.uninstall_repository( installed_repository, remove_from_disk=False ) + strings_not_displayed = [ installed_repository.installed_changeset_revision ] + self.display_galaxy_browse_repositories_page( strings_not_displayed=strings_not_displayed ) + def test_0030_reactivate_emboss_repository( self ): + '''Reactivate the emboss repository and verify that it now shows up in the list of installed repositories.''' + installed_repository = test_db_util.get_installed_repository_by_name_owner( emboss_repository_name, common.test_user_1_name ) + self.reactivate_repository( installed_repository ) + strings_displayed = [ installed_repository.name, + installed_repository.description, + installed_repository.owner, + installed_repository.tool_shed, + installed_repository.installed_changeset_revision ] + self.display_galaxy_browse_repositories_page( strings_displayed=strings_displayed ) + self.display_installed_repository_manage_page( installed_repository, + strings_displayed=[ 'Installed tool shed repository', 'Valid tools', 'emboss' ] ) + self.verify_tool_metadata_for_installed_repository( installed_repository )
diff -r b268bc0bbc63f525a981547d06c20911f553f1b2 -r 692a1e8b69998d99465838cb5c8b1d56f3a37d2d test/tool_shed/functional_tests.py --- a/test/tool_shed/functional_tests.py +++ b/test/tool_shed/functional_tests.py @@ -270,7 +270,7 @@ file_path = galaxy_file_path, tool_path = tool_path, tool_data_path = tool_data_path, - shed_tool_path=galaxy_shed_tool_path, + shed_tool_path = galaxy_shed_tool_path, update_integrated_tool_panel = False, tool_config_file = [ galaxy_tool_conf_file, galaxy_shed_tool_conf_file ], tool_sheds_config_file = galaxy_tool_sheds_conf_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.
galaxy-commits@lists.galaxyproject.org