commit/galaxy-central: inithello: Refactor repository dependency generation. Add functional tests for the recently introduced feature to determine installation order of dependencies.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/8d72c9adccf9/ Changeset: 8d72c9adccf9 User: inithello Date: 2013-04-19 21:59:09 Summary: Refactor repository dependency generation. Add functional tests for the recently introduced feature to determine installation order of dependencies. Affected #: 31 files diff -r 2c50935e70c8a483bcd09b358765408543a153fb -r 8d72c9adccf92f8a1971ec7d9b622de43cbd6f48 test/tool_shed/base/common.py --- a/test/tool_shed/base/common.py +++ b/test/tool_shed/base/common.py @@ -32,7 +32,7 @@ </repositories> ''' -new_repository_dependencies_line = ''' <repository toolshed="${toolshed_url}" name="${repository_name}" owner="${owner}" changeset_revision="${changeset_revision}" />''' +new_repository_dependencies_line = ''' <repository toolshed="${toolshed_url}" name="${repository_name}" owner="${owner}" changeset_revision="${changeset_revision}"${prior_installation_required} />''' # 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 2c50935e70c8a483bcd09b358765408543a153fb -r 8d72c9adccf92f8a1971ec7d9b622de43cbd6f48 test/tool_shed/base/twilltestcase.py --- a/test/tool_shed/base/twilltestcase.py +++ b/test/tool_shed/base/twilltestcase.py @@ -254,29 +254,37 @@ else: return '%s=%s' % ( field_name, field_value ) - def create_repository_complex_dependency( self, repository, xml_filename, depends_on={} ): - self.generate_repository_dependency_xml( depends_on[ 'repositories' ], - xml_filename, - complex=True, - package=depends_on[ 'package' ], - version=depends_on[ 'version' ] ) + def create_repository_dependency( self, + repository=None, + repository_tuples=[], + filepath=None, + prior_installation_required=False, + complex=False, + package=None, + version=None, + strings_displayed=[], + strings_not_displayed=[] ): + repository_names = [] + if complex: + filename = 'tool_dependencies.xml' + self.generate_complex_dependency_xml( filename=filename, filepath=filepath, repository_tuples=repository_tuples, package=package, version=version ) + else: + for toolshed_url, name, owner, changeset_revision in repository_tuples: + repository_names.append( name ) + dependency_description = '%s depends on %s.' % ( repository.name, ', '.join( repository_names ) ) + filename = 'repository_dependencies.xml' + self.generate_simple_dependency_xml( repository_tuples=repository_tuples, + filename=filename, + filepath=filepath, + dependency_description=dependency_description, + prior_installation_required=prior_installation_required ) self.upload_file( repository, - 'tool_dependencies.xml', - filepath=os.path.split( xml_filename )[0], - commit_message='Uploaded dependency on %s.' % ', '.join( repo.name for repo in depends_on[ 'repositories' ] ) ) - - def create_repository_dependency( self, repository=None, depends_on=[], filepath=None ): - dependency_description = '%s depends on %s.' % ( repository.name, ', '.join( repo.name for repo in depends_on ) ) - self.generate_repository_dependency_xml( depends_on, - self.get_filename( 'repository_dependencies.xml', filepath=filepath ), - dependency_description=dependency_description ) - self.upload_file( repository, - 'repository_dependencies.xml', + filename=filename, filepath=filepath, - valid_tools_only=True, + valid_tools_only=False, uncompress_file=False, remove_repo_files_not_in_tar=False, - commit_message='Uploaded dependency on %s.' % ', '.join( repo.name for repo in depends_on ), + commit_message='Uploaded dependency on %s.' % ', '.join( repository_names ), strings_displayed=[], strings_not_displayed=[] ) @@ -512,53 +520,55 @@ self.check_page_for_string( "You have been logged out" ) self.home() - def generate_invalid_dependency_xml( self, xml_filename, url, name, owner, changeset_revision, complex=True, package=None, version=None, description=None ): - file_path = os.path.split( xml_filename )[0] + def generate_complex_dependency_xml( self, filename, filepath, repository_tuples, package, version ): + file_path = os.path.join( filepath, filename ) dependency_entries = [] template = string.Template( common.new_repository_dependencies_line ) - dependency_entries.append( template.safe_substitute( toolshed_url=url, - owner=owner, - repository_name=name, - changeset_revision=changeset_revision ) ) - if not os.path.exists( file_path ): - os.makedirs( file_path ) - if complex: - dependency_template = string.Template( common.complex_repository_dependency_template ) - repository_dependency_xml = dependency_template.safe_substitute( package=package, version=version, dependency_lines='\n'.join( dependency_entries ) ) + for toolshed_url, name, owner, changeset_revision in repository_tuples: + dependency_entries.append( template.safe_substitute( toolshed_url=toolshed_url, + owner=owner, + repository_name=name, + changeset_revision=changeset_revision, + prior_installation_required='' ) ) + if not os.path.exists( filepath ): + os.makedirs( filepath ) + dependency_template = string.Template( common.complex_repository_dependency_template ) + repository_dependency_xml = dependency_template.safe_substitute( package=package, version=version, dependency_lines='\n'.join( dependency_entries ) ) + # Save the generated xml to the specified location. + file( file_path, 'w' ).write( repository_dependency_xml ) + + def generate_simple_dependency_xml( self, + repository_tuples, + filename, + filepath, + dependency_description='', + complex=False, + package=None, + version=None, + prior_installation_required=False ): + if not os.path.exists( filepath ): + os.makedirs( filepath ) + dependency_entries = [] + if prior_installation_required: + prior_installation_value = ' prior_installation_required="True"' else: - if not description: - description = ' description=""' - else: - description = ' description="%s"' % description - template_parser = string.Template( common.new_repository_dependencies_xml ) - repository_dependency_xml = template_parser.safe_substitute( description=description, dependency_lines='\n'.join( dependency_entries ) ) - # Save the generated xml to the specified location. - file( xml_filename, 'w' ).write( repository_dependency_xml ) - - def generate_repository_dependency_xml( self, repositories, xml_filename, dependency_description='', complex=False, package=None, version=None ): - file_path = os.path.split( xml_filename )[0] - if not os.path.exists( file_path ): - os.makedirs( file_path ) - dependency_entries = [] - for repository in repositories: - changeset_revision = self.get_repository_tip( repository ) + prior_installation_value = '' + for toolshed_url, name, owner, changeset_revision in repository_tuples: template = string.Template( common.new_repository_dependencies_line ) - dependency_entries.append( template.safe_substitute( toolshed_url=self.url, - owner=repository.user.username, - repository_name=repository.name, - changeset_revision=changeset_revision ) ) + dependency_entries.append( template.safe_substitute( toolshed_url=toolshed_url, + owner=owner, + repository_name=name, + changeset_revision=changeset_revision, + prior_installation_required=prior_installation_value ) ) if dependency_description: description = ' description="%s"' % dependency_description else: description = dependency_description - if complex: - dependency_template = string.Template( common.complex_repository_dependency_template ) - repository_dependency_xml = dependency_template.safe_substitute( package=package, version=version, dependency_lines='\n'.join( dependency_entries ) ) - else: - template_parser = string.Template( common.new_repository_dependencies_xml ) - repository_dependency_xml = template_parser.safe_substitute( description=description, dependency_lines='\n'.join( dependency_entries ) ) + template_parser = string.Template( common.new_repository_dependencies_xml ) + repository_dependency_xml = template_parser.safe_substitute( description=description, dependency_lines='\n'.join( dependency_entries ) ) # Save the generated xml to the specified location. - file( xml_filename, 'w' ).write( repository_dependency_xml ) + full_path = os.path.join( filepath, filename ) + file( full_path, 'w' ).write( repository_dependency_xml ) def generate_temp_path( self, test_script_path, additional_paths=[] ): temp_path = os.path.join( self.tool_shed_test_tmp_dir, test_script_path, os.sep.join( additional_paths ) ) diff -r 2c50935e70c8a483bcd09b358765408543a153fb -r 8d72c9adccf92f8a1971ec7d9b622de43cbd6f48 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 @@ -9,8 +9,10 @@ emboss_repository_description = 'Galaxy wrappers for Emboss version 5.0.0 tools for test 0020' emboss_repository_long_description = 'Galaxy wrappers for Emboss version 5.0.0 tools for test 0020' + class TestBasicRepositoryDependencies( ShedTwillTestCase ): '''Testing emboss 5 with repository dependencies.''' + def test_0000_initiate_users( self ): """Create necessary user accounts and login as an admin user.""" self.logout() @@ -23,9 +25,11 @@ admin_user = test_db_util.get_user( common.admin_email ) assert admin_user is not None, 'Problem retrieving user with email %s from the database' % common.admin_email admin_user_private_role = test_db_util.get_private_role( admin_user ) + def test_0005_create_category( self ): """Create a category for this test suite""" self.create_category( name='Test 0020 Basic Repository Dependencies', description='Testing basic repository dependency features.' ) + def test_0010_create_emboss_datatypes_repository_and_upload_tarball( self ): '''Create and populate the emboss_datatypes repository.''' self.logout() @@ -46,10 +50,12 @@ commit_message='Uploaded datatypes_conf.xml.', strings_displayed=[], strings_not_displayed=[] ) + def test_0015_verify_datatypes_in_datatypes_repository( self ): '''Verify that the emboss_datatypes repository contains datatype entries.''' 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.''' category = test_db_util.get_category_by_name( 'Test 0020 Basic Repository Dependencies' ) @@ -68,22 +74,15 @@ commit_message='Uploaded emboss.tar', strings_displayed=[], strings_not_displayed=[] ) + def test_0025_generate_and_upload_repository_dependencies_xml( self ): '''Generate and upload the repository_dependencies.xml file''' 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 ) ) - self.upload_file( repository, - filename='repository_dependencies.xml', - filepath=repository_dependencies_path, - valid_tools_only=True, - uncompress_file=False, - remove_repo_files_not_in_tar=False, - commit_message='Uploaded repository_dependencies.xml.', - strings_displayed=[], - strings_not_displayed=[] ) + repository_tuple = ( self.url, datatypes_repository.name, datatypes_repository.user.username, self.get_repository_tip( datatypes_repository ) ) + self.create_repository_dependency( repository=repository, repository_tuples=[ repository_tuple ], filepath=repository_dependencies_path ) + def test_0030_verify_emboss_5_dependencies( self ): '''Verify that the emboss_5 repository now depends on the emboss_datatypes repository with correct name, owner, and changeset revision.''' repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) @@ -98,6 +97,7 @@ changeset_revision, 'Repository dependencies' ] self.display_manage_repository_page( repository, strings_displayed=strings_displayed ) + def test_0040_verify_repository_metadata( self ): '''Verify that resetting the metadata does not change it.''' emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) diff -r 2c50935e70c8a483bcd09b358765408543a153fb -r 8d72c9adccf92f8a1971ec7d9b622de43cbd6f48 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,7 +1,6 @@ from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os import tool_shed.base.test_db_util as test_db_util -import logging -log = logging.getLogger(__name__) + datatypes_repository_name = 'emboss_datatypes_0030' datatypes_repository_description = "Galaxy applicable data formats used by Emboss tools." datatypes_repository_long_description = "Galaxy applicable data formats used by Emboss tools. This repository contains no tools." @@ -12,8 +11,10 @@ emboss_repository_description = 'Galaxy wrappers for Emboss version 5.0.0 tools for test 0030' emboss_repository_long_description = 'Galaxy wrappers for Emboss version 5.0.0 tools for test 0030' + class TestRepositoryDependencyRevisions( ShedTwillTestCase ): '''Test dependencies on different revisions of a repository.''' + def test_0000_initiate_users( self ): """Create necessary user accounts.""" self.logout() @@ -26,9 +27,11 @@ admin_user = test_db_util.get_user( common.admin_email ) assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email admin_user_private_role = test_db_util.get_private_role( admin_user ) + def test_0005_create_category( self ): """Create a category for this test suite""" self.create_category( name='Test 0030 Repository Dependency Revisions', description='Testing repository dependencies by revision.' ) + def test_0010_create_emboss_5_repository( self ): '''Create and populate the emboss_5_0030 repository.''' self.logout() @@ -48,6 +51,7 @@ commit_message='Uploaded tool tarball.', strings_displayed=[], strings_not_displayed=[] ) + def test_0015_create_emboss_6_repository( self ): '''Create and populate the emboss_6_0030 repository.''' self.logout() @@ -67,6 +71,7 @@ commit_message='Uploaded tool tarball.', strings_displayed=[], strings_not_displayed=[] ) + def test_0020_create_emboss_datatypes_repository( self ): '''Create and populate the emboss_datatypes_0030 repository.''' self.logout() @@ -86,6 +91,7 @@ commit_message='Uploaded datatypes_conf.xml.', strings_displayed=[], strings_not_displayed=[] ) + def test_0025_create_emboss_repository( self ): '''Create and populate the emboss_0030 repository.''' self.logout() @@ -105,69 +111,39 @@ commit_message='Uploaded the tool tarball.', strings_displayed=[], strings_not_displayed=[] ) + def test_0030_generate_repository_dependencies_for_emboss_5( self ): '''Generate a repository_dependencies.xml file specifying emboss_datatypes and upload it to the emboss_5 repository.''' datatypes_repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) - 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 = test_db_util.get_repository_by_name_and_owner( emboss_5_repository_name, common.test_user_1_name ) - self.upload_file( emboss_5_repository, - filename='repository_dependencies.xml', - filepath=repository_dependencies_path, - valid_tools_only=True, - uncompress_file=False, - remove_repo_files_not_in_tar=False, - commit_message='Uploaded repository_dependencies.xml.', - strings_displayed=[], - strings_not_displayed=[] ) + repository_dependencies_path = self.generate_temp_path( 'test_0030', additional_paths=[ 'emboss5' ] ) + datatypes_tuple = ( self.url, datatypes_repository.name, datatypes_repository.user.username, self.get_repository_tip( datatypes_repository ) ) + self.create_repository_dependency( repository=emboss_5_repository, repository_tuples=[ datatypes_tuple ], filepath=repository_dependencies_path ) + def test_0035_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 = 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, - filename='repository_dependencies.xml', - filepath=repository_dependencies_path, - valid_tools_only=True, - uncompress_file=False, - remove_repo_files_not_in_tar=False, - commit_message='Uploaded repository_dependencies.xml.', - strings_displayed=[], - strings_not_displayed=[] ) + 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=[ 'emboss6' ] ) + datatypes_tuple = ( self.url, datatypes_repository.name, datatypes_repository.user.username, self.get_repository_tip( datatypes_repository ) ) + self.create_repository_dependency( repository=emboss_6_repository, repository_tuples=[ datatypes_tuple ], filepath=repository_dependencies_path ) + def test_0040_generate_repository_dependency_on_emboss_5( self ): '''Create and upload repository_dependencies.xml for the emboss_5_0030 repository.''' 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 ), - dependency_description='Emboss requires the Emboss 5 repository.' ) - self.upload_file( emboss_repository, - filename='repository_dependencies.xml', - filepath=repository_dependencies_path, - valid_tools_only=True, - uncompress_file=False, - remove_repo_files_not_in_tar=False, - commit_message='Uploaded repository_dependencies.xml.', - strings_displayed=[], - strings_not_displayed=[] ) + emboss_tuple = ( self.url, emboss_5_repository.name, emboss_5_repository.user.username, self.get_repository_tip( emboss_5_repository ) ) + self.create_repository_dependency( repository=emboss_repository, repository_tuples=[ emboss_tuple ], filepath=repository_dependencies_path ) + def test_0045_generate_repository_dependency_on_emboss_6( self ): '''Create and upload repository_dependencies.xml for the emboss_6_0030 repository.''' 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 ), - dependency_description='Emboss requires the Emboss 6 repository.' ) - self.upload_file( emboss_repository, - filename='repository_dependencies.xml', - filepath=repository_dependencies_path, - valid_tools_only=True, - uncompress_file=False, - remove_repo_files_not_in_tar=False, - commit_message='Uploaded repository_dependencies.xml.', - strings_displayed=[], - strings_not_displayed=[] ) + repository_dependencies_path = self.generate_temp_path( 'test_0030', additional_paths=[ 'emboss', '5' ] ) + emboss_tuple = ( self.url, emboss_6_repository.name, emboss_6_repository.user.username, self.get_repository_tip( emboss_6_repository ) ) + self.create_repository_dependency( repository=emboss_repository, repository_tuples=[ emboss_tuple ], filepath=repository_dependencies_path ) + def test_0050_verify_repository_dependency_revisions( self ): '''Verify that different metadata revisions of the emboss repository have different repository dependencies.''' repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) @@ -178,7 +154,7 @@ # Iterate through all metadata revisions and check for repository dependencies. for metadata, changeset_revision in repository_metadata: # Add the dependency description and datatypes repository details to the strings to check. - strings_displayed = [ 'Emboss requires the Emboss', 'emboss_datatypes_0030', 'user1', datatypes_tip ] + strings_displayed = [ 'emboss_datatypes_0030', 'user1', datatypes_tip ] strings_displayed.extend( [ 'Tool dependencies', 'emboss', '5.0.0', 'package' ] ) self.display_manage_repository_page( repository, changeset_revision=changeset_revision, diff -r 2c50935e70c8a483bcd09b358765408543a153fb -r 8d72c9adccf92f8a1971ec7d9b622de43cbd6f48 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 @@ -9,8 +9,10 @@ filtering_repository_description = "Galaxy's filtering tool for test 0040" filtering_repository_long_description = "Long description of Galaxy's filtering tool for test 0040" + class TestRepositoryCircularDependencies( ShedTwillTestCase ): '''Verify that the code correctly displays repositories with circular repository dependencies.''' + def test_0000_initiate_users( self ): """Create necessary user accounts.""" self.logout() @@ -23,9 +25,11 @@ admin_user = test_db_util.get_user( common.admin_email ) assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email admin_user_private_role = test_db_util.get_private_role( admin_user ) + def test_0005_create_category( self ): """Create a category for this test suite""" self.create_category( name='test_0040_repository_circular_dependencies', description='Testing handling of circular repository dependencies.' ) + def test_0010_create_freebayes_repository( self ): '''Create and populate freebayes_0040.''' self.logout() @@ -45,6 +49,7 @@ commit_message='Uploaded the tool tarball.', strings_displayed=[], strings_not_displayed=[] ) + def test_0015_create_filtering_repository( self ): '''Create and populate filtering_0040.''' self.logout() @@ -64,6 +69,7 @@ commit_message='Uploaded the tool tarball for filtering 1.1.0.', strings_displayed=[], strings_not_displayed=[] ) + def test_0020_create_dependency_on_freebayes( self ): '''Upload a repository_dependencies.xml file that specifies the current revision of freebayes to the filtering_0040 repository.''' # The dependency structure should look like: @@ -73,18 +79,9 @@ 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 ), - dependency_description='Filtering 1.1.0 depends on the freebayes repository.' ) - self.upload_file( filtering_repository, - filename='repository_dependencies.xml', - filepath=repository_dependencies_path, - valid_tools_only=True, - uncompress_file=False, - remove_repo_files_not_in_tar=False, - commit_message='Uploaded dependency on freebayes.', - strings_displayed=[], - strings_not_displayed=[] ) + repository_tuple = ( self.url, repository.name, repository.user.username, self.get_repository_tip( repository ) ) + self.create_repository_dependency( repository=filtering_repository, repository_tuples=[ repository_tuple ], filepath=repository_dependencies_path ) + def test_0025_create_dependency_on_filtering( self ): '''Upload a repository_dependencies.xml file that specifies the current revision of filtering to the freebayes_0040 repository.''' # The dependency structure should look like: @@ -94,18 +91,9 @@ 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 ), - dependency_description='Freebayes depends on the filtering repository.' ) - self.upload_file( freebayes_repository, - filename='repository_dependencies.xml', - filepath=repository_dependencies_path, - valid_tools_only=True, - uncompress_file=False, - remove_repo_files_not_in_tar=False, - commit_message='Uploaded dependency on filtering.', - strings_displayed=[], - strings_not_displayed=[] ) + repository_tuple = ( self.url, repository.name, repository.user.username, self.get_repository_tip( repository ) ) + self.create_repository_dependency( repository=freebayes_repository, repository_tuples=[ repository_tuple ], filepath=repository_dependencies_path ) + def test_0030_verify_repository_dependencies( self ): '''Verify that each repository can depend on the other without causing an infinite loop.''' filtering_repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name ) @@ -117,12 +105,14 @@ # In this case, the displayed dependency will specify the tip revision, but this will not always be the case. self.check_repository_dependency( filtering_repository, freebayes_repository, self.get_repository_tip( freebayes_repository ) ) self.check_repository_dependency( freebayes_repository, filtering_repository, self.get_repository_tip( filtering_repository ) ) + def test_0035_verify_repository_metadata( self ): '''Verify that resetting the metadata does not change it.''' freebayes_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 ) for repository in [ freebayes_repository, filtering_repository ]: self.verify_unchanged_repository_metadata( repository ) + def test_0040_verify_tool_dependencies( self ): '''Verify that freebayes displays tool dependencies.''' repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) diff -r 2c50935e70c8a483bcd09b358765408543a153fb -r 8d72c9adccf92f8a1971ec7d9b622de43cbd6f48 test/tool_shed/functional/test_0050_circular_dependencies_4_levels.py --- a/test/tool_shed/functional/test_0050_circular_dependencies_4_levels.py +++ b/test/tool_shed/functional/test_0050_circular_dependencies_4_levels.py @@ -32,8 +32,10 @@ category_name = 'Test 0050 Circular Dependencies 5 Levels' category_description = 'Test circular dependency features' + class TestRepositoryCircularDependenciesToNLevels( ShedTwillTestCase ): '''Verify that the code correctly handles circular dependencies down to n levels.''' + def test_0000_initiate_users( self ): """Create necessary user accounts.""" self.logout() @@ -46,6 +48,7 @@ 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_convert_repository( self ): '''Create and populate convert_chars_0050.''' category = self.create_category( name=category_name, description=category_description ) @@ -66,6 +69,7 @@ commit_message='Uploaded convert_chars tarball.', strings_displayed=[], strings_not_displayed=[] ) + def test_0010_create_column_repository( self ): '''Create and populate convert_chars_0050.''' category = self.create_category( name=category_name, description=category_description ) @@ -84,6 +88,7 @@ commit_message='Uploaded column_maker tarball.', strings_displayed=[], strings_not_displayed=[] ) + def test_0015_create_emboss_datatypes_repository( self ): '''Create and populate emboss_datatypes_0050.''' category = self.create_category( name=category_name, description=category_description ) @@ -104,6 +109,7 @@ commit_message='Uploaded datatypes_conf.xml.', strings_displayed=[], strings_not_displayed=[] ) + def test_0020_create_emboss_repository( self ): '''Create and populate emboss_0050.''' category = self.create_category( name=category_name, description=category_description ) @@ -122,20 +128,7 @@ commit_message='Uploaded emboss tarball.', strings_displayed=[], strings_not_displayed=[] ) - datatypes_repository = test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name ) - repository_dependencies_path = self.generate_temp_path( 'test_0050', additional_paths=[ 'emboss' ] ) - self.generate_repository_dependency_xml( [ datatypes_repository ], - self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), - dependency_description='Emboss depends on the emboss_datatypes repository.' ) - self.upload_file( repository, - filename='repository_dependencies.xml', - filepath=repository_dependencies_path, - valid_tools_only=True, - uncompress_file=False, - remove_repo_files_not_in_tar=False, - commit_message='Uploaded dependency on emboss_datatypes.', - strings_displayed=[], - strings_not_displayed=[] ) + def test_0025_create_filtering_repository( self ): '''Create and populate filtering_0050.''' category = self.create_category( name=category_name, description=category_description ) @@ -154,20 +147,7 @@ commit_message='Uploaded filtering 1.1.0 tarball.', strings_displayed=[], strings_not_displayed=[] ) - emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) - repository_dependencies_path = self.generate_temp_path( 'test_0050', additional_paths=[ 'filtering' ] ) - self.generate_repository_dependency_xml( [ emboss_repository ], - self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), - dependency_description='Filtering depends on the emboss repository.' ) - self.upload_file( filtering_repository, - filename='repository_dependencies.xml', - filepath=repository_dependencies_path, - valid_tools_only=True, - uncompress_file=False, - remove_repo_files_not_in_tar=False, - commit_message='Uploaded dependency on emboss.', - strings_displayed=[], - strings_not_displayed=[] ) + def test_0030_create_freebayes_repository( self ): '''Create and populate freebayes_0050.''' category = self.create_category( name=category_name, description=category_description ) @@ -186,6 +166,7 @@ commit_message='Uploaded freebayes tarball.', strings_displayed=[], strings_not_displayed=[] ) + def test_0035_create_bismark_repository( self ): '''Create and populate bismark_0050.''' category = self.create_category( name=category_name, description=category_description ) @@ -204,10 +185,11 @@ commit_message='Uploaded bismark tarball.', strings_displayed=[], strings_not_displayed=[] ) + def test_0040_create_and_upload_dependency_definitions( self ): column_repository = test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name ) convert_repository = test_db_util.get_repository_by_name_and_owner( convert_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 ) + 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 ) @@ -219,14 +201,21 @@ # emboss_datatypes depends on bismark # freebayes depends on freebayes, emboss, emboss_datatypes, and column_maker # filtering depends on emboss - self.create_repository_dependency( convert_repository, depends_on=[ column_repository ], filepath=dependency_xml_path ) - self.create_repository_dependency( column_repository, depends_on=[ convert_repository ], filepath=dependency_xml_path ) - self.create_repository_dependency( emboss_datatypes_repository, depends_on=[ bismark_repository ], filepath=dependency_xml_path ) - self.create_repository_dependency( emboss_repository, depends_on=[ emboss_datatypes_repository ], filepath=dependency_xml_path ) - self.create_repository_dependency( freebayes_repository, - depends_on=[ freebayes_repository, emboss_datatypes_repository, emboss_repository, column_repository ], + column_tuple = ( self.url, column_repository.name, column_repository.user.username, self.get_repository_tip( column_repository ) ) + convert_tuple = ( self.url, convert_repository.name, convert_repository.user.username, self.get_repository_tip( convert_repository ) ) + freebayes_tuple = ( self.url, freebayes_repository.name, freebayes_repository.user.username, self.get_repository_tip( freebayes_repository ) ) + emboss_tuple = ( self.url, emboss_repository.name, emboss_repository.user.username, self.get_repository_tip( emboss_repository ) ) + datatypes_tuple = ( self.url, datatypes_repository.name, datatypes_repository.user.username, self.get_repository_tip( datatypes_repository ) ) + bismark_tuple = ( self.url, bismark_repository.name, bismark_repository.user.username, self.get_repository_tip( bismark_repository ) ) + self.create_repository_dependency( repository=convert_repository, repository_tuples=[ column_tuple ], filepath=dependency_xml_path ) + self.create_repository_dependency( repository=column_repository, repository_tuples=[ convert_tuple ], filepath=dependency_xml_path ) + self.create_repository_dependency( repository=datatypes_repository, repository_tuples=[ bismark_tuple ], filepath=dependency_xml_path ) + self.create_repository_dependency( repository=emboss_repository, repository_tuples=[ datatypes_tuple ], filepath=dependency_xml_path ) + self.create_repository_dependency( repository=freebayes_repository, + repository_tuples=[ freebayes_tuple, datatypes_tuple, emboss_tuple, column_tuple ], filepath=dependency_xml_path ) - self.create_repository_dependency( filtering_repository, depends_on=[ emboss_repository ], filepath=dependency_xml_path ) + self.create_repository_dependency( repository=filtering_repository, repository_tuples=[ emboss_tuple ], filepath=dependency_xml_path ) + def test_0045_verify_repository_dependencies( self ): '''Verify that the generated dependency circle does not cause an infinite loop. Expected structure: @@ -264,6 +253,7 @@ strings_displayed = [ 'freebayes_0050 depends on freebayes_0050, emboss_datatypes_0050, emboss_0050, column_maker_0050.' ] self.display_manage_repository_page( freebayes_repository, strings_displayed=strings_displayed ) + def test_0050_verify_tool_dependencies( self ): '''Check that freebayes and emboss display tool dependencies.''' freebayes_repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) @@ -271,6 +261,7 @@ self.display_manage_repository_page( freebayes_repository, strings_displayed=[ 'freebayes', '0.9.4_9696d0ce8a9', 'samtools', '0.1.18', 'Tool dependencies', 'package' ] ) self.display_manage_repository_page( emboss_repository, strings_displayed=[ 'Tool dependencies', 'emboss', '5.0.0', 'package' ] ) + def test_0055_verify_repository_metadata( self ): '''Verify that resetting the metadata does not change it.''' emboss_datatypes_repository = test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name ) diff -r 2c50935e70c8a483bcd09b358765408543a153fb -r 8d72c9adccf92f8a1971ec7d9b622de43cbd6f48 test/tool_shed/functional/test_0080_advanced_circular_dependencies.py --- a/test/tool_shed/functional/test_0080_advanced_circular_dependencies.py +++ b/test/tool_shed/functional/test_0080_advanced_circular_dependencies.py @@ -12,8 +12,10 @@ category_name = 'Test 0080 Advanced Circular Dependencies' category_description = 'Test circular dependency features' + class TestRepositoryCircularDependencies( ShedTwillTestCase ): '''Verify that the code correctly handles circular dependencies.''' + def test_0000_initiate_users( self ): """Create necessary user accounts.""" self.logout() @@ -26,6 +28,7 @@ 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_column_repository( self ): """Create and populate the column_maker repository.""" category = self.create_category( name=category_name, description=category_description ) @@ -46,6 +49,7 @@ commit_message='Uploaded column_maker tarball.', strings_displayed=[], strings_not_displayed=[] ) + def test_0005_create_convert_repository( self ): """Create and populate the convert_chars repository.""" self.logout() @@ -68,46 +72,30 @@ commit_message='Uploaded convert_chars tarball.', strings_displayed=[], strings_not_displayed=[] ) + def test_0020_create_repository_dependencies( self ): - '''Upload a repository_dependencies.xml file that specifies the current revision of freebayes to the filtering_0040 repository.''' + '''Upload a repository_dependencies.xml file that specifies the current revision of convert_chars_0080 to the column_maker_0080 repository.''' 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_0080', additional_paths=[ 'convert' ] ) - 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 repository.' ) - self.upload_file( column_repository, - filename='repository_dependencies.xml', - filepath=repository_dependencies_path, - valid_tools_only=True, - uncompress_file=True, - remove_repo_files_not_in_tar=False, - commit_message='Uploaded dependency on convert_chars.', - strings_displayed=[], - strings_not_displayed=[] ) + repository_tuple = ( self.url, convert_repository.name, convert_repository.user.username, self.get_repository_tip( convert_repository ) ) + self.create_repository_dependency( repository=column_repository, repository_tuples=[ repository_tuple ], filepath=repository_dependencies_path ) + def test_0025_create_dependency_on_filtering( self ): '''Upload a repository_dependencies.xml file that specifies the current revision of filtering to the freebayes_0040 repository.''' 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_0080', 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, - filename='repository_dependencies.xml', - filepath=repository_dependencies_path, - valid_tools_only=True, - uncompress_file=True, - remove_repo_files_not_in_tar=False, - commit_message='Uploaded dependency on column_maker.', - strings_displayed=[], - strings_not_displayed=[] ) + repository_tuple = ( self.url, column_repository.name, column_repository.user.username, self.get_repository_tip( column_repository ) ) + self.create_repository_dependency( repository=convert_repository, repository_tuples=[ repository_tuple ], filepath=repository_dependencies_path ) + def test_0030_verify_repository_dependencies( self ): '''Verify that each repository can depend on the other without causing an infinite loop.''' 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 ) self.check_repository_dependency( convert_repository, column_repository, self.get_repository_tip( column_repository ) ) self.check_repository_dependency( column_repository, convert_repository, self.get_repository_tip( convert_repository ) ) + def test_0035_verify_repository_metadata( self ): '''Verify that resetting the metadata does not change it.''' column_repository = test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name ) diff -r 2c50935e70c8a483bcd09b358765408543a153fb -r 8d72c9adccf92f8a1971ec7d9b622de43cbd6f48 test/tool_shed/functional/test_0090_tool_search.py --- a/test/tool_shed/functional/test_0090_tool_search.py +++ b/test/tool_shed/functional/test_0090_tool_search.py @@ -28,8 +28,10 @@ category_name = 'Test 0090 Tool Search And Installation' category_description = 'Test 0090 Tool Search And Installation' + class TestRepositoryCircularDependenciesAgain( ShedTwillTestCase ): '''Test more features related to repository dependencies.''' + def test_0000_initiate_users( self ): """Create necessary user accounts.""" self.logout() @@ -42,6 +44,7 @@ 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_bwa_base_repository( self ): '''Create and populate bwa_base_0090.''' category = self.create_category( name=category_name, description=category_description ) @@ -62,6 +65,7 @@ commit_message='Uploaded BWA tarball.', strings_displayed=[], strings_not_displayed=[] ) + def test_0010_create_bwa_color_repository( self ): '''Create and populate bwa_color_0090.''' category = self.create_category( name=category_name, description=category_description ) @@ -82,6 +86,7 @@ commit_message='Uploaded BWA color tarball.', strings_displayed=[], strings_not_displayed=[] ) + def test_0015_create_emboss_datatypes_repository( self ): '''Create and populate emboss_datatypes_0090.''' category = self.create_category( name=category_name, description=category_description ) @@ -102,6 +107,7 @@ commit_message='Uploaded datatypes_conf.xml.', strings_displayed=[], strings_not_displayed=[] ) + def test_0020_create_emboss_repository( self ): '''Create and populate emboss_0090.''' category = self.create_category( name=category_name, description=category_description ) @@ -120,20 +126,7 @@ commit_message='Uploaded emboss tarball.', strings_displayed=[], strings_not_displayed=[] ) - 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_0090', additional_paths=[ 'emboss' ] ) - self.generate_repository_dependency_xml( [ datatypes_repository ], - self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), - dependency_description='Emboss depends on the emboss_datatypes repository.' ) - self.upload_file( repository, - filename='repository_dependencies.xml', - filepath=repository_dependencies_path, - valid_tools_only=True, - uncompress_file=True, - remove_repo_files_not_in_tar=False, - commit_message='Uploaded dependency on emboss_datatypes.', - strings_displayed=[], - strings_not_displayed=[] ) + def test_0025_create_filtering_repository( self ): '''Create and populate filtering_0090.''' category = self.create_category( name=category_name, description=category_description ) @@ -152,20 +145,7 @@ commit_message='Uploaded filtering 1.1.0 tarball.', strings_displayed=[], strings_not_displayed=[] ) - 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_0090', additional_paths=[ 'filtering' ] ) - self.generate_repository_dependency_xml( [ emboss_repository ], - self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), - dependency_description='Filtering depends on the emboss repository.' ) - self.upload_file( filtering_repository, - filename='repository_dependencies.xml', - filepath=repository_dependencies_path, - valid_tools_only=True, - uncompress_file=False, - remove_repo_files_not_in_tar=False, - commit_message='Uploaded dependency on emboss.', - strings_displayed=[], - strings_not_displayed=[] ) + def test_0030_create_freebayes_repository( self ): '''Create and populate freebayes_0090.''' category = self.create_category( name=category_name, description=category_description ) @@ -184,19 +164,25 @@ commit_message='Uploaded freebayes tarball.', strings_displayed=[], strings_not_displayed=[] ) + def test_0035_create_and_upload_dependency_definitions( self ): '''Create and upload repository dependency definitions.''' bwa_color_repository = test_db_util.get_repository_by_name_and_owner( bwa_color_repository_name, common.test_user_1_name ) bwa_base_repository = test_db_util.get_repository_by_name_and_owner( bwa_base_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 ) + 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 ) dependency_xml_path = self.generate_temp_path( 'test_0090', additional_paths=[ 'freebayes' ] ) - self.create_repository_dependency( emboss_repository, depends_on=[ emboss_datatypes_repository ], filepath=dependency_xml_path ) - self.create_repository_dependency( filtering_repository, depends_on=[ freebayes_repository ], filepath=dependency_xml_path ) - self.create_repository_dependency( bwa_base_repository, depends_on=[ emboss_repository ], filepath=dependency_xml_path ) - self.create_repository_dependency( bwa_color_repository, depends_on=[ filtering_repository ], filepath=dependency_xml_path ) + freebayes_tuple = ( self.url, freebayes_repository.name, freebayes_repository.user.username, self.get_repository_tip( freebayes_repository ) ) + emboss_tuple = ( self.url, emboss_repository.name, emboss_repository.user.username, self.get_repository_tip( emboss_repository ) ) + datatypes_tuple = ( self.url, datatypes_repository.name, datatypes_repository.user.username, self.get_repository_tip( datatypes_repository ) ) + filtering_tuple = ( self.url, filtering_repository.name, filtering_repository.user.username, self.get_repository_tip( filtering_repository ) ) + self.create_repository_dependency( repository=emboss_repository, repository_tuples=[ datatypes_tuple ], filepath=dependency_xml_path ) + self.create_repository_dependency( repository=filtering_repository, repository_tuples=[ freebayes_tuple ], filepath=dependency_xml_path ) + self.create_repository_dependency( repository=bwa_base_repository, repository_tuples=[ emboss_tuple ], filepath=dependency_xml_path ) + self.create_repository_dependency( repository=bwa_color_repository, repository_tuples=[ filtering_tuple ], filepath=dependency_xml_path ) + def test_0040_verify_repository_dependencies( self ): '''Verify the generated dependency structure.''' bwa_color_repository = test_db_util.get_repository_by_name_and_owner( bwa_color_repository_name, common.test_user_1_name ) diff -r 2c50935e70c8a483bcd09b358765408543a153fb -r 8d72c9adccf92f8a1971ec7d9b622de43cbd6f48 test/tool_shed/functional/test_0100_complex_repository_dependencies.py --- a/test/tool_shed/functional/test_0100_complex_repository_dependencies.py +++ b/test/tool_shed/functional/test_0100_complex_repository_dependencies.py @@ -1,6 +1,9 @@ from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os import tool_shed.base.test_db_util as test_db_util +import logging +log = logging.getLogger( __name__ ) + bwa_base_repository_name = 'bwa_base_repository_0100' bwa_base_repository_description = "BWA Base" bwa_base_repository_long_description = "BWA tool that depends on bwa 0.5.9, with a complex repository dependency pointing at bwa_tool_repository_0100" @@ -12,8 +15,10 @@ category_name = 'Test 0100 Complex Repository Dependencies' category_description = 'Test 0100 Complex Repository Dependencies' + class TestComplexRepositoryDependencies( ShedTwillTestCase ): '''Test features related to complex repository dependencies.''' + def test_0000_initiate_users( self ): """Create necessary user accounts.""" self.logout() @@ -26,6 +31,7 @@ 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_bwa_tool_repository( self ): '''Create and populate bwa_tool_repository_0100.''' category = self.create_category( name=category_name, description=category_description ) @@ -49,6 +55,7 @@ strings_not_displayed=[] ) # Visit the manage repository page for bwa_tool_repository_0100. self.display_manage_repository_page( repository, strings_displayed=[ 'Tool dependencies', 'may not be', 'in this repository' ] ) + def test_0010_create_bwa_base_repository( self ): '''Create and populate bwa_base_0100.''' category = self.create_category( name=category_name, description=category_description ) @@ -71,30 +78,30 @@ commit_message='Uploaded bwa_base.tar with tool wrapper XML, but without tool dependency XML.', strings_displayed=[], strings_not_displayed=[] ) + def test_0015_generate_complex_repository_dependency_invalid_shed_url( self ): '''Generate and upload a complex repository definition that specifies an invalid tool shed URL.''' dependency_path = self.generate_temp_path( 'test_0100', additional_paths=[ 'complex', 'invalid' ] ) xml_filename = self.get_filename( 'tool_dependencies.xml', filepath=dependency_path ) # The repository named bwa_base_repository_0100 is the dependent repository. - repository = test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name ) + base_repository = test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name ) # The tool_repository named bwa_tool_repository_0100 is the required repository. tool_repository = test_db_util.get_repository_by_name_and_owner( bwa_tool_repository_name, common.test_user_1_name ) url = 'http://http://this is not an url!' name = 'bwa_tool_repository_0100' owner = 'user1' changeset_revision = self.get_repository_tip( tool_repository ) - self.generate_invalid_dependency_xml( xml_filename, url, name, owner, changeset_revision, complex=True, package='bwa', version='0.5.9' ) strings_displayed = [ 'Repository dependencies are currently supported only within the same tool shed' ] # Populate the dependent repository named bwa_base_repository_0100 with an invalid tool_dependencies.xml file. - self.upload_file( repository, - filename='tool_dependencies.xml', - filepath=dependency_path, - valid_tools_only=False, - uncompress_file=False, - remove_repo_files_not_in_tar=False, - commit_message='Uploaded dependency on bwa_tool_0100 with invalid url.', - strings_displayed=strings_displayed, - strings_not_displayed=[] ) + repository_tuple = ( url, name, owner, changeset_revision ) + self.create_repository_dependency( repository=base_repository, + filepath=dependency_path, + repository_tuples=[ repository_tuple ], + strings_displayed=strings_displayed, + complex=True, + package='bwa', + version='0.5.9' ) + def test_0020_generate_complex_repository_dependency_invalid_repository_name( self ): '''Generate and upload a complex repository definition that specifies an invalid repository name.''' dependency_path = self.generate_temp_path( 'test_0100', additional_paths=[ 'complex', 'invalid' ] ) @@ -107,18 +114,17 @@ name = 'invalid_repository!?' owner = 'user1' changeset_revision = self.get_repository_tip( tool_repository ) - self.generate_invalid_dependency_xml( xml_filename, url, name, owner, changeset_revision, complex=True, package='bwa', version='0.5.9' ) strings_displayed = [ 'because the name is invalid' ] - # # Populate the dependent base_repository named bwa_tool_repository_0100 with an invalid tool_dependencies.xml file. - self.upload_file( base_repository, - filename='tool_dependencies.xml', - filepath=dependency_path, - valid_tools_only=False, - uncompress_file=False, - remove_repo_files_not_in_tar=False, - commit_message='Uploaded dependency on bwa_tool_0100 with invalid repository name.', - strings_displayed=strings_displayed, - strings_not_displayed=[] ) + # Populate the dependent base_repository named bwa_tool_repository_0100 with an invalid tool_dependencies.xml file. + repository_tuple = ( url, name, owner, changeset_revision ) + self.create_repository_dependency( repository=base_repository, + filepath=dependency_path, + repository_tuples=[ repository_tuple ], + strings_displayed=strings_displayed, + complex=True, + package='bwa', + version='0.5.9' ) + def test_0025_generate_complex_repository_dependency_invalid_owner_name( self ): '''Generate and upload a complex repository definition that specifies an invalid owner.''' dependency_path = self.generate_temp_path( 'test_0100', additional_paths=[ 'complex', 'invalid' ] ) @@ -131,17 +137,16 @@ name = 'bwa_tool_repository_0100' owner = 'invalid_owner!?' changeset_revision = self.get_repository_tip( tool_repository ) - self.generate_invalid_dependency_xml( xml_filename, url, name, owner, changeset_revision, complex=True, package='bwa', version='0.5.9' ) - strings_displayed = [ 'because the owner is invalid.' ] - self.upload_file( base_repository, - filename='tool_dependencies.xml', - filepath=dependency_path, - valid_tools_only=False, - uncompress_file=False, - remove_repo_files_not_in_tar=False, - commit_message='Uploaded dependency on bwa_tool_0100 with invalid owner.', - strings_displayed=strings_displayed, - strings_not_displayed=[] ) + strings_displayed = [ 'because the owner is invalid.' ] + repository_tuple = ( url, name, owner, changeset_revision ) + self.create_repository_dependency( repository=base_repository, + filepath=dependency_path, + repository_tuples=[ repository_tuple ], + strings_displayed=strings_displayed, + complex=True, + package='bwa', + version='0.5.9' ) + def test_0030_generate_complex_repository_dependency_invalid_changeset_revision( self ): '''Generate and upload a complex repository definition that specifies an invalid changeset revision.''' dependency_path = self.generate_temp_path( 'test_0100', additional_paths=[ 'complex', 'invalid' ] ) @@ -154,17 +159,16 @@ name = 'bwa_tool_repository_0100' owner = 'user1' changeset_revision = '1234abcd' - self.generate_invalid_dependency_xml( xml_filename, url, name, owner, changeset_revision, complex=True, package='bwa', version='0.5.9' ) strings_displayed = [ 'because the changeset revision is invalid.' ] - self.upload_file( base_repository, - filename='tool_dependencies.xml', - filepath=dependency_path, - valid_tools_only=False, - uncompress_file=False, - remove_repo_files_not_in_tar=False, - commit_message='Uploaded dependency on bwa_tool_0100 with invalid changeset revision.', - strings_displayed=strings_displayed, - strings_not_displayed=[] ) + repository_tuple = ( url, name, owner, changeset_revision ) + self.create_repository_dependency( repository=base_repository, + filepath=dependency_path, + repository_tuples=[ repository_tuple ], + strings_displayed=strings_displayed, + complex=True, + package='bwa', + version='0.5.9' ) + def test_0035_generate_complex_repository_dependency( self ): '''Generate and upload a valid tool_dependencies.xml file that specifies bwa_tool_repository_0100.''' # The base_repository named bwa_base_repository_0100 is the dependent repository. @@ -172,25 +176,20 @@ # The tool_repository named bwa_tool_repository_0100 is the required repository. tool_repository = test_db_util.get_repository_by_name_and_owner( bwa_tool_repository_name, common.test_user_1_name ) dependency_path = self.generate_temp_path( 'test_0100', additional_paths=[ 'complex' ] ) - xml_filename = self.get_filename( 'tool_dependencies.xml', filepath=dependency_path ) url = self.url name = 'bwa_tool_repository_0100' owner = 'user1' changeset_revision = self.get_repository_tip( tool_repository ) - self.generate_repository_dependency_xml( [ tool_repository ], xml_filename, complex=True, package='bwa', version='0.5.9' ) - # Upload the valid tool_dependencies.xml file to bwa_base_repository_0100 that specifies bwa_tool_repository_0100 - # as a repository dependency via a complex repository dependency definition. - self.upload_file( base_repository, - filename='tool_dependencies.xml', - filepath=dependency_path, - valid_tools_only=True, - uncompress_file=False, - remove_repo_files_not_in_tar=False, - commit_message='Uploaded valid complex dependency on bwa_tool_0100.', - strings_displayed=[], - strings_not_displayed=[] ) - self.check_repository_dependency( base_repository, tool_repository ) - self.display_manage_repository_page( base_repository, strings_displayed=[ 'bwa', '0.5.9', 'package' ] ) + repository_tuple = ( url, name, owner, changeset_revision ) + self.create_repository_dependency( repository=base_repository, + filepath=dependency_path, + repository_tuples=[ repository_tuple ], + complex=True, + package='bwa', + version='0.5.9' ) + self.check_repository_dependency( base_repository, depends_on_repository=tool_repository ) + self.display_manage_repository_page( base_repository, strings_displayed=[ 'bwa', '0.5.9', 'package', changeset_revision ] ) + def test_0040_generate_tool_dependency( self ): '''Generate and upload a new tool_dependencies.xml file that specifies an arbitrary file on the filesystem, and verify that bwa_base depends on the new changeset revision.''' # The base_repository named bwa_base_repository_0100 is the dependent repository. diff -r 2c50935e70c8a483bcd09b358765408543a153fb -r 8d72c9adccf92f8a1971ec7d9b622de43cbd6f48 test/tool_shed/functional/test_0110_invalid_simple_repository_dependencies.py --- a/test/tool_shed/functional/test_0110_invalid_simple_repository_dependencies.py +++ b/test/tool_shed/functional/test_0110_invalid_simple_repository_dependencies.py @@ -12,8 +12,10 @@ category_name = 'Test 0110 Invalid Repository Dependencies' category_desc = 'Test 0110 Invalid Repository Dependencies' + class TestBasicRepositoryDependencies( ShedTwillTestCase ): '''Testing emboss 5 with repository dependencies.''' + def test_0000_initiate_users( self ): """Create necessary user accounts and login as an admin user.""" self.logout() @@ -26,9 +28,11 @@ admin_user = test_db_util.get_user( common.admin_email ) assert admin_user is not None, 'Problem retrieving user with email %s from the database' % common.admin_email admin_user_private_role = test_db_util.get_private_role( admin_user ) + def test_0005_create_category( self ): """Create a category for this test suite""" self.create_category( name=category_name, description=category_desc ) + def test_0010_create_emboss_datatypes_repository_and_upload_tarball( self ): '''Create and populate the emboss_datatypes repository.''' self.logout() @@ -49,10 +53,12 @@ commit_message='Uploaded datatypes_conf.xml.', strings_displayed=[], strings_not_displayed=[] ) + def test_0015_verify_datatypes_in_datatypes_repository( self ): '''Verify that the emboss_datatypes repository contains datatype entries.''' 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_0110 repository.''' category = test_db_util.get_category_by_name( category_name ) @@ -71,27 +77,25 @@ commit_message='Uploaded emboss tool tarball.', strings_displayed=[], strings_not_displayed=[] ) + def test_0025_generate_repository_dependency_with_invalid_url( self ): '''Generate a repository dependency for emboss 5 with an invalid URL.''' dependency_path = self.generate_temp_path( 'test_0110', additional_paths=[ 'simple' ] ) xml_filename = self.get_filename( 'repository_dependencies.xml', filepath=dependency_path ) - repository = test_db_util.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 ) emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) url = 'http://http://this is not an url!' - name = repository.name - owner = repository.user.username - changeset_revision = self.get_repository_tip( repository ) - self.generate_invalid_dependency_xml( xml_filename, url, name, owner, changeset_revision, complex=False, description='This is invalid.' ) + name = datatypes_repository.name + owner = datatypes_repository.user.username + changeset_revision = self.get_repository_tip( datatypes_repository ) strings_displayed = [ 'Repository dependencies are currently supported only within the same tool shed' ] - self.upload_file( emboss_repository, - filename='repository_dependencies.xml', - filepath=dependency_path, - valid_tools_only=False, - uncompress_file=False, - remove_repo_files_not_in_tar=False, - commit_message='Uploaded dependency on emboss_datatypes_0110 with invalid url.', - strings_displayed=strings_displayed, - strings_not_displayed=[] ) + repository_tuple = ( url, name, owner, changeset_revision ) + self.create_repository_dependency( repository=emboss_repository, + filepath=dependency_path, + repository_tuples=[ repository_tuple ], + strings_displayed=strings_displayed, + complex=False ) + def test_0030_generate_repository_dependency_with_invalid_name( self ): '''Generate a repository dependency for emboss 5 with an invalid name.''' dependency_path = self.generate_temp_path( 'test_0110', additional_paths=[ 'simple' ] ) @@ -102,17 +106,14 @@ name = '!?invalid?!' owner = repository.user.username changeset_revision = self.get_repository_tip( repository ) - self.generate_invalid_dependency_xml( xml_filename, url, name, owner, changeset_revision, complex=False, description='This is invalid.' ) strings_displayed = [ 'because the name is invalid.' ] - self.upload_file( emboss_repository, - filename='repository_dependencies.xml', - filepath=dependency_path, - valid_tools_only=False, - uncompress_file=False, - remove_repo_files_not_in_tar=False, - commit_message='Uploaded dependency on emboss_datatypes_0110 with invalid name.', - strings_displayed=strings_displayed, - strings_not_displayed=[] ) + repository_tuple = ( url, name, owner, changeset_revision ) + self.create_repository_dependency( repository=emboss_repository, + filepath=dependency_path, + repository_tuples=[ repository_tuple ], + strings_displayed=strings_displayed, + complex=False ) + def test_0035_generate_repository_dependency_with_invalid_owner( self ): '''Generate a repository dependency for emboss 5 with an invalid owner.''' dependency_path = self.generate_temp_path( 'test_0110', additional_paths=[ 'simple' ] ) @@ -123,17 +124,14 @@ name = repository.name owner = '!?invalid?!' changeset_revision = self.get_repository_tip( repository ) - self.generate_invalid_dependency_xml( xml_filename, url, name, owner, changeset_revision, complex=False, description='This is invalid.' ) strings_displayed = [ 'because the owner is invalid.' ] - self.upload_file( emboss_repository, - filename='repository_dependencies.xml', - filepath=dependency_path, - valid_tools_only=False, - uncompress_file=False, - remove_repo_files_not_in_tar=False, - commit_message='Uploaded dependency on emboss_datatypes_0110 with invalid owner.', - strings_displayed=strings_displayed, - strings_not_displayed=[] ) + repository_tuple = ( url, name, owner, changeset_revision ) + self.create_repository_dependency( repository=emboss_repository, + filepath=dependency_path, + repository_tuples=[ repository_tuple ], + strings_displayed=strings_displayed, + complex=False ) + def test_0040_generate_repository_dependency_with_invalid_changeset_revision( self ): '''Generate a repository dependency for emboss 5 with an invalid changeset revision.''' dependency_path = self.generate_temp_path( 'test_0110', additional_paths=[ 'simple', 'invalid' ] ) @@ -144,14 +142,10 @@ name = repository.name owner = repository.user.username changeset_revision = '!?invalid?!' - self.generate_invalid_dependency_xml( xml_filename, url, name, owner, changeset_revision, complex=False, description='This is invalid.' ) strings_displayed = [ 'because the changeset revision is invalid.' ] - self.upload_file( emboss_repository, - filename='repository_dependencies.xml', - filepath=dependency_path, - valid_tools_only=False, - uncompress_file=False, - remove_repo_files_not_in_tar=False, - commit_message='Uploaded dependency on emboss_datatypes_0110 with invalid changeset revision.', - strings_displayed=strings_displayed, - strings_not_displayed=[] ) + repository_tuple = ( url, name, owner, changeset_revision ) + self.create_repository_dependency( repository=emboss_repository, + filepath=dependency_path, + repository_tuples=[ repository_tuple ], + strings_displayed=strings_displayed, + complex=False ) diff -r 2c50935e70c8a483bcd09b358765408543a153fb -r 8d72c9adccf92f8a1971ec7d9b622de43cbd6f48 test/tool_shed/functional/test_0120_simple_repository_dependency_multiple_owners.py --- a/test/tool_shed/functional/test_0120_simple_repository_dependency_multiple_owners.py +++ b/test/tool_shed/functional/test_0120_simple_repository_dependency_multiple_owners.py @@ -23,7 +23,9 @@ base_datatypes_count = 0 repository_datatypes_count = 0 + class TestRepositoryMultipleOwners( ShedTwillTestCase ): + def test_0000_initiate_users( self ): """Create necessary user accounts and login as an admin user.""" """ @@ -45,6 +47,7 @@ admin_user = test_db_util.get_user( common.admin_email ) assert admin_user is not None, 'Problem retrieving user with email %s from the database' % common.admin_email admin_user_private_role = test_db_util.get_private_role( admin_user ) + def test_0005_create_datatypes_repository( self ): """Create and populate the blast_datatypes_0120 repository""" """ @@ -71,6 +74,7 @@ commit_message='Uploaded blast_datatypes tarball.', strings_displayed=[], strings_not_displayed=[] ) + def test_0010_verify_datatypes_repository( self ): '''Verify the blast_datatypes_0120 repository.''' ''' @@ -83,6 +87,7 @@ strings_displayed = [ 'BlastXml', 'BlastNucDb', 'BlastProtDb', 'application/xml', 'text/html', 'blastxml', 'blastdbn', 'blastdbp'] self.display_manage_repository_page( repository, strings_displayed=strings_displayed ) repository_datatypes_count = int( self.get_repository_datatypes_count( repository ) ) + def test_0015_create_tool_repository( self ): """Create and populate the blastxml_to_top_descr_0120 repository""" """ @@ -109,6 +114,7 @@ commit_message='Uploaded blastxml_to_top_descr tarball.', strings_displayed=[], strings_not_displayed=[] ) + def test_0020_verify_tool_repository( self ): '''Verify the blastxml_to_top_descr_0120 repository.''' ''' @@ -119,6 +125,7 @@ strings_displayed = [ 'blastxml_to_top_descr_0120', 'BLAST top hit descriptions', 'Make a table from BLAST XML' ] strings_displayed.extend( [ '0.0.1', 'Valid tools'] ) self.display_manage_repository_page( repository, strings_displayed=strings_displayed ) + def test_0025_create_repository_dependency( self ): '''Create a repository dependency on blast_datatypes_0120.''' ''' @@ -128,7 +135,9 @@ datatypes_repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_2_name ) tool_repository = test_db_util.get_repository_by_name_and_owner( tool_repository_name, common.test_user_1_name ) dependency_xml_path = self.generate_temp_path( 'test_0120', additional_paths=[ 'dependencies' ] ) - self.create_repository_dependency( repository=tool_repository, depends_on=[ datatypes_repository ], filepath=dependency_xml_path ) + datatypes_tuple = ( self.url, datatypes_repository.name, datatypes_repository.user.username, self.get_repository_tip( datatypes_repository ) ) + self.create_repository_dependency( repository=tool_repository, repository_tuples=[ datatypes_tuple ], filepath=dependency_xml_path ) + def test_0040_verify_repository_dependency( self ): '''Verify the created repository dependency.''' ''' diff -r 2c50935e70c8a483bcd09b358765408543a153fb -r 8d72c9adccf92f8a1971ec7d9b622de43cbd6f48 test/tool_shed/functional/test_0150_prior_installation_required.py --- /dev/null +++ b/test/tool_shed/functional/test_0150_prior_installation_required.py @@ -0,0 +1,109 @@ +from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os +import tool_shed.base.test_db_util as test_db_util + +column_repository_name = 'column_maker_0150' +column_repository_description = "Add column" +column_repository_long_description = "Compute an expression on every row" + +convert_repository_name = 'convert_chars_0150' +convert_repository_description = "Convert delimiters" +convert_repository_long_description = "Convert delimiters to tab" + +category_name = 'Test 0150 Simple Prior Installation' +category_description = 'Test 0150 Simple Prior Installation' + +''' +Create column_maker and convert_chars. + +Column maker repository dependency: +<repository toolshed="self.url" name="convert_chars" owner="test" changeset_revision="c3041382815c" prior_installation_required="True" /> + +Verify display. + +Galaxy side: + +Install column_maker. +Verify that convert_chars was installed first, contrary to the ordering that would be present without prior_installation_required. +''' + + +class TestSimplePriorInstallation( ShedTwillTestCase ): + '''Test features related to datatype converters.''' + + def test_0000_initiate_users( self ): + """Create necessary user accounts.""" + self.logout() + self.login( email=common.test_user_1_email, username=common.test_user_1_name ) + test_user_1 = test_db_util.get_user( common.test_user_1_email ) + assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email + test_user_1_private_role = test_db_util.get_private_role( test_user_1 ) + self.logout() + self.login( email=common.admin_email, username=common.admin_username ) + admin_user = test_db_util.get_user( common.admin_email ) + assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email + admin_user_private_role = test_db_util.get_private_role( admin_user ) + + def test_0005_create_convert_repository( self ): + '''Create and populate convert_chars_0150.''' + 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=[] ) + self.upload_file( repository, + filename='convert_chars/convert_chars.tar', + filepath=None, + valid_tools_only=True, + uncompress_file=True, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded convert_chars tarball.', + strings_displayed=[], + strings_not_displayed=[] ) + + def test_0010_create_column_repository( self ): + '''Create and populate convert_chars_0150.''' + category = self.create_category( name=category_name, description=category_description ) + 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=[] ) + self.upload_file( repository, + filename='column_maker/column_maker.tar', + filepath=None, + valid_tools_only=True, + uncompress_file=True, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded column_maker tarball.', + strings_displayed=[], + strings_not_displayed=[] ) + + def test_0015_create_repository_dependency( self ): + '''Create a repository dependency specifying convert_chars.''' + ''' + Column maker repository dependency: + <repository toolshed="self.url" name="convert_chars" owner="test" changeset_revision="<tip>" prior_installation_required="True" /> + ''' + column_repository = test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name ) + convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) + dependency_xml_path = self.generate_temp_path( 'test_0150', additional_paths=[ 'column' ] ) + convert_tuple = ( self.url, convert_repository.name, convert_repository.user.username, self.get_repository_tip( convert_repository ) ) + self.create_repository_dependency( repository=column_repository, + repository_tuples=[ convert_tuple ], + filepath=dependency_xml_path, + prior_installation_required=True ) + + def test_0020_verify_repository_dependency( self ): + '''Verify that the previously generated repositiory dependency displays correctly.''' + column_repository = test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name ) + convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) + self.check_repository_dependency( repository=column_repository, + depends_on_repository=convert_repository, + depends_on_changeset_revision=None, + changeset_revision=None ) + diff -r 2c50935e70c8a483bcd09b358765408543a153fb -r 8d72c9adccf92f8a1971ec7d9b622de43cbd6f48 test/tool_shed/functional/test_0160_circular_prior_installation_required.py --- /dev/null +++ b/test/tool_shed/functional/test_0160_circular_prior_installation_required.py @@ -0,0 +1,161 @@ +from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os +import tool_shed.base.test_db_util as test_db_util + +filter_repository_name = 'filtering_0160' +filter_repository_description = "Galaxy's filtering tool for test 0160" +filter_repository_long_description = "Long description of Galaxy's filtering tool for test 0160" + +column_repository_name = 'column_maker_0160' +column_repository_description = "Add column" +column_repository_long_description = "Compute an expression on every row" + +convert_repository_name = 'convert_chars_0160' +convert_repository_description = "Convert delimiters" +convert_repository_long_description = "Convert delimiters to tab" + +category_name = 'Test 0160 Simple Prior Installation' +category_description = 'Test 0160 Simple Prior Installation' + +''' +Create column_maker and convert_chars. + +Column maker repository dependency: +<repository toolshed="self.url" name="convert_chars" owner="test" changeset_revision="c3041382815c" prior_installation_required="True" /> + +Verify display. +''' + + +class TestSimplePriorInstallation( ShedTwillTestCase ): + '''Test features related to datatype converters.''' + + def test_0000_initiate_users( self ): + """Create necessary user accounts.""" + self.logout() + self.login( email=common.test_user_1_email, username=common.test_user_1_name ) + test_user_1 = test_db_util.get_user( common.test_user_1_email ) + assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email + test_user_1_private_role = test_db_util.get_private_role( test_user_1 ) + self.logout() + self.login( email=common.admin_email, username=common.admin_username ) + admin_user = test_db_util.get_user( common.admin_email ) + assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email + admin_user_private_role = test_db_util.get_private_role( admin_user ) + + def test_0005_create_convert_repository( self ): + '''Create and populate convert_chars_0160.''' + 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=[] ) + self.upload_file( repository, + filename='convert_chars/convert_chars.tar', + filepath=None, + valid_tools_only=True, + uncompress_file=True, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded convert_chars tarball.', + strings_displayed=[], + strings_not_displayed=[] ) + + def test_0010_create_column_repository( self ): + '''Create and populate convert_chars_0160.''' + category = self.create_category( name=category_name, description=category_description ) + 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=[] ) + self.upload_file( repository, + filename='column_maker/column_maker.tar', + filepath=None, + valid_tools_only=True, + uncompress_file=True, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded column_maker tarball.', + strings_displayed=[], + strings_not_displayed=[] ) + + def test_0015_create_filtering_repository( self ): + '''Create and populate filtering_0160.''' + category = self.create_category( name=category_name, description=category_description ) + repository = self.get_or_create_repository( name=filter_repository_name, + description=filter_repository_description, + long_description=filter_repository_long_description, + owner=common.test_user_1_name, + category_id=self.security.encode_id( category.id ), + strings_displayed=[] ) + self.upload_file( repository, + filename='filtering/filtering_1.1.0.tar', + filepath=None, + valid_tools_only=True, + uncompress_file=True, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded filtering 1.1.0 tarball.', + strings_displayed=[], + strings_not_displayed=[] ) + + def test_0020_create_repository_dependency( self ): + '''Create a repository dependency specifying convert_chars.''' + ''' + Each of the three repositories should depend on the other two, to make this as circular as possible. + ''' + filter_repository = test_db_util.get_repository_by_name_and_owner( filter_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 ) + convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) + dependency_xml_path = self.generate_temp_path( 'test_0160', additional_paths=[ 'column' ] ) + filter_revision = self.get_repository_tip( filter_repository ) + column_revision = self.get_repository_tip( column_repository ) + convert_revision = self.get_repository_tip( convert_repository ) + column_tuple = ( self.url, column_repository.name, column_repository.user.username, column_revision ) + convert_tuple = ( self.url, convert_repository.name, convert_repository.user.username, convert_revision ) + filter_tuple = ( self.url, filter_repository.name, filter_repository.user.username, filter_revision ) + self.create_repository_dependency( repository=column_repository, + repository_tuples=[ convert_tuple, filter_tuple], + filepath=dependency_xml_path, + prior_installation_required=False ) + self.create_repository_dependency( repository=convert_repository, + repository_tuples=[ column_tuple, filter_tuple ], + filepath=dependency_xml_path, + prior_installation_required=False ) + self.create_repository_dependency( repository=filter_repository, + repository_tuples=[ convert_tuple, column_tuple ], + filepath=dependency_xml_path, + prior_installation_required=True ) + + def test_0025_verify_repository_dependency( self ): + '''Verify that the previously generated repositiory dependency displays correctly.''' + filter_repository = test_db_util.get_repository_by_name_and_owner( filter_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 ) + convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) + self.check_repository_dependency( repository=column_repository, + depends_on_repository=convert_repository, + depends_on_changeset_revision=None, + changeset_revision=None ) + self.check_repository_dependency( repository=column_repository, + depends_on_repository=filter_repository, + depends_on_changeset_revision=None, + changeset_revision=None ) + self.check_repository_dependency( repository=convert_repository, + depends_on_repository=column_repository, + depends_on_changeset_revision=None, + changeset_revision=None ) + self.check_repository_dependency( repository=convert_repository, + depends_on_repository=filter_repository, + depends_on_changeset_revision=None, + changeset_revision=None ) + self.check_repository_dependency( repository=filter_repository, + depends_on_repository=column_repository, + depends_on_changeset_revision=None, + changeset_revision=None ) + self.check_repository_dependency( repository=filter_repository, + depends_on_repository=convert_repository, + depends_on_changeset_revision=None, + changeset_revision=None ) + This diff is so big that we needed to truncate the remainder. Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org