1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/b00822d6733f/ changeset: b00822d6733f user: inithello date: 2012-12-13 21:14:51 summary: Functional tests for installing tool shed repositories. affected #: 14 files diff -r 34f61e53a563e4b2b44b45b94aff8ed2d1e17738 -r b00822d6733f9a4fa93dac20a67d63e56fcc51be test/tool_shed/base/common.py --- a/test/tool_shed/base/common.py +++ b/test/tool_shed/base/common.py @@ -14,4 +14,7 @@ </repositories> ''' -new_repository_dependencies_line = ''' <repository toolshed="${toolshed_url}" name="${repository_name}" owner="${owner}" changeset_revision="${changeset_revision}" />''' \ No newline at end of file +new_repository_dependencies_line = ''' <repository toolshed="${toolshed_url}" name="${repository_name}" owner="${owner}" changeset_revision="${changeset_revision}" />''' + +# Set a 3 minute timeout for repository installation. This should be sufficient, since we're not installing tool dependencies. +repository_installation_timeout = 180 \ No newline at end of file diff -r 34f61e53a563e4b2b44b45b94aff8ed2d1e17738 -r b00822d6733f9a4fa93dac20a67d63e56fcc51be 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 @@ -32,6 +32,11 @@ galaxy.model.ToolShedRepository.table.c.owner == owner, galaxy.model.ToolShedRepository.table.c.changeset_revision == changeset_revision ) ) \ .first() +def get_installed_repository_by_name_owner( repository_name, owner ): + return ga_session.query( galaxy.model.ToolShedRepository ) \ + .filter( and_( galaxy.model.ToolShedRepository.table.c.name == repository_name, + galaxy.model.ToolShedRepository.table.c.owner == owner ) ) \ + .first() def get_private_role( user ): for role in user.all_roles(): if role.name == user.email and role.description == 'Private Role for %s' % user.email: diff -r 34f61e53a563e4b2b44b45b94aff8ed2d1e17738 -r b00822d6733f9a4fa93dac20a67d63e56fcc51be test/tool_shed/base/twilltestcase.py --- a/test/tool_shed/base/twilltestcase.py +++ b/test/tool_shed/base/twilltestcase.py @@ -1,9 +1,9 @@ import galaxy.webapps.community.util.hgweb_config import galaxy.model as galaxy_model import common, string, os, re -from base.twilltestcase import tc, from_json_string, TwillTestCase, security +from base.twilltestcase import tc, from_json_string, TwillTestCase, security, urllib from test_db_util import get_repository_by_name_and_owner, get_repository_metadata_by_repository_id_changeset_revision, \ - get_galaxy_repository_by_name_owner_changeset_revision + get_galaxy_repository_by_name_owner_changeset_revision, get_installed_repository_by_name_owner from galaxy import eggs eggs.require('mercurial') @@ -53,6 +53,19 @@ 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_installed_repository_tool_dependencies( self, installed_repository, dependencies_installed=False ): + strings_not_displayed = [] + strings_displayed = [] + 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' ] ] ) + 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 ) def check_repository_changelog( self, repository, strings_displayed=[], strings_not_displayed=[] ): url = '/repository/view_changelog?id=%s' % self.security.encode_id( repository.id ) self.visit_url( url ) @@ -180,6 +193,15 @@ 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_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 ) + 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 display_manage_repository_page( self, repository, changeset_revision=None, strings_displayed=[], strings_not_displayed=[] ): base_url = '/repository/manage_repository?id=%s' % self.security.encode_id( repository.id ) if changeset_revision is not None: @@ -359,7 +381,7 @@ 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, changeset_revision=None, strings_displayed=[], strings_not_displayed=[] ): + def install_repository( self, name, owner, install_tool_dependencies=False, changeset_revision=None, strings_displayed=[], strings_not_displayed=[] ): repository = get_repository_by_name_and_owner( name, owner ) repository_id = self.security.encode_id( repository.id ) if changeset_revision is None: @@ -368,6 +390,11 @@ ( changeset_revision, repository_id, self.galaxy_url ) self.visit_url( url ) self.check_for_strings( strings_displayed, strings_not_displayed ) + if 'install_tool_dependencies' in self.last_page(): + if install_tool_dependencies: + tc.fv( '1', 'install_tool_dependencies', True ) + else: + tc.fv( '1', 'install_tool_dependencies', 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 @@ -381,7 +408,7 @@ 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.wait_for_repository_installation( repository ) + 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' % \ ( self.security.encode_id( repository.id ), tool_xml, changeset_revision ) @@ -446,18 +473,42 @@ tc.formfile( "1", "file_data", self.get_filename( filename, filepath ) ) tc.submit( "upload_button" ) self.check_for_strings( strings_displayed, strings_not_displayed ) + 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_tool_metadata_for_installed_repository( self, installed_repository, strings_displayed=[], strings_not_displayed=[] ): + repository_id = self.security.encode_id( installed_repository.id ) + for tool in installed_repository.metadata[ 'tools' ]: + strings = list( strings_displayed ) + strings.extend( [ tool[ 'id' ], tool[ 'description' ], tool[ 'version' ], tool[ 'guid' ], tool[ 'name' ] ] ) + url = '/admin_toolshed/view_tool_metadata?repository_id=%s&tool_id=%s' % ( repository_id, urllib.quote_plus( tool[ 'id' ] ) ) + self.visit_galaxy_url( url ) + self.check_for_strings( strings, strings_not_displayed ) def visit_galaxy_url( self, url ): url = '%s%s' % ( self.galaxy_url, url ) self.visit_url( url ) - def wait_for_repository_installation( self, repository ): + def wait_for_repository_installation( self, repository, changeset_revision ): final_states = [ galaxy_model.ToolShedRepository.installation_status.ERROR, galaxy_model.ToolShedRepository.installation_status.INSTALLED, galaxy_model.ToolShedRepository.installation_status.UNINSTALLED, galaxy_model.ToolShedRepository.installation_status.DEACTIVATED ] repository_name = repository.name owner = repository.user.username - changeset_revision = self.get_repository_tip( repository ) + if changeset_revision is None: + changeset_revision = self.get_repository_tip( repository ) galaxy_repository = get_galaxy_repository_by_name_owner_changeset_revision( repository_name, owner, changeset_revision ) + timeout_counter = 0 while galaxy_repository.status not in final_states: ga_refresh( galaxy_repository ) + timeout_counter = timeout_counter + 1 + if timeout_counter > common.repository_installation_timeout: + raise AssertionError( 'Repository installation timed out, %d seconds elapsed, repository state is %s.' % \ + ( timeout_counter, repository.status ) ) + break time.sleep( 1 ) diff -r 34f61e53a563e4b2b44b45b94aff8ed2d1e17738 -r b00822d6733f9a4fa93dac20a67d63e56fcc51be test/tool_shed/functional/test_0000_basic_repository_features.py --- a/test/tool_shed/functional/test_0000_basic_repository_features.py +++ b/test/tool_shed/functional/test_0000_basic_repository_features.py @@ -1,5 +1,5 @@ from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os -from tool_shed.base.test_db_util import get_repository_by_name_and_owner, get_user, get_private_role +import tool_shed.base.test_db_util as test_db_util repository_name = 'filtering_0000' repository_description = "Galaxy's filtering tool" @@ -10,14 +10,14 @@ def test_0000_initiate_users( self ): """Create necessary user accounts and login as an admin user.""" self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - test_user_1 = get_user( common.test_user_1_email ) + 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 = get_private_role( test_user_1 ) + 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 = get_user( common.admin_email ) + 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 = get_private_role( admin_user ) + admin_user_private_role = test_db_util.get_private_role( admin_user ) def test_0005_create_categories( self ): """Create categories for this test suite""" self.create_category( 'Test 0000 Basic Repository Features 1', 'Test 0000 Basic Repository Features 1' ) @@ -26,9 +26,9 @@ """Create the filtering repository""" self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - test_user_1 = get_user( common.test_user_1_email ) + 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 = get_private_role( test_user_1 ) + test_user_1_private_role = test_db_util.get_private_role( test_user_1 ) strings_displayed = [ 'Repository %s' % "'%s'" % repository_name, 'Repository %s has been created' % "'%s'" % repository_name ] self.create_repository( repository_name, @@ -38,29 +38,29 @@ strings_displayed=strings_displayed ) def test_0015_edit_repository( self ): """Edit the repository name, description, and long description""" - repository = get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) new_name = "renamed_filtering" new_description = "Edited filtering tool" new_long_description = "Edited long description" self.edit_repository_information( repository, repo_name=new_name, description=new_description, long_description=new_long_description ) def test_0020_change_repository_category( self ): """Change the categories associated with the filtering repository""" - repository = get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.edit_repository_categories( repository, categories_to_add=[ "Test 0000 Basic Repository Features 2" ], categories_to_remove=[ "Test 0000 Basic Repository Features 1" ] ) def test_0025_grant_write_access( self ): '''Grant write access to another user''' - repository = get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.grant_write_access( repository, usernames=[ common.admin_username ] ) self.revoke_write_access( repository, common.admin_username ) def test_0030_upload_filtering_1_1_0( self ): """Upload filtering_1.1.0.tar to the repository""" - repository = get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.upload_file( repository, 'filtering/filtering_1.1.0.tar', commit_message="Uploaded filtering 1.1.0" ) def test_0035_verify_repository( self ): '''Display basic repository pages''' - repository = get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) latest_changeset_revision = self.get_repository_tip( repository ) self.check_for_valid_tools( repository, strings_displayed=[ 'Filter1' ] ) self.check_count_of_metadata_revisions_associated_with_repository( repository, metadata_count=1 ) @@ -73,7 +73,7 @@ strings_displayed=[ 'Uploaded filtering 1.1.0', latest_changeset_revision ] ) def test_0040_alter_repository_states( self ): '''Test toggling the malicious and deprecated repository flags.''' - repository = get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.logout() self.login( email=common.admin_email, username=common.admin_username ) self.set_repository_malicious( repository, set_malicious=True, strings_displayed=[ 'The repository tip has been defined as malicious.' ] ) @@ -93,7 +93,7 @@ set_deprecated=False ) def test_0045_display_repository_tip_file( self ): '''Display the contents of filtering.xml in the repository tip revision''' - repository = get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.display_repository_file_contents( repository=repository, filename='filtering.xml', filepath=None, @@ -101,7 +101,7 @@ strings_not_displayed=[] ) def test_0050_upload_filtering_txt_file( self ): '''Upload filtering.txt file associated with tool version 1.1.0.''' - repository = get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.upload_file( repository, 'filtering/filtering_0000.txt', commit_message="Uploaded filtering.txt", @@ -110,7 +110,7 @@ self.display_manage_repository_page( repository, strings_displayed=[ 'Readme file for filtering 1.1.0' ] ) def test_0055_upload_filtering_test_data( self ): '''Upload filtering test data.''' - repository = get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.upload_file( repository, 'filtering/filtering_test_data.tar', commit_message="Uploaded filtering test data", remove_repo_files_not_in_tar='No' ) self.display_repository_file_contents( repository=repository, filename='1.bed', @@ -120,14 +120,14 @@ self.check_repository_metadata( repository, tip_only=True ) def test_0060_upload_filtering_2_2_0( self ): '''Upload filtering version 2.2.0''' - repository = get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.upload_file( repository, 'filtering/filtering_2.2.0.tar', commit_message="Uploaded filtering 2.2.0", remove_repo_files_not_in_tar='No' ) def test_0065_verify_filtering_repository( self ): '''Verify the new tool versions and repository metadata.''' - repository = get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) tip = self.get_repository_tip( repository ) self.check_for_valid_tools( repository ) strings_displayed = self.get_repository_metadata_revisions( repository ).append( 'Select a revision' ) @@ -137,7 +137,7 @@ self.check_repository_metadata( repository, tip_only=False ) def test_0070_upload_readme_txt_file( self ): '''Upload readme.txt file associated with tool version 2.2.0.''' - repository = get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.upload_file( repository, 'readme.txt', commit_message="Uploaded readme.txt" ) self.display_manage_repository_page( repository, strings_displayed=[ 'This is a readme file.' ] ) # Verify that there is a different readme file for each metadata revision. @@ -145,13 +145,13 @@ self.display_manage_repository_page( repository, strings_displayed=[ 'Readme file for filtering 1.1.0', 'This is a readme file.' ] ) def test_0075_delete_readme_txt_file( self ): '''Delete the readme.txt file.''' - repository = get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.delete_files_from_repository( repository, filenames=[ 'readme.txt' ] ) self.check_count_of_metadata_revisions_associated_with_repository( repository, metadata_count=2 ) self.display_manage_repository_page( repository, strings_displayed=[ 'Readme file for filtering 1.1.0' ] ) def test_0080_search_for_valid_filter_tool( self ): '''Search for the filtering tool by tool ID, name, and version.''' - repository = get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) tip_changeset = self.get_repository_tip( repository ) search_fields = dict( tool_id='Filter1', tool_name='filter', tool_version='2.2.0' ) self.search_for_valid_tools( search_fields=search_fields, strings_displayed=[ tip_changeset ], strings_not_displayed=[] ) diff -r 34f61e53a563e4b2b44b45b94aff8ed2d1e17738 -r b00822d6733f9a4fa93dac20a67d63e56fcc51be test/tool_shed/functional/test_0010_repository_with_tool_dependencies.py --- a/test/tool_shed/functional/test_0010_repository_with_tool_dependencies.py +++ b/test/tool_shed/functional/test_0010_repository_with_tool_dependencies.py @@ -1,5 +1,5 @@ from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os -from tool_shed.base.test_db_util import get_repository_by_name_and_owner, get_user, get_private_role +import tool_shed.base.test_db_util as test_db_util repository_name = 'freebayes_0010' repository_description = "Galaxy's freebayes tool" @@ -11,14 +11,14 @@ """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 = get_user( common.test_user_1_email ) + 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 = get_private_role( test_user_1 ) + 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 = get_user( common.admin_email ) + 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 = get_private_role( admin_user ) + admin_user_private_role = test_db_util.get_private_role( admin_user ) def test_0005_create_category( self ): """Create a category for this test suite""" self.create_category( 'Test 0010 Repository With Tool Dependencies', 'Tests for a repository with tool dependencies.' ) @@ -31,7 +31,7 @@ repository_long_description=repository_long_description, categories=[ 'Test 0010 Repository With Tool Dependencies' ], strings_displayed=[] ) - repository = get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.upload_file( repository, 'freebayes/freebayes.xml', valid_tools_only=False, @@ -44,7 +44,7 @@ strings_displayed=[ 'requires an entry', 'tool_data_table_conf.xml' ] ) def test_0015_upload_missing_tool_data_table_conf_file( self ): '''Upload the missing tool_data_table_conf.xml.sample file to the repository.''' - repository = get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.upload_file( repository, 'freebayes/tool_data_table_conf.xml.sample', valid_tools_only=False, @@ -57,27 +57,27 @@ strings_displayed=[ 'refers to a file', 'sam_fa_indices.loc' ] ) def test_0020_upload_missing_sample_loc_file( self ): '''Upload the missing sam_fa_indices.loc.sample file to the repository.''' - repository = get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.upload_file( repository, 'freebayes/sam_fa_indices.loc.sample', strings_displayed=[], commit_message='Uploaded tool data table .loc file.' ) def test_0025_upload_invalid_tool_dependency_xml( self ): '''Upload tool_dependencies.xml defining version 0.9.5 of the freebayes package.''' - repository = get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.upload_file( repository, os.path.join( 'freebayes', 'invalid_tool_dependencies', 'tool_dependencies.xml' ), strings_displayed=[ 'Name, version and type from a tool requirement tag does not match' ], commit_message='Uploaded invalid tool dependency XML.' ) def test_0030_upload_valid_tool_dependency_xml( self ): '''Upload tool_dependencies.xml defining version 0.9.4_9696d0ce8a962f7bb61c4791be5ce44312b81cf8 of the freebayes package.''' - repository = get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.upload_file( repository, os.path.join( 'freebayes', 'tool_dependencies.xml' ), commit_message='Uploaded valid tool dependency XML.' ) def test_0035_verify_tool_dependencies( self ): '''Verify that the uploaded tool_dependencies.xml specifies the correct package versions.''' - repository = get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) + repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.display_manage_repository_page( repository, strings_displayed=[ 'freebayes', '0.9.4_9696d0ce8a9', 'samtools', '0.1.18', 'Valid tools' ], strings_not_displayed=[ 'Invalid tools' ] ) diff -r 34f61e53a563e4b2b44b45b94aff8ed2d1e17738 -r b00822d6733f9a4fa93dac20a67d63e56fcc51be test/tool_shed/functional/test_0020_basic_repository_dependencies.py --- a/test/tool_shed/functional/test_0020_basic_repository_dependencies.py +++ b/test/tool_shed/functional/test_0020_basic_repository_dependencies.py @@ -1,5 +1,5 @@ from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os -from tool_shed.base.test_db_util import get_repository_by_name_and_owner, get_user, get_private_role +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." @@ -15,14 +15,14 @@ """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 = get_user( common.test_user_1_email ) + 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' % common.test_user_1_email - test_user_1_private_role = get_private_role( test_user_1 ) + 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 = get_user( common.admin_email ) + 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 = get_private_role( admin_user ) + admin_user_private_role = test_db_util.get_private_role( admin_user ) def test_0005_create_category( self ): """Create a category for this test suite""" self.create_category( 'Test 0020 Basic Repository Dependencies', 'Testing basic repository dependency features.' ) @@ -35,11 +35,11 @@ repository_long_description=datatypes_repository_long_description, categories=[ 'Test 0020 Basic Repository Dependencies' ], strings_displayed=[] ) - repository = get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) + repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) self.upload_file( repository, 'emboss/datatypes/datatypes_conf.xml', commit_message='Uploaded datatypes_conf.xml.' ) def test_0015_verify_datatypes_in_datatypes_repository( self ): '''Verify that the emboss_datatypes repository contains datatype entries.''' - repository = get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) + repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) self.display_manage_repository_page( repository, strings_displayed=[ 'Datatypes', 'equicktandem', 'hennig86', 'vectorstrip' ] ) def test_0020_create_emboss_5_repository_and_upload_files( self ): '''Create and populate the emboss_5_0020 repository.''' @@ -48,12 +48,12 @@ repository_long_description=emboss_repository_long_description, categories=[ 'Test 0020 Basic Repository Dependencies' ], strings_displayed=[] ) - repository = get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) self.upload_file( repository, 'emboss/emboss.tar', commit_message='Uploaded emboss_5.tar' ) def test_0025_generate_and_upload_repository_dependencies_xml( self ): '''Generate and upload the repository_dependencies.xml file''' - repository = get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) - datatypes_repository = get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) + repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + datatypes_repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) repository_dependencies_path = self.generate_temp_path( 'test_0020', additional_paths=[ 'emboss', '5' ] ) self.generate_repository_dependency_xml( [ datatypes_repository ], self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ) ) @@ -63,8 +63,8 @@ commit_message='Uploaded repository_dependencies.xml' ) def test_0030_verify_emboss_5_repository_dependency_on_emboss_datatypes( self ): '''Verify that the emboss_5 repository now depends on the emboss_datatypes repository with correct name, owner, and changeset revision.''' - repository = get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) - datatypes_repository = get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) + repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + datatypes_repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) changeset_revision = self.get_repository_tip( datatypes_repository ) strings_displayed = [ datatypes_repository_name, common.test_user_1_name, changeset_revision, 'Repository dependencies' ] self.display_manage_repository_page( repository, strings_displayed=strings_displayed ) diff -r 34f61e53a563e4b2b44b45b94aff8ed2d1e17738 -r b00822d6733f9a4fa93dac20a67d63e56fcc51be test/tool_shed/functional/test_0030_repository_dependency_revisions.py --- a/test/tool_shed/functional/test_0030_repository_dependency_revisions.py +++ b/test/tool_shed/functional/test_0030_repository_dependency_revisions.py @@ -1,5 +1,5 @@ from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os -from tool_shed.base.test_db_util import get_repository_by_name_and_owner, get_user, get_private_role +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." @@ -17,14 +17,14 @@ """Create necessary user accounts.""" self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - test_user_1 = get_user( common.test_user_1_email ) + 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 = get_private_role( test_user_1 ) + 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 = get_user( common.admin_email ) + 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 = get_private_role( admin_user ) + admin_user_private_role = test_db_util.get_private_role( admin_user ) def test_0005_create_category( self ): """Create a category for this test suite""" self.create_category( 'Test 0030 Repository Dependency Revisions', 'Testing repository dependencies by revision.' ) @@ -32,57 +32,57 @@ '''Create the emboss_5_0030, emboss_6_0030, emboss_datatypes_0030, and emboss_0030 repositories and populate the emboss_datatypes repository.''' self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - emboss_5_repository = get_repository_by_name_and_owner( emboss_5_repository_name, common.test_user_1_name ) + emboss_5_repository = test_db_util.get_repository_by_name_and_owner( emboss_5_repository_name, common.test_user_1_name ) if emboss_5_repository is None: self.create_repository( emboss_5_repository_name, emboss_repository_description, repository_long_description=emboss_repository_long_description, categories=[ 'Test 0030 Repository Dependency Revisions' ], strings_displayed=[] ) - emboss_5_repository = get_repository_by_name_and_owner( emboss_5_repository_name, common.test_user_1_name ) + emboss_5_repository = test_db_util.get_repository_by_name_and_owner( emboss_5_repository_name, common.test_user_1_name ) self.upload_file( emboss_5_repository, 'emboss/emboss.tar', commit_message='Uploaded tool tarball.' ) - emboss_6_repository = get_repository_by_name_and_owner( emboss_6_repository_name, common.test_user_1_name ) + emboss_6_repository = test_db_util.get_repository_by_name_and_owner( emboss_6_repository_name, common.test_user_1_name ) if emboss_6_repository is None: self.create_repository( emboss_6_repository_name, emboss_repository_description, repository_long_description=emboss_repository_long_description, categories=[ 'Test 0030 Repository Dependency Revisions' ], strings_displayed=[] ) - emboss_6_repository = get_repository_by_name_and_owner( emboss_6_repository_name, common.test_user_1_name ) + emboss_6_repository = test_db_util.get_repository_by_name_and_owner( emboss_6_repository_name, common.test_user_1_name ) self.upload_file( emboss_6_repository, 'emboss/emboss.tar', commit_message='Uploaded tool tarball..' ) - datatypes_repository = get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) + datatypes_repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) if datatypes_repository is None: self.create_repository( datatypes_repository_name, datatypes_repository_description, repository_long_description=datatypes_repository_long_description, categories=[ 'Test 0030 Repository Dependency Revisions' ], strings_displayed=[] ) - datatypes_repository = get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) + datatypes_repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) if self.repository_is_new( datatypes_repository ): self.upload_file( datatypes_repository, 'emboss/datatypes/datatypes_conf.xml', commit_message='Uploaded datatypes_conf.xml.' ) - emboss_repository = get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) if emboss_repository is None: self.create_repository( emboss_repository_name, emboss_repository_description, repository_long_description=emboss_repository_long_description, categories=[ 'Test 0030 Repository Dependency Revisions' ], strings_displayed=[] ) - emboss_repository = get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) - self.upload_file( emboss_5_repository, 'emboss/emboss.tar', commit_message='Uploaded tool tarball.' ) + emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + self.upload_file( emboss_repository, 'emboss/emboss.tar', commit_message='Uploaded tool tarball.' ) def test_0015_generate_repository_dependencies_for_emboss_5( self ): '''Generate a repository_dependencies.xml file specifying emboss_datatypes and upload it to the emboss_5 repository.''' - datatypes_repository = get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) + datatypes_repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) repository_dependencies_path = self.generate_temp_path( 'test_0030', additional_paths=[ 'emboss' ] ) self.generate_repository_dependency_xml( [ datatypes_repository ], self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ) ) - emboss_5_repository = get_repository_by_name_and_owner( emboss_5_repository_name, common.test_user_1_name ) + emboss_5_repository = test_db_util.get_repository_by_name_and_owner( emboss_5_repository_name, common.test_user_1_name ) self.upload_file( emboss_5_repository, 'repository_dependencies.xml', filepath=repository_dependencies_path, commit_message='Uploaded repository_depepndencies.xml.' ) def test_0020_generate_repository_dependencies_for_emboss_6( self ): '''Generate a repository_dependencies.xml file specifying emboss_datatypes and upload it to the emboss_6 repository.''' - emboss_6_repository = get_repository_by_name_and_owner( emboss_6_repository_name, common.test_user_1_name ) + emboss_6_repository = test_db_util.get_repository_by_name_and_owner( emboss_6_repository_name, common.test_user_1_name ) repository_dependencies_path = self.generate_temp_path( 'test_0030', additional_paths=[ 'emboss' ] ) self.upload_file( emboss_6_repository, 'repository_dependencies.xml', @@ -90,8 +90,8 @@ commit_message='Uploaded repository_depepndencies.xml.' ) def test_0025_generate_repository_dependency_on_emboss_5( self ): '''Create and upload repository_dependencies.xml for the emboss_5_0030 repository.''' - emboss_repository = get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) - emboss_5_repository = get_repository_by_name_and_owner( emboss_5_repository_name, common.test_user_1_name ) + emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + emboss_5_repository = test_db_util.get_repository_by_name_and_owner( emboss_5_repository_name, common.test_user_1_name ) repository_dependencies_path = self.generate_temp_path( 'test_0030', additional_paths=[ 'emboss', '5' ] ) self.generate_repository_dependency_xml( [ emboss_5_repository ], self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), @@ -102,8 +102,8 @@ commit_message='Uploaded dependency configuration specifying emboss_5' ) def test_0030_generate_repository_dependency_on_emboss_6( self ): '''Create and upload repository_dependencies.xml for the emboss_6_0030 repository.''' - emboss_repository = get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) - emboss_6_repository = get_repository_by_name_and_owner( emboss_6_repository_name, common.test_user_1_name ) + emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + emboss_6_repository = test_db_util.get_repository_by_name_and_owner( emboss_6_repository_name, common.test_user_1_name ) repository_dependencies_path = self.generate_temp_path( 'test_0030', additional_paths=[ 'emboss', '6' ] ) self.generate_repository_dependency_xml( [ emboss_6_repository ], self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), @@ -114,9 +114,9 @@ commit_message='Uploaded dependency configuration specifying emboss_6' ) def test_0035_verify_repository_dependency_revisions( self ): '''Verify that different metadata revisions of the emboss repository have different repository dependencies.''' - repository = get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) repository_metadata = [ ( metadata.metadata, metadata.changeset_revision ) for metadata in self.get_repository_metadata( repository ) ] - datatypes_repository = get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) + datatypes_repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) datatypes_tip = self.get_repository_tip( datatypes_repository ) # Iterate through all metadata revisions and check for repository dependencies. for metadata, changeset_revision in repository_metadata: diff -r 34f61e53a563e4b2b44b45b94aff8ed2d1e17738 -r b00822d6733f9a4fa93dac20a67d63e56fcc51be 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 @@ -1,5 +1,5 @@ from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os -from tool_shed.base.test_db_util import get_repository_by_name_and_owner, get_user, get_private_role +import tool_shed.base.test_db_util as test_db_util freebayes_repository_name = 'freebayes_0040' freebayes_repository_name_description = "Galaxy's freebayes tool" @@ -15,14 +15,14 @@ """Create necessary user accounts.""" self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - test_user_1 = get_user( common.test_user_1_email ) + 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 = get_private_role( test_user_1 ) + 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 = get_user( common.admin_email ) + 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 = get_private_role( admin_user ) + admin_user_private_role = test_db_util.get_private_role( admin_user ) def test_0005_create_category( self ): """Create a category for this test suite""" self.create_category( 'test_0040_repository_circular_dependencies', 'Testing handling of circular repository dependencies.' ) @@ -35,7 +35,7 @@ repository_long_description=freebayes_repository_name_long_description, categories=[ 'test_0040_repository_circular_dependencies' ], strings_displayed=[] ) - repository = get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) + repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) self.upload_file( repository, 'freebayes/freebayes.tar', strings_displayed=[], @@ -49,7 +49,7 @@ repository_long_description=filtering_repository_long_description, categories=[ 'test_0040_repository_circular_dependencies' ], strings_displayed=[] ) - repository = get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) + repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) self.upload_file( repository, 'filtering/filtering_1.1.0.tar', strings_displayed=[], @@ -60,8 +60,8 @@ # Filtering revision 0 -> freebayes revision 0. # Freebayes revision 0 -> filtering revision 1. # Filtering will have two revisions, one with just the filtering tool, and one with the filtering tool and a dependency on freebayes. - repository = get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) - filtering_repository = get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) + repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) + filtering_repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) repository_dependencies_path = self.generate_temp_path( 'test_0040', additional_paths=[ 'filtering' ] ) self.generate_repository_dependency_xml( [ repository ], self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), @@ -76,8 +76,8 @@ # Filtering revision 0 -> freebayes revision 0. # Freebayes revision 0 -> filtering revision 1. # Filtering will have two revisions, one with just the filtering tool, and one with the filtering tool and a dependency on freebayes. - repository = get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) - freebayes_repository = get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) + repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) + freebayes_repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) repository_dependencies_path = self.generate_temp_path( 'test_0040', additional_paths=[ 'freebayes' ] ) self.generate_repository_dependency_xml( [ repository ], self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), @@ -88,8 +88,8 @@ commit_message='Uploaded dependency on filtering' ) def test_0030_verify_repository_dependencies( self ): '''Verify that each repository can depend on the other without causing an infinite loop.''' - filtering_repository = get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) - freebayes_repository = get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) + filtering_repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) + freebayes_repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) # The dependency structure should look like: # Filtering revision 0 -> freebayes revision 0. # Freebayes revision 0 -> filtering revision 1. diff -r 34f61e53a563e4b2b44b45b94aff8ed2d1e17738 -r b00822d6733f9a4fa93dac20a67d63e56fcc51be test/tool_shed/functional/test_0050_circular_n_levels.py --- a/test/tool_shed/functional/test_0050_circular_n_levels.py +++ b/test/tool_shed/functional/test_0050_circular_n_levels.py @@ -1,5 +1,5 @@ from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os -from tool_shed.base.test_db_util import get_repository_by_name_and_owner, get_user, get_private_role +import tool_shed.base.test_db_util as test_db_util emboss_datatypes_repository_name = 'emboss_datatypes_0050' emboss_datatypes_repository_description = "Datatypes for emboss" @@ -26,14 +26,14 @@ """Create necessary user accounts.""" self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - test_user_1 = get_user( common.test_user_1_email ) + 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 = get_private_role( test_user_1 ) + 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 = get_user( common.admin_email ) + 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 = get_private_role( admin_user ) + admin_user_private_role = test_db_util.get_private_role( admin_user ) def test_0005_create_category( self ): """Create a category for this test suite""" self.create_category( default_category, default_category_description ) @@ -46,7 +46,7 @@ repository_long_description=emboss_datatypes_repository_long_description, categories=[ default_category ], strings_displayed=[] ) - repository = get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name ) + repository = test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name ) self.upload_file( repository, 'emboss/datatypes/datatypes_conf.xml', strings_displayed=[], @@ -58,12 +58,12 @@ repository_long_description=emboss_repository_long_description, categories=[ default_category ], strings_displayed=[] ) - repository = get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) self.upload_file( repository, 'emboss/emboss.tar', strings_displayed=[], commit_message='Uploaded tool tarball.' ) - datatypes_repository = get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name ) + datatypes_repository = test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name ) repository_dependencies_path = self.generate_temp_path( 'test_0050', additional_paths=[ 'emboss' ] ) self.generate_repository_dependency_xml( [ datatypes_repository ], self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), @@ -79,12 +79,12 @@ repository_long_description=filtering_repository_long_description, categories=[ default_category ], strings_displayed=[] ) - filtering_repository = get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) + filtering_repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) self.upload_file( filtering_repository, 'filtering/filtering_1.1.0.tar', strings_displayed=[], commit_message='Uploaded filtering.tar.' ) - emboss_repository = get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) repository_dependencies_path = self.generate_temp_path( 'test_0050', additional_paths=[ 'filtering' ] ) self.generate_repository_dependency_xml( [ emboss_repository ], self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), @@ -100,14 +100,14 @@ repository_long_description=freebayes_repository_long_description, categories=[ default_category ], strings_displayed=[] ) - repository = get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) + repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) self.upload_file( repository, 'freebayes/freebayes.tar', strings_displayed=[], commit_message='Uploaded freebayes.tar.' ) - emboss_datatypes_repository = get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name ) - emboss_repository = get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) - filtering_repository = get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) + emboss_datatypes_repository = test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name ) + emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + filtering_repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) repository_dependencies_path = self.generate_temp_path( 'test_0050', additional_paths=[ 'freebayes' ] ) self.generate_repository_dependency_xml( [ filtering_repository ], self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), @@ -138,10 +138,10 @@ id: 4 key: http://localhost:8634__ESEP__emboss_0050__ESEP__user1__ESEP__9f1503046640 ['http://localhost:8634', 'emboss_datatypes_0050', 'user1', '596029c334b1'] ''' - emboss_datatypes_repository = get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name ) - emboss_repository = get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) - filtering_repository = get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) - freebayes_repository = get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) + emboss_datatypes_repository = test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name ) + emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + filtering_repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) + freebayes_repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) for repository in [ emboss_datatypes_repository, emboss_repository, filtering_repository ]: self.check_repository_dependency( freebayes_repository, repository, self.get_repository_tip( repository ) ) for changeset_revision in self.get_repository_metadata_revisions( emboss_repository ): diff -r 34f61e53a563e4b2b44b45b94aff8ed2d1e17738 -r b00822d6733f9a4fa93dac20a67d63e56fcc51be test/tool_shed/functional/test_1000_install_basic_repository.py --- /dev/null +++ b/test/tool_shed/functional/test_1000_install_basic_repository.py @@ -0,0 +1,31 @@ +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.galaxy_logout() + self.galaxy_login( email=common.admin_email, username=common.admin_username ) + admin_user = test_db_util.get_galaxy_user( common.admin_email ) + assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email + admin_user_private_role = test_db_util.get_galaxy_private_role( admin_user ) + def test_0005_browse_tool_sheds( self ): + """Browse the available tool sheds in this Galaxy instance.""" + self.visit_galaxy_url( '/admin_toolshed/browse_tool_sheds' ) + self.check_page_for_string( 'Embedded tool shed for functional tests' ) + self.browse_tool_shed( url=self.url, strings_displayed=[ 'Test 0000 Basic Repository Features 1', 'Test 0000 Basic Repository Features 2' ] ) + def test_0010_browse_test_0000_category( self ): + '''Browse the category created in test 0000. It should contain the filtering_0000 repository also created in that test.''' + category = test_db_util.get_category_by_name( 'Test 0000 Basic Repository Features 1' ) + self.browse_category( category, strings_displayed=[ 'filtering_0000' ] ) + def test_0015_preview_filtering_repository( self ): + '''Load the preview page for the filtering_0000 repository in the tool shed.''' + self.preview_repository_in_tool_shed( 'filtering_0000', common.test_user_1_name, strings_displayed=[ 'filtering_0000', 'Valid tools' ] ) + def test_0020_install_filtering_repository( self ): + self.install_repository( 'filtering_0000', common.test_user_1_name ) + installed_repository = test_db_util.get_installed_repository_by_name_owner( 'filtering_0000', common.test_user_1_name ) + self.verify_installed_repository_on_browse_page( installed_repository ) + self.display_installed_repository_manage_page( installed_repository, + strings_displayed=[ 'Installed tool shed repository', 'Tools', 'Filter1' ] ) + self.verify_tool_metadata_for_installed_repository( installed_repository ) \ No newline at end of file diff -r 34f61e53a563e4b2b44b45b94aff8ed2d1e17738 -r b00822d6733f9a4fa93dac20a67d63e56fcc51be test/tool_shed/functional/test_1000_install_filtering_repository.py --- a/test/tool_shed/functional/test_1000_install_filtering_repository.py +++ /dev/null @@ -1,31 +0,0 @@ -from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os -from tool_shed.base.test_db_util import get_repository_by_name_and_owner, get_galaxy_user, get_galaxy_private_role, get_category_by_name - -class BasicToolShedFeatures( ShedTwillTestCase ): - '''Test installing a basic repository.''' - def test_0000_initiate_users( self ): - """Create necessary user accounts.""" - self.galaxy_logout() - self.galaxy_login( email=common.test_user_1_email, username=common.test_user_1_name ) - test_user_1 = get_galaxy_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 = get_galaxy_private_role( test_user_1 ) - self.galaxy_logout() - self.galaxy_login( email=common.admin_email, username=common.admin_username ) - admin_user = 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 = get_galaxy_private_role( admin_user ) - def test_0005_browse_tool_sheds( self ): - """Browse the available tool sheds in this Galaxy instance.""" - self.visit_galaxy_url( '/admin_toolshed/browse_tool_sheds' ) - self.check_page_for_string( 'Embedded tool shed for functional tests' ) - self.browse_tool_shed( url=self.url, strings_displayed=[ 'Test 0000 Basic Repository Features 1', 'Test 0000 Basic Repository Features 2' ] ) - def test_0010_browse_test_0000_category( self ): - '''Browse the category created in test 0000. It should contain the filtering_0000 repository also created in that test.''' - category = get_category_by_name( 'Test 0000 Basic Repository Features 1' ) - self.browse_category( category, strings_displayed=[ 'filtering_0000' ] ) - def test_0015_preview_filtering_repository( self ): - '''Load the preview page for the filtering_0000 repository in the tool shed.''' - self.preview_repository_in_tool_shed( 'filtering_0000', common.test_user_1_name, strings_displayed=[ 'filtering_0000', 'Valid tools' ] ) - def test_0020_install_filtering_repository( self ): - self.install_repository( 'filtering_0000', common.test_user_1_name ) diff -r 34f61e53a563e4b2b44b45b94aff8ed2d1e17738 -r b00822d6733f9a4fa93dac20a67d63e56fcc51be test/tool_shed/functional/test_1010_install_repository_with_tool_dependencies.py --- /dev/null +++ b/test/tool_shed/functional/test_1010_install_repository_with_tool_dependencies.py @@ -0,0 +1,27 @@ +from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os +import tool_shed.base.test_db_util as test_db_util + +class ToolWithToolDependencies( ShedTwillTestCase ): + '''Test installing 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 ) + def test_0005_browse_tool_shed( self ): + """Browse the available tool sheds in this Galaxy instance and preview the freebayes tool.""" + self.browse_tool_shed( url=self.url, strings_displayed=[ 'Test 0010 Repository With Tool Dependencies' ] ) + category = test_db_util.get_category_by_name( 'Test 0010 Repository With Tool Dependencies' ) + self.browse_category( category, strings_displayed=[ 'freebayes_0010' ] ) + self.preview_repository_in_tool_shed( 'freebayes_0010', common.test_user_1_name, strings_displayed=[ 'freebayes_0010', 'Valid tools' ] ) + def test_0015_install_freebayes_repository( self ): + '''Install the freebayes repository without installing tool dependencies.''' + self.install_repository( 'freebayes_0010', common.test_user_1_name, install_tool_dependencies=False ) + installed_repository = test_db_util.get_installed_repository_by_name_owner( 'freebayes_0010', common.test_user_1_name ) + self.verify_installed_repository_on_browse_page( installed_repository ) + self.display_installed_repository_manage_page( installed_repository, + strings_displayed=[ 'Installed tool shed repository', 'Tools', 'FreeBayes' ] ) + self.check_installed_repository_tool_dependencies( installed_repository, dependencies_installed=False ) + self.verify_tool_metadata_for_installed_repository( installed_repository ) diff -r 34f61e53a563e4b2b44b45b94aff8ed2d1e17738 -r b00822d6733f9a4fa93dac20a67d63e56fcc51be test/tool_shed/functional/test_1020_install_repository_with_repository_dependencies.py --- /dev/null +++ b/test/tool_shed/functional/test_1020_install_repository_with_repository_dependencies.py @@ -0,0 +1,27 @@ +from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os +import tool_shed.base.test_db_util as test_db_util + +class ToolWithRepositoryDependencies( ShedTwillTestCase ): + '''Test installing a repository with repository 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 ) + def test_0005_browse_tool_shed( self ): + """Browse the available tool sheds in this Galaxy instance and preview the emboss tool.""" + self.browse_tool_shed( url=self.url, strings_displayed=[ 'Test 0020 Basic Repository Dependencies' ] ) + category = test_db_util.get_category_by_name( 'Test 0020 Basic Repository Dependencies' ) + self.browse_category( category, strings_displayed=[ 'emboss_0020' ] ) + self.preview_repository_in_tool_shed( 'emboss_0020', common.test_user_1_name, strings_displayed=[ 'emboss_0020', 'Valid tools' ] ) + def test_0015_install_emboss_repository( self ): + '''Install the emboss repository without installing tool dependencies.''' + self.install_repository( 'emboss_0020', common.test_user_1_name, install_tool_dependencies=False ) + installed_repository = test_db_util.get_installed_repository_by_name_owner( 'emboss_0020', common.test_user_1_name ) + self.verify_installed_repository_on_browse_page( installed_repository ) + self.display_installed_repository_manage_page( installed_repository, + strings_displayed=[ 'Installed tool shed repository', 'Tools', 'antigenic' ] ) + self.check_installed_repository_tool_dependencies( installed_repository, dependencies_installed=False ) + self.verify_tool_metadata_for_installed_repository( installed_repository ) diff -r 34f61e53a563e4b2b44b45b94aff8ed2d1e17738 -r b00822d6733f9a4fa93dac20a67d63e56fcc51be test/tool_shed/functional/test_1030_install_repository_with_dependency_revisions.py --- /dev/null +++ b/test/tool_shed/functional/test_1030_install_repository_with_dependency_revisions.py @@ -0,0 +1,29 @@ +from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os +import tool_shed.base.test_db_util as test_db_util + +class RepositoryWithDependencyRevisions( ShedTwillTestCase ): + '''Test installing a repository with 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 ) + def test_0005_browse_tool_shed( self ): + """Browse the available tool sheds in this Galaxy instance and preview the emboss tool.""" + self.browse_tool_shed( url=self.url, strings_displayed=[ 'Test 0030 Repository Dependency Revisions' ] ) + category = test_db_util.get_category_by_name( 'Test 0030 Repository Dependency Revisions' ) + self.browse_category( category, strings_displayed=[ 'emboss_0030' ] ) + self.preview_repository_in_tool_shed( 'emboss_0030', common.test_user_1_name, strings_displayed=[ 'emboss_0030', 'Valid tools' ] ) + 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 ) + self.install_repository( 'emboss_0030', common.test_user_1_name, changeset_revision=revisions[1], install_tool_dependencies=False ) + installed_repository = test_db_util.get_installed_repository_by_name_owner( 'emboss_0030', common.test_user_1_name ) + self.verify_installed_repository_on_browse_page( installed_repository ) + self.display_installed_repository_manage_page( installed_repository, + strings_displayed=[ 'Installed tool shed repository', 'Tools', 'antigenic' ] ) + self.check_installed_repository_tool_dependencies( installed_repository, dependencies_installed=False ) + self.verify_tool_metadata_for_installed_repository( installed_repository ) 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.