commit/galaxy-central: 2 new changesets
2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/690ea95aec34/ changeset: 690ea95aec34 user: inithello date: 2012-12-20 21:14:13 summary: Fix error reinstalling a repository when repo_info_dict is missing from the parameters. affected #: 1 file diff -r 5f3a470e75017b36e3fe37e5343043c551b7a2cd -r 690ea95aec34dd0aaaba06f016d2468ea81f83e1 lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py --- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py +++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py @@ -1374,7 +1374,6 @@ changeset_revision=tool_shed_repository.installed_changeset_revision ) else: repository_dependencies = None - repo = hg.repository( suc.get_configured_ui(), path=os.path.abspath( tool_shed_repository.repo_path( trans.app ) ) ) repo_info_dict = suc.create_repo_info_dict( trans=trans, repository_clone_url=repository_clone_url, changeset_revision=tool_shed_repository.installed_changeset_revision, https://bitbucket.org/galaxy/galaxy-central/changeset/5d4372b6e285/ changeset: 5d4372b6e285 user: inithello date: 2012-12-20 21:16:56 summary: Tool shed functional tests for reinstalling repositories and installing repositories with invalid tools. affected #: 10 files diff -r 690ea95aec34dd0aaaba06f016d2468ea81f83e1 -r 5d4372b6e2855a69758716fc20440071d3f19fbf 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 @@ -16,8 +16,15 @@ 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_all_installed_repositories( actually_installed=False ): + if actually_installed: + return ga_session.query( galaxy.model.ToolShedRepository ) \ + .filter( and_( galaxy.model.ToolShedRepository.table.c.deleted == False, + galaxy.model.ToolShedRepository.table.c.uninstalled == False, + galaxy.model.ToolShedRepository.table.c.status == galaxy.model.ToolShedRepository.installation_status.INSTALLED ) ) \ + .all() + else: + 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 690ea95aec34dd0aaaba06f016d2468ea81f83e1 -r 5d4372b6e2855a69758716fc20440071d3f19fbf test/tool_shed/base/twilltestcase.py --- a/test/tool_shed/base/twilltestcase.py +++ b/test/tool_shed/base/twilltestcase.py @@ -196,6 +196,10 @@ tc.fv( "1", "selected_files_to_delete", ','.join( files_to_delete ) ) tc.submit( 'select_files_to_delete_button' ) self.check_for_strings( strings_displayed, strings_not_displayed ) + def display_galaxy_browse_repositories_page( self, strings_displayed=[], strings_not_displayed=[] ): + url = '/admin_toolshed/browse_repositories' + self.visit_galaxy_url( url ) + self.check_for_strings( strings_displayed, strings_not_displayed ) def display_installed_repository_manage_page( self, installed_repository, strings_displayed=[], strings_not_displayed=[] ): url = '/admin_toolshed/manage_repository?id=%s' % self.security.encode_id( installed_repository.id ) self.visit_galaxy_url( url ) @@ -392,7 +396,20 @@ 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, category_name, install_tool_dependencies=False, changeset_revision=None, strings_displayed=[], strings_not_displayed=[], preview_strings_displayed=[] ): + def initiate_installation_process( self ): + html = self.last_page() + # Since the installation process is by necessity asynchronous, we have to get the parameters to 'manually' initiate the + # installation process. This regex will return the tool shed repository IDs in group(1), the encoded_kwd parameter in + # 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 self.browse_tool_shed( url=self.url ) @@ -406,27 +423,16 @@ ( changeset_revision, repository_id, self.galaxy_url ) self.visit_url( url ) self.check_for_strings( strings_displayed, strings_not_displayed ) + form = tc.browser.get_form( 'select_tool_panel_section' ) if 'install_tool_dependencies' in self.last_page(): - form = tc.browser.get_form( 'select_tool_panel_section' ) checkbox = form.find_control( id="install_tool_dependencies" ) checkbox.disabled = False if install_tool_dependencies: checkbox.selected = True else: checkbox.selected = False - tc.submit( 'select_tool_panel_section_button' ) - html = self.last_page() - # Since the installation process is by necessity asynchronous, we have to get the parameters to 'manually' initiate the - # installation process. This regex will return the tool shed repository IDs in group(1), the encoded_kwd parameter in - # 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 ) + self.submit_form( 1, 'select_tool_panel_section_button', **kwd ) + 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=[] ): url = '/repository/load_invalid_tool?repository_id=%s&tool_config=%s&changeset_revision=%s' % \ @@ -451,6 +457,12 @@ 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 reinstall_repository( self, installed_repository ): + url = '/admin_toolshed/reinstall_repository?id=%s' % self.security.encode_id( installed_repository.id ) + self.visit_galaxy_url( url ) + self.initiate_installation_process() + tool_shed_repository = test_db_util.get_repository_by_name_and_owner( installed_repository.name, installed_repository.owner ) + self.wait_for_repository_installation( tool_shed_repository, installed_repository.installed_changeset_revision ) def repository_is_new( self, repository ): repo = hg.repository( ui.ui(), self.get_repo_path( repository ) ) tip_ctx = repo.changectx( repo.changelog.tip() ) @@ -495,6 +507,17 @@ def tip_has_metadata( self, repository ): tip = self.get_repository_tip( repository ) return test_db_util.get_repository_metadata_by_repository_id_changeset_revision( repository.id, tip ) + 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 + tc.submit( 'deactivate_or_uninstall_repository_button' ) + strings_displayed = [ 'has been uninstalled', 'The repository named' ] + 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 ) self.visit_galaxy_url( url ) @@ -521,15 +544,6 @@ self.reset_installed_repository_metadata( installed_repository ) new_metadata = installed_repository.metadata 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 ) - strings_displayed.extend( [ installed_repository.name, - installed_repository.description, - installed_repository.owner, - installed_repository.tool_shed, - installed_repository.installed_changeset_revision ] ) - self.check_for_strings( strings_displayed, strings_not_displayed ) def verify_installed_repository_data_table_entries( self, data_tables=[] ): data_table = util.parse_xml( self.shed_tool_data_table_conf ) found = False diff -r 690ea95aec34dd0aaaba06f016d2468ea81f83e1 -r 5d4372b6e2855a69758716fc20440071d3f19fbf test/tool_shed/functional/test_0070_invalid_tool.py --- /dev/null +++ b/test/tool_shed/functional/test_0070_invalid_tool.py @@ -0,0 +1,53 @@ +from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os +import tool_shed.base.test_db_util as test_db_util + +repository_name = 'freebayes_0070' +repository_description = "Galaxy's freebayes tool" +repository_long_description = "Long description of Galaxy's freebayes tool" + +class TestFreebayesRepository( ShedTwillTestCase ): + '''Testing freebayes with tool data table entries, .loc files, and tool dependencies.''' + def test_0000_create_or_login_admin_user( self ): + """Create necessary user accounts and login as an 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' % 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='Test 0070 Repository With Invalid Tool', description='Tests for a repository with an invalid tool.' ) + def test_0010_create_test_repository_and_upload_tool_xml( self ): + '''Create and populate a freebayes repository. After this test, it should contain one valid tool and one invalid tool.''' + self.logout() + self.login( email=common.test_user_1_email, username=common.test_user_1_name ) + category = test_db_util.get_category_by_name( 'Test 0070 Repository With Invalid Tool' ) + 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, + strings_displayed=[], + commit_message='Uploaded the tool xml.' ) + self.upload_file( repository, + 'filtering/filtering_1.1.0.tar', + valid_tools_only=False, + strings_displayed=[], + commit_message='Uploaded the tool xml.', + remove_repo_files_not_in_tar='No' ) + self.display_manage_repository_page( repository, strings_displayed=[ 'Valid tools', 'Invalid tools' ] ) + changeset_revision = self.get_repository_tip( repository ) + self.check_repository_tools_for_changeset_revision( repository, changeset_revision ) + self.check_repository_invalid_tools_for_changeset_revision( repository, + changeset_revision, + strings_displayed=[ 'requires an entry' ], + strings_not_displayed=[] ) diff -r 690ea95aec34dd0aaaba06f016d2468ea81f83e1 -r 5d4372b6e2855a69758716fc20440071d3f19fbf 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 @@ -51,9 +51,17 @@ '''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_0025_install_filtering_repository( self ): - self.install_repository( 'filtering_0000', common.test_user_1_name, 'Test 0000 Basic Repository Features 1' ) + self.install_repository( 'filtering_0000', + common.test_user_1_name, + 'Test 0000 Basic Repository Features 1', + new_tool_panel_section='test_1000' ) 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 ) + 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', 'Filter1' ] ) self.verify_tool_metadata_for_installed_repository( installed_repository ) diff -r 690ea95aec34dd0aaaba06f016d2468ea81f83e1 -r 5d4372b6e2855a69758716fc20440071d3f19fbf 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 @@ -70,9 +70,15 @@ common.test_user_1_name, 'Test 0010 Repository With Tool Dependencies', strings_displayed=strings_displayed, - install_tool_dependencies=False ) + install_tool_dependencies=False, + new_tool_panel_section='test_1010' ) 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 ) + 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.check_installed_repository_tool_dependencies( installed_repository, dependencies_installed=False ) diff -r 690ea95aec34dd0aaaba06f016d2468ea81f83e1 -r 5d4372b6e2855a69758716fc20440071d3f19fbf 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,9 +65,18 @@ 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, 'Test 0020 Basic Repository Dependencies', install_tool_dependencies=False ) + self.install_repository( 'emboss_0020', + common.test_user_1_name, + 'Test 0020 Basic Repository Dependencies', + install_tool_dependencies=False, + new_tool_panel_section='test_1020' ) 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 ) + 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', 'antigenic' ] ) self.check_installed_repository_tool_dependencies( installed_repository, dependencies_installed=False ) diff -r 690ea95aec34dd0aaaba06f016d2468ea81f83e1 -r 5d4372b6e2855a69758716fc20440071d3f19fbf 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 @@ -107,9 +107,15 @@ common.test_user_1_name, 'Test 0030 Repository Dependency Revisions', changeset_revision=revisions[1], - install_tool_dependencies=False ) + 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 ) - self.verify_installed_repository_on_browse_page( 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', 'antigenic' ] ) self.check_installed_repository_tool_dependencies( installed_repository, dependencies_installed=False ) diff -r 690ea95aec34dd0aaaba06f016d2468ea81f83e1 -r 5d4372b6e2855a69758716fc20440071d3f19fbf test/tool_shed/functional/test_1070_invalid_tool.py --- /dev/null +++ b/test/tool_shed/functional/test_1070_invalid_tool.py @@ -0,0 +1,80 @@ +from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os +import tool_shed.base.test_db_util as test_db_util + +repository_name = 'freebayes_0070' +repository_description = "Galaxy's freebayes tool" +repository_long_description = "Long description of Galaxy's freebayes tool" + +class TestFreebayesRepository( ShedTwillTestCase ): + '''Testing freebayes with tool data table entries, .loc files, and tool dependencies.''' + def test_0000_create_or_login_admin_user( self ): + """Create necessary user accounts and login as an admin user.""" + self.galaxy_logout() + self.galaxy_login( email=common.admin_email, username=common.admin_username ) + 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 ) + 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_ensure_existence_of_repository_and_category( self ): + '''Create freebayes repository and upload only freebayes.xml. This should result in an error message and invalid tool.''' + self.create_category( name='Test 0070 Repository With Invalid Tool', + description='Tests for a repository with an invalid tool.' ) + self.logout() + self.login( email=common.test_user_1_email, username=common.test_user_1_name ) + category = test_db_util.get_category_by_name( 'Test 0070 Repository With Invalid Tool' ) + 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=[] ) + if self.repository_is_new( repository ): + self.upload_file( repository, + 'freebayes/freebayes.xml', + valid_tools_only=False, + commit_message='Uploaded the invalid tool xml.' ) + self.upload_file( repository, + 'filtering/filtering_1.1.0.tar', + valid_tools_only=False, + commit_message='Uploaded the valid tool 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 repository.""" + self.galaxy_logout() + self.galaxy_login( email=common.admin_email, username=common.admin_username ) + self.browse_tool_shed( url=self.url, strings_displayed=[ 'Test 0070 Repository With Invalid Tool' ] ) + category = test_db_util.get_category_by_name( 'Test 0070 Repository With Invalid Tool' ) + self.browse_category( category, strings_displayed=[ repository_name ] ) + self.preview_repository_in_tool_shed( repository_name, common.test_user_1_name, strings_displayed=[ repository_name ] ) + def test_0015_install_freebayes_repository( self ): + '''Install the test repository without installing tool dependencies.''' + self.install_repository( repository_name, + common.test_user_1_name, + 'Test 0070 Repository With Invalid Tool', + install_tool_dependencies=False, + new_tool_panel_section='test_1070' ) + installed_repository = test_db_util.get_installed_repository_by_name_owner( 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 ) + self.display_installed_repository_manage_page( installed_repository, + strings_displayed=[ 'simple expressions', 'Invalid tools' ], + strings_not_displayed=[ 'variant detector' ] ) + self.verify_tool_metadata_for_installed_repository( installed_repository ) + self.update_installed_repository( installed_repository, strings_displayed=[ "there are no updates available" ] ) + assert 'invalid_tools' in installed_repository.metadata, 'No invalid tools were defined in %s.' % installed_repository.name + 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( repository_name, common.test_user_1_name ) diff -r 690ea95aec34dd0aaaba06f016d2468ea81f83e1 -r 5d4372b6e2855a69758716fc20440071d3f19fbf test/tool_shed/functional/test_1200_uninstall_and_reinstall_basic_repository.py --- /dev/null +++ b/test/tool_shed/functional/test_1200_uninstall_and_reinstall_basic_repository.py @@ -0,0 +1,96 @@ +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.''' + 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 ) + 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 the tool shed, 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_install_filtering_repository( self ): + '''Install the filtering repository into the Galaxy instance.''' + self.galaxy_logout() + self.galaxy_login( email=common.admin_email, username=common.admin_username ) + self.install_repository( 'filtering_0000', + common.test_user_1_name, + 'Test 0000 Basic Repository Features 1', + new_tool_panel_section='test_1000' ) + installed_repository = test_db_util.get_installed_repository_by_name_owner( 'filtering_0000', 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_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, + installed_repository.installed_changeset_revision ] + self.display_galaxy_browse_repositories_page( strings_not_displayed=strings_not_displayed ) + def test_0020_reinstall_filtering_repository( self ): + '''Reinstall the filtering repository.''' + installed_repository = test_db_util.get_installed_repository_by_name_owner( 'filtering_0000', 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', 'Filter1' ] ) + self.verify_tool_metadata_for_installed_repository( installed_repository ) + def test_0025_deactivate_filtering_repository( self ): + '''Deactivate the filtering repository without removing it from disk.''' + installed_repository = test_db_util.get_installed_repository_by_name_owner( 'filtering_0000', common.test_user_1_name ) + self.uninstall_repository( installed_repository, remove_from_disk=False ) + strings_not_displayed = [ installed_repository.name, + installed_repository.description, + installed_repository.installed_changeset_revision ] + self.display_galaxy_browse_repositories_page( strings_not_displayed=strings_not_displayed ) + 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 ) + 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', 'Filter1' ] ) + self.verify_tool_metadata_for_installed_repository( installed_repository ) diff -r 690ea95aec34dd0aaaba06f016d2468ea81f83e1 -r 5d4372b6e2855a69758716fc20440071d3f19fbf test/tool_shed/functional/test_1300_reset_all_metadata.py --- a/test/tool_shed/functional/test_1300_reset_all_metadata.py +++ b/test/tool_shed/functional/test_1300_reset_all_metadata.py @@ -258,7 +258,7 @@ 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() + repositories = test_db_util.get_all_installed_repositories( actually_installed=True ) for repository in repositories: repository_metadata[ self.security.encode_id( repository.id ) ] = repository.metadata self.reset_metadata_on_selected_installed_repositories( repository_metadata.keys() ) 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