2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/0b2c782ca2d7/ changeset: 0b2c782ca2d7 user: inithello date: 2013-01-09 15:51:53 summary: Fix colspan on installed repository dependency folder. affected #: 1 file diff -r 857a60e69c7aee92f67f37311a40a825b40a6481 -r 0b2c782ca2d7a62f6a4e0781c8b729225806b442 templates/webapps/community/repository/common.mako --- a/templates/webapps/community/repository/common.mako +++ b/templates/webapps/community/repository/common.mako @@ -209,7 +209,7 @@ else: folder_label = "%s<i> - this repository's tools require handling of these missing dependencies</i>" % folder_label col_span_str = 'colspan="5"' - elif folder.label in [ 'Repository dependencies', 'Missing repository dependencies' ]: + elif folder.label in [ 'Installed repository dependencies', 'Repository dependencies', 'Missing repository dependencies' ]: if folder.description: folder_label = "%s<i> - %s</i>" % ( folder_label, folder.description ) else: @@ -245,7 +245,7 @@ </a></div></span> - <td> + </td></tr><% my_row = row_counter.count https://bitbucket.org/galaxy/galaxy-central/commits/6ef9b038e329/ changeset: 6ef9b038e329 user: inithello date: 2013-01-09 15:52:46 summary: Tool shed functional test enhancements - circular repository dependencies, tool panel sections. affected #: 5 files diff -r 0b2c782ca2d7a62f6a4e0781c8b729225806b442 -r 6ef9b038e329b6ee4e71ef1d1b1a22b9b2000ca1 test/tool_shed/base/twilltestcase.py --- a/test/tool_shed/base/twilltestcase.py +++ b/test/tool_shed/base/twilltestcase.py @@ -47,6 +47,9 @@ def browse_tool_shed( self, url, strings_displayed=[], strings_not_displayed=[] ): self.visit_galaxy_url( '/admin_toolshed/browse_tool_shed?tool_shed_url=%s' % url ) self.check_for_strings( strings_displayed, strings_not_displayed ) + def check_count_of_metadata_revisions_associated_with_repository( self, repository, metadata_count ): + self.check_repository_changelog( repository ) + self.check_string_count_in_page( 'Repository metadata is associated with this change set.', metadata_count ) def check_for_strings( self, strings_displayed=[], strings_not_displayed=[] ): if strings_displayed: for string in strings_displayed: @@ -57,9 +60,24 @@ def check_for_valid_tools( self, repository, strings_displayed=[], strings_not_displayed=[] ): strings_displayed.append( 'Valid tools' ) self.display_manage_repository_page( repository, strings_displayed, strings_not_displayed ) - def check_count_of_metadata_revisions_associated_with_repository( self, repository, metadata_count ): - self.check_repository_changelog( repository ) - self.check_string_count_in_page( 'Repository metadata is associated with this change set.', metadata_count ) + def check_galaxy_repository_tool_panel_section( self, repository, expected_tool_panel_section ): + metadata = repository.metadata + assert 'tools' in metadata, 'Tools not found in metadata: %s' % metadata + tool_metadata = metadata[ 'tools' ] + # If integrated_tool_panel.xml is to be tested, this test method will need to be enhanced to handle tools + # from the same repository in different tool panel sections. Getting the first tool guid is ok, because + # currently all tools contained in a single repository will be loaded into the same tool panel section. + tool_guid = tool_metadata[ 0 ][ 'guid' ] + assert 'tool_panel_section' in metadata, 'Tool panel section not found in metadata: %s' % metadata + tool_panel_section_metadata = metadata[ 'tool_panel_section' ] + # tool_section_dict = dict( tool_config=guids_and_configs[ guid ], + # id=section_id, + # name=section_name, + # version=section_version ) + # This dict is appended to tool_panel_section_metadata[ tool_guid ] + tool_panel_section = tool_panel_section_metadata[ tool_guid ][ 0 ][ 'name' ] + assert tool_panel_section == expected_tool_panel_section, 'Expected tool panel section %s, found %s\nMetadata: %s\n' % \ + ( expected_tool_panel_section, tool_panel_section, metadata ) def check_installed_repository_tool_dependencies( self, installed_repository, dependencies_installed=False ): # Tool dependencies are not being installed in these functional tests. If this is changed, the test method will also need to be updated. strings_not_displayed = [] @@ -150,6 +168,12 @@ self.visit_url( '/admin/manage_categories?operation=create' ) self.submit_form( form_no=1, button="create_category_button", **kwd ) return test_db_util.get_category_by_name( kwd[ 'name' ] ) + def create_checkbox_query_string( self, field_name, value ): + field_value = str( value ).lower() + if value: + return '%s=%s&%s=%s' % ( field_name, field_value, field_name, field_value ) + else: + return '%s=%s' % ( field_name, field_value ) 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 ) @@ -306,7 +330,6 @@ self.visit_galaxy_url( "/user/logout" ) self.check_page_for_string( "You have been logged out" ) self.home() - def generate_repository_dependency_xml( self, repositories, xml_filename, dependency_description='' ): file_path = os.path.split( xml_filename )[0] if not os.path.exists( file_path ): @@ -369,7 +392,6 @@ request_param_path = base_path else: request_param_path = os.path.join( base_path, current_path ) - #request_param_path = request_param_path.replace( '/', '%2f' ) # Get the current folder's contents. url = '/repository/open_folder?folder_path=%s' % request_param_path self.visit_url( url ) @@ -431,7 +453,11 @@ if workflow_name not in strings_displayed: strings_displayed.append( workflow_name ) self.check_for_strings( strings_displayed, strings_not_displayed ) - def initiate_installation_process( self, install_tool_dependencies=False, install_repository_dependencies=True ): + def initiate_installation_process( self, + install_tool_dependencies=False, + install_repository_dependencies=True, + no_changes=True, + new_tool_panel_section=None ): 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 @@ -441,22 +467,21 @@ if install_parameters: iri_ids = install_parameters.group(1) # In some cases, the returned iri_ids are of the form: "[u'<encoded id>', u'<encoded id>']" - # This ensures that non-hex characters are stripped out of the list, so that util.listify/decode_id will handle them correctly. + # This regex ensures that non-hex characters are stripped out of the list, so that util.listify/decode_id + # will handle them correctly. It's safe to pass the cleaned list to manage_repositories, because it can parse + # comma-separated values. repository_ids = str( iri_ids ) repository_ids = re.sub( '[^a-fA-F0-9,]+', '', repository_ids ) - decoded_kwd = tool_shed_decode( install_parameters.group(2) ) - if 'install_tool_dependencies' in decoded_kwd: - decoded_kwd[ 'install_tool_dependencies' ] = install_tool_dependencies - if 'install_repository_dependencies' in decoded_kwd: - decoded_kwd[ 'install_repository_dependencies' ] = install_repository_dependencies + 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' % \ - ( ','.join( util.listify( repository_ids ) ), tool_shed_encode( decoded_kwd ), reinstalling ) + ( ','.join( util.listify( repository_ids ) ), encoded_kwd, reinstalling ) self.visit_galaxy_url( url ) return util.listify( repository_ids ) 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 ): + install_repository_dependencies=True, changeset_revision=None, + strings_displayed=[], strings_not_displayed=[], preview_strings_displayed=[], + post_submit_strings_displayed=[], new_tool_panel_section=None, **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, owner, strings_displayed=preview_strings_displayed ) @@ -468,6 +493,8 @@ ( changeset_revision, repository_id, self.galaxy_url ) self.visit_url( url ) self.check_for_strings( strings_displayed, strings_not_displayed ) + # This section is tricky, due to the way twill handles form submission. The tool dependency checkbox needs to + # be hacked in through tc.browser, putting the form field in kwd doesn't work. 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" ) @@ -476,11 +503,15 @@ checkbox.selected = True else: checkbox.selected = False + if 'install_repository_dependencies' in self.last_page(): + kwd[ 'install_repository_dependencies' ] = str( install_repository_dependencies ).lower() if 'shed_tool_conf' not in kwd: kwd[ 'shed_tool_conf' ] = self.shed_tool_conf + if new_tool_panel_section: + kwd[ 'new_tool_panel_section' ] = new_tool_panel_section self.submit_form( 1, 'select_tool_panel_section_button', **kwd ) self.check_for_strings( post_submit_strings_displayed, strings_not_displayed ) - repository_ids = self.initiate_installation_process( install_tool_dependencies ) + repository_ids = self.initiate_installation_process( new_tool_panel_section=new_tool_panel_section ) self.wait_for_repository_installation( repository_ids ) 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' % \ @@ -523,14 +554,40 @@ self.check_for_strings( strings_displayed, [] ) def reinstall_repository( self, installed_repository, - install_repository_dependencies='true', - install_tool_dependencies='false' ): + install_repository_dependencies=True, + install_tool_dependencies=False, + no_changes=True, + new_tool_panel_section='' ): url = '/admin_toolshed/reselect_tool_panel_section?id=%s' % self.security.encode_id( installed_repository.id ) self.visit_galaxy_url( url ) - url = '/admin_toolshed/reinstall_repository?id=%s&install_repository_dependencies=%s&install_repository_dependencies=%s' % \ - ( self.security.encode_id( installed_repository.id ), install_repository_dependencies, install_repository_dependencies ) + # From galaxy.web.form_builder.CheckboxField: + # The hidden field is necessary because if the check box is not checked on the form, it will + # not be included in the request params. The hidden field ensure that this will happen. When + # parsing the request, the value 'true' in the hidden field actually means it is NOT checked. + # See the is_checked() method below. The prefix is necessary in each case to ensure functional + # correctness when the param is inside a conditional. + # + # This may look strange upon initial inspection, but see the comments in the get_html() method + # above for clarification. Basically, if value is not True, then it will always be a list with + # 2 input fields ( a checkbox and a hidden field ) if the checkbox is checked. If it is not + # checked, then value will be only the hidden field. + # + # The create_checkbox_query_string method emulates the described behavior with URL query parameters. + # This is currently necessary because twill does not correctly parse the reselect tool panel section + # form, so the test method has to visit the intended form target "manually". + repo_dependencies = self.create_checkbox_query_string( field_name='install_repository_dependencies', value=install_repository_dependencies ) + tool_dependencies = self.create_checkbox_query_string( field_name='install_tool_dependencies', value=install_tool_dependencies ) + encoded_repository_id = self.security.encode_id( installed_repository.id ) + url = '/admin_toolshed/reinstall_repository?id=%s&%s&%s&no_changes=%s&new_tool_panel_section=%s' % \ + ( encoded_repository_id, repo_dependencies, tool_dependencies, str( no_changes ), new_tool_panel_section ) self.visit_galaxy_url( url ) - repository_ids = self.initiate_installation_process( install_tool_dependencies, install_repository_dependencies ) + # Then manually initiate the install process, as with installing a repository. See comments in the + # initiate_installation_process method for details. + repository_ids = self.initiate_installation_process( install_tool_dependencies, + install_repository_dependencies, + no_changes, + new_tool_panel_section ) + # Finally, wait until all repositories are in a final state (either Error or Installed) before returning. self.wait_for_repository_installation( repository_ids ) def repository_is_new( self, repository ): repo = hg.repository( ui.ui(), self.get_repo_path( repository ) ) @@ -619,6 +676,14 @@ def verify_installed_repository_data_table_entries( self, data_tables=[] ): data_table = util.parse_xml( self.shed_tool_data_table_conf ) found = False + # Tool data table xml structure: + # <tables> + # <!-- Locations of all fasta files under genome directory --> + # <table name="all_fasta" comment_char="#"> + # <columns>value, dbkey, name, path</columns> + # <file path="tool-data/all_fasta.loc" /> + # </table> + # </tables> for table_elem in data_table.findall( 'table' ): for data_table in data_tables: if 'name' in table_elem.attrib and table_elem.attrib[ 'name' ] == data_table: @@ -643,6 +708,8 @@ self.reset_repository_metadata( repository ) for metadata in self.get_repository_metadata( repository ): new_metadata[ metadata.changeset_revision ] = metadata.metadata + # Python's dict comparison recursively compares sorted key => value pairs and returns true if any key or value differs, + # or if the number of keys differs. assert old_metadata == new_metadata, 'Metadata changed after reset on repository %s.' % repository.name def view_installed_workflow( self, repository, workflow_name, strings_displayed=[], strings_not_displayed=[] ): url = '/admin_toolshed/view_workflow?repository_id=%s&workflow_name=%s' % \ @@ -655,6 +722,8 @@ def wait_for_repository_installation( self, repository_ids ): final_states = [ galaxy_model.ToolShedRepository.installation_status.ERROR, galaxy_model.ToolShedRepository.installation_status.INSTALLED ] + # Wait until all repositories are in a final state before returning. This ensures that subsequent tests + # are running against an installed repository, and not one that is still in the process of installing. if repository_ids: for repository_id in repository_ids: galaxy_repository = test_db_util.get_installed_repository_by_id( self.security.decode_id( repository_id ) ) @@ -662,6 +731,7 @@ while galaxy_repository.status not in final_states: test_db_util.ga_refresh( galaxy_repository ) timeout_counter = timeout_counter + 1 + # This timeout currently defaults to 180 seconds, or 3 minutes. if timeout_counter > common.repository_installation_timeout: raise AssertionError( 'Repository installation timed out, %d seconds elapsed, repository state is %s.' % \ ( timeout_counter, repository.status ) ) diff -r 0b2c782ca2d7a62f6a4e0781c8b729225806b442 -r 6ef9b038e329b6ee4e71ef1d1b1a22b9b2000ca1 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 @@ -1,6 +1,10 @@ from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os import tool_shed.base.test_db_util as test_db_util +repository_name = 'freebayes_0010' +repository_description="Galaxy's freebayes tool", +repository_long_description="Long description of Galaxy's freebayes tool", + class ToolWithToolDependencies( ShedTwillTestCase ): '''Test installing a repository with tool dependencies.''' def test_0000_initiate_users( self ): @@ -25,9 +29,9 @@ 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", + 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 ) ) if self.repository_is_new( repository ): @@ -61,18 +65,18 @@ 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', 'Tool dependencies' ] ) + 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, 'Valid tools', 'Tool dependencies' ] ) def test_0015_install_freebayes_repository( self ): '''Install the freebayes repository without installing tool dependencies.''' strings_displayed=[ 'set your tool_dependency_dir', 'can be automatically installed', 'Set the tool_dependency_dir' ] - self.install_repository( 'freebayes_0010', + self.install_repository( repository_name, common.test_user_1_name, 'Test 0010 Repository With Tool Dependencies', strings_displayed=strings_displayed, 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 ) + 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, @@ -85,7 +89,7 @@ self.verify_tool_metadata_for_installed_repository( installed_repository ) 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( 'freebayes_0010', common.test_user_1_name ) + self.verify_installed_repository_metadata_unchanged( repository_name, common.test_user_1_name ) def test_0025_verify_sample_files( self ): '''Verify that the installed repository populated shed_tool_data_table.xml and the sample files.''' self.verify_installed_repository_data_table_entries( data_tables=[ 'sam_fa_indexes' ] ) diff -r 0b2c782ca2d7a62f6a4e0781c8b729225806b442 -r 6ef9b038e329b6ee4e71ef1d1b1a22b9b2000ca1 test/tool_shed/functional/test_1080_advanced_circular_dependency_installation.py --- a/test/tool_shed/functional/test_1080_advanced_circular_dependency_installation.py +++ b/test/tool_shed/functional/test_1080_advanced_circular_dependency_installation.py @@ -1,4 +1,4 @@ -from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os +from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os, logging import tool_shed.base.test_db_util as test_db_util column_repository_name = 'column_maker_0080' @@ -12,6 +12,10 @@ category_name = 'Test 0080 Advanced Circular Dependencies' category_description = 'Test circular dependency features' +log = logging.getLogger( __name__ ) + +running_standalone = False + class TestRepositoryDependencies( ShedTwillTestCase ): '''Testing freebayes with tool data table entries, .loc files, and tool dependencies.''' def test_0000_create_or_login_admin_user( self ): @@ -31,9 +35,10 @@ 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_initiate_test_data( self ): - """Create a category for this test suite and add repositories to it.""" + def test_0005_create_and_populate_column_repository( self ): + """Create the category for this test suite, then create and populate column_maker.""" category = self.create_category( name=category_name, description=category_description ) + global running_standalone self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) repository = self.get_or_create_repository( name=column_repository_name, @@ -47,16 +52,31 @@ 'column_maker/column_maker.tar', strings_displayed=[], commit_message='Uploaded column_maker.tar.' ) - repository = self.get_or_create_repository( name=convert_repository_name, - description=convert_repository_description, - long_description=convert_repository_long_description, - owner=common.test_user_1_name, - category_id=self.security.encode_id( category.id ), - strings_displayed=[] ) + running_standalone = True + def test_0010_create_and_populate_convert_repository( self ): + '''Create and populate the convert_chars repository.''' + global running_standalone + self.logout() + self.login( email=common.admin_email, username=common.admin_username ) + category = self.create_category( name=category_name, description=category_description ) + self.logout() + self.login( email=common.test_user_1_email, username=common.test_user_1_name ) + repository = self.get_or_create_repository( name=convert_repository_name, + description=convert_repository_description, + long_description=convert_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, 'convert_chars/convert_chars.tar', strings_displayed=[], commit_message='Uploaded convert_chars.tar.' ) + running_standalone = True + def test_0015_upload_dependency_xml_if_needed( self ): + '''If this test is being run by itself, it will not have repository dependencies configured yet.''' + global running_standalone + if running_standalone: convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) column_repository = test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name ) repository_dependencies_path = self.generate_temp_path( 'test_1080', additional_paths=[ 'convert' ] ) @@ -77,20 +97,20 @@ 'repository_dependencies.xml', filepath=repository_dependencies_path, commit_message='Uploaded dependency on column' ) - def test_0010_install_repositories( self ): - '''Install convert_chars with repository dependencies check box - this should install both convert_chars and column_maker.''' + def test_0020_install_convert_repository( self ): + '''Install convert_chars without repository dependencies into convert_chars tool panel section.''' self.galaxy_logout() self.galaxy_login( email=common.admin_email, username=common.admin_username ) self.install_repository( convert_repository_name, common.test_user_1_name, category_name, install_tool_dependencies=False, - install_repository_dependencies='Yes', - new_tool_panel_section='test_1080' ) + install_repository_dependencies=False, + new_tool_panel_section='convert_chars' ) installed_convert_repository = test_db_util.get_installed_repository_by_name_owner( convert_repository_name, common.test_user_1_name ) installed_column_repository = test_db_util.get_installed_repository_by_name_owner( column_repository_name, - common.test_user_1_name ) + common.test_user_1_name ) browse_strings_displayed = [ installed_convert_repository.name, installed_convert_repository.description, installed_convert_repository.tool_shed, @@ -101,13 +121,41 @@ installed_convert_repository.installed_changeset_revision, installed_column_repository.name, installed_column_repository.installed_changeset_revision, - 'Installed' ] - self.display_galaxy_browse_repositories_page( strings_displayed=strings_displayed ) - strings_displayed.append( 'Installed repository dependencies' ) + 'Missing repository dependencies' ] + self.display_galaxy_browse_repositories_page( strings_displayed=browse_strings_displayed ) self.display_installed_repository_manage_page( installed_convert_repository, strings_displayed=strings_displayed ) - def test_0015_deactivate_convert_repository( self ): - '''Deactivate convert_chars - this should display column_maker as installed but missing repository dependencies''' + def test_0025_install_column_repository( self ): + '''Install column maker with repository dependencies into column_maker tool panel section.''' + self.install_repository( column_repository_name, + common.test_user_1_name, + category_name, + install_repository_dependencies=True, + new_tool_panel_section='column_maker', + strings_displayed=[ 'install_repository_dependencies' ] ) + installed_convert_repository = test_db_util.get_installed_repository_by_name_owner( convert_repository_name, + common.test_user_1_name ) + installed_column_repository = test_db_util.get_installed_repository_by_name_owner( column_repository_name, + common.test_user_1_name ) + browse_strings_displayed = [ installed_convert_repository.name, + installed_convert_repository.description, + installed_convert_repository.tool_shed, + installed_convert_repository.installed_changeset_revision, + installed_column_repository.name, + installed_column_repository.description, + installed_column_repository.installed_changeset_revision ] + strings_displayed = [ installed_column_repository.name, + installed_column_repository.description, + installed_column_repository.tool_shed, + installed_column_repository.installed_changeset_revision, + installed_convert_repository.name, + installed_convert_repository.installed_changeset_revision, + 'Installed repository dependencies' ] + self.display_galaxy_browse_repositories_page( strings_displayed=browse_strings_displayed ) + self.display_installed_repository_manage_page( installed_column_repository, + strings_displayed=strings_displayed ) + def test_0030_deactivate_convert_repository( self ): + '''Deactivate convert_chars, verify that column_maker is installed and missing repository dependencies.''' installed_convert_repository = test_db_util.get_installed_repository_by_name_owner( convert_repository_name, common.test_user_1_name ) installed_column_repository = test_db_util.get_installed_repository_by_name_owner( column_repository_name, @@ -123,8 +171,8 @@ 'Deactivated' ] self.display_installed_repository_manage_page( installed_column_repository, strings_displayed=strings_displayed ) - def test_0020_reactivate_convert_repository( self ): - '''Activate convert_chars - this should display both convert_chars and column_maker as installed with a green box''' + def test_0035_reactivate_convert_repository( self ): + '''Reactivate convert_chars, both convert_chars and column_maker should now show as installed.''' installed_convert_repository = test_db_util.get_installed_repository_by_name_owner( convert_repository_name, common.test_user_1_name ) installed_column_repository = test_db_util.get_installed_repository_by_name_owner( column_repository_name, @@ -137,8 +185,8 @@ installed_column_repository.name, installed_column_repository.installed_changeset_revision, 'Installed repository dependencies' ] - def test_0025_deactivate_column_repository( self ): - '''Deactivate column_maker - this should display convert_chars installed but missing repository dependencies''' + def test_0040_deactivate_column_repository( self ): + '''Deactivate column_maker, verify that convert_chars is installed and missing repository dependencies.''' installed_convert_repository = test_db_util.get_installed_repository_by_name_owner( convert_repository_name, common.test_user_1_name ) installed_column_repository = test_db_util.get_installed_repository_by_name_owner( column_repository_name, @@ -154,8 +202,8 @@ 'Deactivated' ] self.display_installed_repository_manage_page( installed_convert_repository, strings_displayed=strings_displayed ) - def test_0030_deactivate_convert_repository( self ): - '''Deactivate convert_chars - both convert_chars and column_maker are deactivated''' + def test_0045_deactivate_convert_repository( self ): + '''Deactivate convert_chars, verify that both convert_chars and column_maker are deactivated.''' installed_convert_repository = test_db_util.get_installed_repository_by_name_owner( convert_repository_name, common.test_user_1_name ) installed_column_repository = test_db_util.get_installed_repository_by_name_owner( column_repository_name, @@ -168,8 +216,8 @@ installed_convert_repository.description, installed_convert_repository.installed_changeset_revision ] self.display_galaxy_browse_repositories_page( strings_not_displayed=strings_not_displayed ) - def test_0035_reactivate_column_repository( self ): - '''Activate column_maker - this should not automatically activate convert_chars, so column_maker should be displayed as installed but missing repository dependencies''' + def test_0050_reactivate_column_repository( self ): + '''Reactivate column_maker. This should not automatically reactivate convert_chars, so column_maker should be displayed as installed but missing repository dependencies.''' installed_convert_repository = test_db_util.get_installed_repository_by_name_owner( convert_repository_name, common.test_user_1_name ) installed_column_repository = test_db_util.get_installed_repository_by_name_owner( column_repository_name, @@ -185,8 +233,8 @@ 'Deactivated' ] self.display_installed_repository_manage_page( installed_column_repository, strings_displayed=strings_displayed ) - def test_0040_reactivate_convert_repository( self ): - '''Activate convert_chars - this should display both convert_chars and column_maker as installed with a green box''' + def test_0055_reactivate_convert_repository( self ): + '''Activate convert_chars. Both convert_chars and column_maker should now show as installed.''' installed_convert_repository = test_db_util.get_installed_repository_by_name_owner( convert_repository_name, common.test_user_1_name ) installed_column_repository = test_db_util.get_installed_repository_by_name_owner( column_repository_name, @@ -210,8 +258,8 @@ 'Installed repository dependencies' ] self.display_installed_repository_manage_page( installed_convert_repository, strings_displayed=strings_displayed ) - def test_0045_uninstall_column_repository( self ): - '''Uninstall column_maker - this should display convert_chars installed but missing repository dependencies''' + def test_0060_uninstall_column_repository( self ): + '''Uninstall column_maker. Verify that convert_chars is installed and missing repository dependencies, and column_maker was in the right tool panel section.''' installed_convert_repository = test_db_util.get_installed_repository_by_name_owner( convert_repository_name, common.test_user_1_name ) installed_column_repository = test_db_util.get_installed_repository_by_name_owner( column_repository_name, @@ -227,7 +275,8 @@ 'Uninstalled' ] self.display_installed_repository_manage_page( installed_convert_repository, strings_displayed=strings_displayed ) - def test_0050_reinstall_column_repository( self ): + self.check_galaxy_repository_tool_panel_section( installed_column_repository, 'column_maker' ) + def test_0065_reinstall_column_repository( self ): '''Reinstall column_maker without repository dependencies, verify both convert_chars and column_maker are installed.''' installed_convert_repository = test_db_util.get_installed_repository_by_name_owner( convert_repository_name, common.test_user_1_name ) @@ -252,8 +301,8 @@ 'Installed repository dependencies' ] self.display_installed_repository_manage_page( installed_convert_repository, strings_displayed=strings_displayed ) - def test_0055_uninstall_convert_repository( self ): - '''Uninstall convert_chars, verify column_maker installed but missing repository dependencies''' + def test_0070_uninstall_convert_repository( self ): + '''Uninstall convert_chars, verify column_maker installed but missing repository dependencies.''' installed_convert_repository = test_db_util.get_installed_repository_by_name_owner( convert_repository_name, common.test_user_1_name ) installed_column_repository = test_db_util.get_installed_repository_by_name_owner( column_repository_name, @@ -269,8 +318,9 @@ 'Uninstalled' ] self.display_installed_repository_manage_page( installed_column_repository, strings_displayed=strings_displayed ) - def test_0060_uninstall_column_repository( self ): - '''Uninstall column_maker - both convert_chars and column_maker are uninstalled''' + self.check_galaxy_repository_tool_panel_section( installed_convert_repository, 'convert_chars' ) + def test_0075_uninstall_column_repository( self ): + '''Uninstall column_maker, verify that both convert_chars and column_maker are uninstalled.''' installed_convert_repository = test_db_util.get_installed_repository_by_name_owner( convert_repository_name, common.test_user_1_name ) installed_column_repository = test_db_util.get_installed_repository_by_name_owner( column_repository_name, @@ -287,13 +337,16 @@ 'Uninstalled' ] self.display_installed_repository_manage_page( installed_convert_repository, strings_displayed=strings_displayed ) - def test_0065_reinstall_convert_repository( self ): - '''Reinstall convert_chars and check the handle repository dependencies check box - this should install both convert_chars and column_maker ( make sure )''' + def test_0080_reinstall_convert_repository( self ): + '''Reinstall convert_chars with repository dependencies, verify that this installs both convert_chars and column_maker.''' installed_convert_repository = test_db_util.get_installed_repository_by_name_owner( convert_repository_name, common.test_user_1_name ) installed_column_repository = test_db_util.get_installed_repository_by_name_owner( column_repository_name, common.test_user_1_name ) - self.reinstall_repository( installed_convert_repository, install_repository_dependencies=True ) + self.reinstall_repository( installed_convert_repository, + install_repository_dependencies=True, + no_changes=False, + new_tool_panel_section='convert_maker' ) strings_displayed = [ installed_column_repository.name, installed_column_repository.description, installed_column_repository.tool_shed, @@ -312,3 +365,16 @@ 'Installed repository dependencies' ] self.display_installed_repository_manage_page( installed_convert_repository, strings_displayed=strings_displayed ) + def test_0085_uninstall_all_repositories( self ): + '''Uninstall convert_chars and column_maker to verify that they are in the right tool panel sections.''' + installed_convert_repository = test_db_util.get_installed_repository_by_name_owner( convert_repository_name, + common.test_user_1_name ) + installed_column_repository = test_db_util.get_installed_repository_by_name_owner( column_repository_name, + common.test_user_1_name ) + self.uninstall_repository( installed_column_repository, remove_from_disk=True ) + self.uninstall_repository( installed_convert_repository, remove_from_disk=True ) + test_db_util.ga_refresh( installed_column_repository ) + test_db_util.ga_refresh( installed_convert_repository ) + self.check_galaxy_repository_tool_panel_section( installed_column_repository, 'convert_maker' ) + self.check_galaxy_repository_tool_panel_section( installed_convert_repository, 'convert_maker' ) + diff -r 0b2c782ca2d7a62f6a4e0781c8b729225806b442 -r 6ef9b038e329b6ee4e71ef1d1b1a22b9b2000ca1 test/tool_shed/functional/test_1085_repository_dependency_handling.py --- /dev/null +++ b/test/tool_shed/functional/test_1085_repository_dependency_handling.py @@ -0,0 +1,176 @@ +from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os, logging +import tool_shed.base.test_db_util as test_db_util + +column_repository_name = 'column_maker_1085' +column_repository_description = "Add column" +column_repository_long_description = "Compute an expression on every row" + +convert_repository_name = 'convert_chars_1085' +convert_repository_description = "Convert delimiters" +convert_repository_long_description = "Convert delimiters to tab" + +category_name = 'Test 1085 Advanced Circular Dependencies' +category_description = 'Test circular dependency features' + +log = logging.getLogger( __name__ ) + +class TestRepositoryDependencies( 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_create_and_populate_column_repository( self ): + """Create a category for this test suite and add repositories to it.""" + category = self.create_category( name=category_name, description=category_description ) + self.logout() + self.login( email=common.test_user_1_email, username=common.test_user_1_name ) + repository = self.get_or_create_repository( name=column_repository_name, + description=column_repository_description, + long_description=column_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, + 'column_maker/column_maker.tar', + strings_displayed=[], + commit_message='Uploaded column_maker.tar.' ) + def test_0010_create_and_populate_convert_repository( self ): + self.logout() + self.login( email=common.admin_email, username=common.admin_username ) + category = self.create_category( name=category_name, description=category_description ) + self.logout() + self.login( email=common.test_user_1_email, username=common.test_user_1_name ) + repository = self.get_or_create_repository( name=convert_repository_name, + description=convert_repository_description, + long_description=convert_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, + 'convert_chars/convert_chars.tar', + strings_displayed=[], + commit_message='Uploaded convert_chars.tar.' ) + def test_0015_create_and_upload_dependency_files( self ): + convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) + column_repository = test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name ) + repository_dependencies_path = self.generate_temp_path( 'test_1085', additional_paths=[ 'column' ] ) + self.generate_repository_dependency_xml( [ convert_repository ], + self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), + dependency_description='Column maker depends on the convert_chars repository.' ) + self.upload_file( column_repository, + 'repository_dependencies.xml', + filepath=repository_dependencies_path, + commit_message='Uploaded dependency on convert' ) + convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) + column_repository = test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name ) + repository_dependencies_path = self.generate_temp_path( 'test_1085', additional_paths=[ 'convert' ] ) + self.generate_repository_dependency_xml( [ column_repository ], + self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), + dependency_description='Convert chars depends on the column_maker repository.' ) + self.upload_file( convert_repository, + 'repository_dependencies.xml', + filepath=repository_dependencies_path, + commit_message='Uploaded dependency on column' ) + def test_0020_install_repositories( self ): + '''Install column_maker into column_maker tool panel section and install repository dependencies.''' + self.galaxy_logout() + self.galaxy_login( email=common.admin_email, username=common.admin_username ) + self.install_repository( column_repository_name, + common.test_user_1_name, + category_name, + install_tool_dependencies=False, + install_repository_dependencies=True, + new_tool_panel_section='column_maker', + strings_displayed=[ 'install_repository_dependencies' ] ) + installed_convert_repository = test_db_util.get_installed_repository_by_name_owner( convert_repository_name, + common.test_user_1_name ) + installed_column_repository = test_db_util.get_installed_repository_by_name_owner( column_repository_name, + common.test_user_1_name ) + browse_strings_displayed = [ installed_convert_repository.name, + installed_convert_repository.description, + installed_convert_repository.tool_shed, + installed_convert_repository.installed_changeset_revision, + installed_column_repository.name, + installed_column_repository.description, + installed_column_repository.installed_changeset_revision ] + strings_displayed = [ installed_convert_repository.name, + installed_convert_repository.description, + installed_convert_repository.tool_shed, + installed_convert_repository.installed_changeset_revision, + installed_column_repository.name, + installed_column_repository.installed_changeset_revision, + 'Installed repository dependencies' ] + self.display_galaxy_browse_repositories_page( strings_displayed=browse_strings_displayed ) + self.display_installed_repository_manage_page( installed_convert_repository, + strings_displayed=strings_displayed ) + def test_0025_uninstall_column_repository( self ): + '''uninstall column_maker, verify same section''' + installed_column_repository = test_db_util.get_installed_repository_by_name_owner( column_repository_name, + common.test_user_1_name ) + self.uninstall_repository( installed_column_repository, remove_from_disk=True ) + test_db_util.ga_refresh( installed_column_repository ) + self.check_galaxy_repository_tool_panel_section( installed_column_repository, 'column_maker' ) + def test_0030_uninstall_convert_repository( self ): + installed_convert_repository = test_db_util.get_installed_repository_by_name_owner( convert_repository_name, + common.test_user_1_name ) + self.uninstall_repository( installed_convert_repository, remove_from_disk=True ) + test_db_util.ga_refresh( installed_convert_repository ) + self.check_galaxy_repository_tool_panel_section( installed_convert_repository, 'column_maker' ) + def test_0035_reinstall_column_repository( self ): + '''reinstall column_maker into new section 'new_column_maker' (no_changes = false), no dependencies''' + installed_column_repository = test_db_util.get_installed_repository_by_name_owner( column_repository_name, + common.test_user_1_name ) + self.reinstall_repository( installed_column_repository, + install_tool_dependencies=False, + install_repository_dependencies=False, + new_tool_panel_section='new_column_maker', + no_changes=False ) + strings_displayed = [ installed_column_repository.name, + installed_column_repository.description, + installed_column_repository.tool_shed, + installed_column_repository.installed_changeset_revision ] + self.display_installed_repository_manage_page( installed_column_repository, + strings_displayed=strings_displayed ) + def test_0040_reinstall_convert_repository( self ): + '''reinstall convert_chars into new section 'new_convert_chars' (no_changes = false), no dependencies''' + installed_convert_repository = test_db_util.get_installed_repository_by_name_owner( convert_repository_name, + common.test_user_1_name ) + self.reinstall_repository( installed_convert_repository, + install_tool_dependencies=False, + install_repository_dependencies=False, + new_tool_panel_section='new_convert_chars', + no_changes=False ) + strings_displayed = [ installed_convert_repository.name, + installed_convert_repository.description, + installed_convert_repository.tool_shed, + installed_convert_repository.installed_changeset_revision ] + self.display_installed_repository_manage_page( installed_convert_repository, + strings_displayed=strings_displayed ) + def test_0045_uninstall_and_verify_tool_panel_sections( self ): + '''uninstall both and verify tool panel sections''' + installed_convert_repository = test_db_util.get_installed_repository_by_name_owner( convert_repository_name, + common.test_user_1_name ) + installed_column_repository = test_db_util.get_installed_repository_by_name_owner( column_repository_name, + common.test_user_1_name ) + self.uninstall_repository( installed_column_repository, remove_from_disk=True ) + self.uninstall_repository( installed_convert_repository, remove_from_disk=True ) + test_db_util.ga_refresh( installed_convert_repository ) + test_db_util.ga_refresh( installed_column_repository ) + self.check_galaxy_repository_tool_panel_section( installed_column_repository, 'new_column_maker' ) + self.check_galaxy_repository_tool_panel_section( installed_convert_repository, 'new_convert_chars' ) diff -r 0b2c782ca2d7a62f6a4e0781c8b729225806b442 -r 6ef9b038e329b6ee4e71ef1d1b1a22b9b2000ca1 test/tool_shed/functional_tests.py --- a/test/tool_shed/functional_tests.py +++ b/test/tool_shed/functional_tests.py @@ -60,6 +60,7 @@ tool_sheds_conf_xml_template = '''<?xml version="1.0"?><tool_sheds><tool_shed name="Embedded tool shed for functional tests" url="http://${shed_url}:${shed_port}/"/> + <tool_shed name="Galaxy main tool shed" url="http://toolshed.g2.bx.psu.edu/"/></tool_sheds> ''' @@ -123,7 +124,7 @@ galaxy_tool_data_table_conf_file = os.environ.get( 'GALAXY_TEST_TOOL_DATA_TABLE_CONF', os.path.join( tool_shed_test_tmp_dir, 'tool_data_table_conf.xml' ) ) galaxy_tool_conf_file = os.environ.get( 'GALAXY_TEST_TOOL_CONF', os.path.join( tool_shed_test_tmp_dir, 'test_tool_conf.xml' ) ) galaxy_shed_tool_conf_file = os.environ.get( 'GALAXY_TEST_SHED_TOOL_CONF', os.path.join( tool_shed_test_tmp_dir, 'test_shed_tool_conf.xml' ) ) - galaxy_tool_sheds_conf_file = os.environ.get( 'GALAXY_TEST_SHED_TOOLS_CONF', os.path.join( tool_shed_test_tmp_dir, 'test_sheds_conf.xml' ) ) + galaxy_tool_sheds_conf_file = os.environ.get( 'GALAXY_TEST_TOOL_SHEDS_CONF', os.path.join( tool_shed_test_tmp_dir, 'test_sheds_conf.xml' ) ) if 'GALAXY_TEST_TOOL_DATA_PATH' in os.environ: tool_data_path = os.environ.get( 'GALAXY_TEST_TOOL_DATA_PATH' ) else: 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.