1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/2e96c23c760b/ changeset: 2e96c23c760b user: inithello date: 2013-01-11 23:02:42 summary: Tool shed functional tests for automated installation, reinstallation, and reactivation of repository dependencies. Enhancements to tool shed functional test framework. affected #: 6 files diff -r 9bdc2c2e95aa05e9cc8cd01599b224e1a3c6b26e -r 2e96c23c760b7d9259168e007bec52ffcdfa00a9 test/tool_shed/base/twilltestcase.py --- a/test/tool_shed/base/twilltestcase.py +++ b/test/tool_shed/base/twilltestcase.py @@ -103,10 +103,10 @@ url = '/repository/view_changelog?id=%s' % self.security.encode_id( repository.id ) self.visit_url( url ) self.check_for_strings( strings_displayed, strings_not_displayed ) - def check_repository_dependency( self, repository, depends_on_repository, depends_on_changeset_revision, changeset_revision=None ): - if changeset_revision is None: - changeset_revision = self.get_repository_tip( repository ) - strings_displayed = [ depends_on_repository.name, depends_on_repository.user.username, depends_on_changeset_revision ] + def check_repository_dependency( self, repository, depends_on_repository, depends_on_changeset_revision=None, changeset_revision=None ): + strings_displayed = [ depends_on_repository.name, depends_on_repository.user.username ] + if depends_on_changeset_revision: + strings_displayed.append( depends_on_changeset_revision ) self.display_manage_repository_page( repository, changeset_revision=changeset_revision, strings_displayed=strings_displayed ) def check_repository_metadata( self, repository, tip_only=True ): if tip_only: @@ -178,6 +178,15 @@ return '%s=%s&%s=%s' % ( field_name, field_value, field_name, field_value ) else: return '%s=%s' % ( field_name, field_value ) + 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', + filepath=filepath, + commit_message='Uploaded dependency on %s.' % ', '.join( repo.name for repo in depends_on ) ) def create_user_in_galaxy( self, cntrller='user', email='test@bx.psu.edu', password='testuser', username='admin-user', redirect='' ): self.visit_galaxy_url( "/user/create?cntrller=%s&use_panels=False" % cntrller ) tc.fv( '1', 'email', email ) @@ -247,11 +256,25 @@ 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: + if changeset_revision: url = '%s&changeset_revision=%s' % ( base_url, changeset_revision ) else: + changeset_revision = self.get_repository_tip( repository ) url = base_url self.visit_url( url ) + metadata = self.get_repository_metadata_by_changeset_revision( repository, changeset_revision ) + if metadata: + if 'tool_dependencies' in metadata.metadata: + strings_displayed.append( 'Tool dependencies' ) + for dependency in metadata.metadata[ 'tool_dependencies' ]: + if dependency == 'set_environment': + for environment_dependency in metadata.metadata[ 'tool_dependencies' ][ dependency ]: + strings_displayed.append( environment_dependency[ 'name' ] ) + strings_displayed.append( environment_dependency[ 'type' ] ) + else: + strings_displayed.append( metadata.metadata[ 'tool_dependencies' ][ dependency ][ 'name' ] ) + strings_displayed.append( metadata.metadata[ 'tool_dependencies' ][ dependency ][ 'version' ] ) + strings_displayed.append( metadata.metadata[ 'tool_dependencies' ][ dependency ][ 'type' ] ) self.check_for_strings( strings_displayed, strings_not_displayed ) def display_repository_clone_page( self, owner_name, repository_name, strings_displayed=[], strings_not_displayed=[] ): url = '/repos/%s/%s' % ( owner_name, repository_name ) @@ -384,6 +407,9 @@ return self.hgweb_config_manager.get_entry( lhs ) except: raise Exception( "Entry for repository %s missing in hgweb config file %s." % ( lhs, self.hgweb_config_manager.hgweb_config ) ) + def get_repository_changelog( self, repository ): + repo = hg.repository( ui.ui(), self.get_repo_path( repository ) ) + return [repo.changectx( changeset ) for changeset in repo.changelog ] def get_repository_datatypes_count( self, repository ): metadata = self.get_repository_metadata( repository )[0].metadata if 'datatypes' not in metadata: @@ -424,7 +450,7 @@ return [ metadata_revision for metadata_revision in repository.metadata_revisions ] def get_repository_metadata_by_changeset_revision( self, repository, changeset_revision ): found = None - for metadata_revision in self.get_repository_metadata( repository ): + for metadata_revision in repository.metadata_revisions: if metadata_revision.changeset_revision == changeset_revision: found = metadata_revision return found @@ -671,6 +697,30 @@ tc.formfile( "1", "file_data", self.get_filename( filename, filepath ) ) tc.submit( "upload_button" ) self.check_for_strings( strings_displayed, strings_not_displayed ) + # Uncomment this if it becomes necessary to wait for an asynchronous process to complete after submitting an upload. + #for i in range( 5 ): + # try: + # self.check_for_strings( strings_displayed, strings_not_displayed ) + # break + # except Exception, e: + # if i == 4: + # raise e + # else: + # time.sleep( 1 ) + # continue + def verify_installed_uninstalled_repositories( self, installed_repositories=[], uninstalled_repositories=[] ): + strings_displayed = [] + strings_not_displayed = [] + for repository_name, repository_owner in uninstalled_repositories: + repository = test_db_util.get_repository_by_name_and_owner( repository_name, repository_owner ) + strings_not_displayed.extend( [ repository_name, self.get_repository_tip( repository ) ] ) + for repository_name, repository_owner in installed_repositories: + repository = test_db_util.get_repository_by_name_and_owner( repository_name, repository_owner ) + galaxy_repository = test_db_util.get_installed_repository_by_name_owner( repository_name, repository_owner ) + if galaxy_repository: + assert galaxy_repository.status == 'Installed', 'Repository %s should be installed, but is %s' % ( repository_name, galaxy_repository.status ) + strings_displayed.extend( [ repository_name, self.get_repository_tip( repository ) ] ) + self.display_galaxy_browse_repositories_page( strings_displayed=strings_displayed, strings_not_displayed=strings_not_displayed ) def verify_installed_repository_metadata_unchanged( self, name, owner ): installed_repository = test_db_util.get_installed_repository_by_name_owner( name, owner ) metadata = installed_repository.metadata diff -r 9bdc2c2e95aa05e9cc8cd01599b224e1a3c6b26e -r 2e96c23c760b7d9259168e007bec52ffcdfa00a9 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 @@ -17,8 +17,20 @@ freebayes_repository_description = "Galaxy's freebayes tool" freebayes_repository_long_description = "Long description of Galaxy's freebayes tool" -default_category = 'test_0050_repository_n_level_circular_dependencies' -default_category_description = 'Testing handling of circular repository dependencies to n levels.' +column_repository_name = 'column_maker_0050' +column_repository_description = "Add column" +column_repository_long_description = "Compute an expression on every row" + +convert_repository_name = 'convert_chars_0050' +convert_repository_description = "Convert delimiters" +convert_repository_long_description = "Convert delimiters to tab" + +bismark_repository_name = 'bismark_0050' +bismark_repository_description = "A flexible aligner." +bismark_repository_long_description = "A flexible aligner and methylation caller for Bisulfite-Seq applications." + +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.''' @@ -34,30 +46,57 @@ 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=default_category, description=default_category_description ) - def test_0010_create_emboss_datatypes_repository( self ): + def test_0005_create_convert_repository( self ): + '''Create and populate convert_chars_0050.''' + 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, + 'convert_chars/convert_chars.tar', + strings_displayed=[], + commit_message='Uploaded convert_chars.tar.' ) + def test_0010_create_column_repository( self ): + '''Create and populate convert_chars_0050.''' + 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, + 'column_maker/column_maker.tar', + strings_displayed=[], + commit_message='Uploaded column_maker.tar.' ) + def test_0015_create_emboss_datatypes_repository( self ): '''Create and populate emboss_datatypes_0050.''' + 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=emboss_datatypes_repository_name, description=emboss_datatypes_repository_description, long_description=emboss_datatypes_repository_long_description, owner=common.test_user_1_name, - categories=[ default_category ], + category_id=self.security.encode_id( category.id ), strings_displayed=[] ) self.upload_file( repository, 'emboss/datatypes/datatypes_conf.xml', strings_displayed=[], commit_message='Uploaded datatypes_conf.xml.' ) - def test_0015_create_emboss_repository( self ): + def test_0020_create_emboss_repository( self ): '''Create and populate emboss_0050.''' + category = self.create_category( name=category_name, description=category_description ) repository = self.get_or_create_repository( name=emboss_repository_name, description=emboss_repository_description, long_description=emboss_repository_long_description, owner=common.test_user_1_name, - categories=[ default_category ], + category_id=self.security.encode_id( category.id ), strings_displayed=[] ) self.upload_file( repository, 'emboss/emboss.tar', @@ -72,13 +111,14 @@ 'repository_dependencies.xml', filepath=repository_dependencies_path, commit_message='Uploaded dependency on emboss_datatypes.' ) - def test_0020_create_filtering_repository( self ): + def test_0025_create_filtering_repository( self ): '''Create and populate filtering_0050.''' + category = self.create_category( name=category_name, description=category_description ) filtering_repository = self.get_or_create_repository( name=filtering_repository_name, description=filtering_repository_description, long_description=filtering_repository_long_description, owner=common.test_user_1_name, - categories=[ default_category ], + category_id=self.security.encode_id( category.id ), strings_displayed=[] ) self.upload_file( filtering_repository, 'filtering/filtering_1.1.0.tar', @@ -93,69 +133,95 @@ 'repository_dependencies.xml', filepath=repository_dependencies_path, commit_message='Uploaded dependency on emboss.' ) - def test_0025_create_freebayes_repository( self ): + def test_0030_create_freebayes_repository( self ): '''Create and populate freebayes_0050.''' + category = self.create_category( name=category_name, description=category_description ) repository = self.get_or_create_repository( name=freebayes_repository_name, description=freebayes_repository_description, long_description=freebayes_repository_long_description, owner=common.test_user_1_name, - categories=[ default_category ], + category_id=self.security.encode_id( category.id ), strings_displayed=[] ) self.upload_file( repository, 'freebayes/freebayes.tar', strings_displayed=[], commit_message='Uploaded freebayes.tar.' ) + def test_0035_create_bismark_repository( self ): + '''Create and populate bismark_0050.''' + category = self.create_category( name=category_name, description=category_description ) + repository = self.get_or_create_repository( name=bismark_repository_name, + description=bismark_repository_description, + long_description=bismark_repository_long_description, + owner=common.test_user_1_name, + category_id=self.security.encode_id( category.id ), + strings_displayed=[] ) + self.upload_file( repository, + 'bismark/bismark.tar', + strings_displayed=[], + valid_tools_only=False, + commit_message='Uploaded bismark.tar.' ) + 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 ) 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 ), - dependency_description='Emboss depends on the filtering repository.' ) - self.upload_file( emboss_repository, - 'repository_dependencies.xml', - filepath=repository_dependencies_path, - commit_message='Uploaded dependency on filtering.' ) - previous_tip = self.get_repository_tip( repository ) - self.generate_repository_dependency_xml( [ emboss_datatypes_repository, emboss_repository, filtering_repository, repository ], - self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), - dependency_description='Freebayes depends on the filtering repository.' ) - self.upload_file( repository, - 'repository_dependencies.xml', - filepath=repository_dependencies_path, - commit_message='Uploaded dependency on filtering.' ) - self.display_manage_repository_page( repository, strings_not_displayed=[ previous_tip ] ) - def test_0030_verify_repository_dependencies( self ): + freebayes_repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) + bismark_repository = test_db_util.get_repository_by_name_and_owner( bismark_repository_name, common.test_user_1_name ) + dependency_xml_path = self.generate_temp_path( 'test_0050', additional_paths=[ 'freebayes' ] ) + 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 ], + filepath=dependency_xml_path ) + self.create_repository_dependency( filtering_repository, depends_on=[ emboss_repository ], 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: - id: 2 key: http://localhost:8634__ESEP__freebayes_0050__ESEP__user1__ESEP__2e73d8e1b59d - ['http://localhost:8634', 'emboss_datatypes_0050', 'user1', '596029c334b1'] - ['http://localhost:8634', 'emboss_0050', 'user1', '9f1503046640'] - id: 3 key: http://localhost:8634__ESEP__filtering_0050__ESEP__user1__ESEP__eefdd8bc0db9 - ['http://localhost:8634', 'emboss_0050', 'user1', '9f1503046640'] - id: 4 key: http://localhost:8634__ESEP__emboss_0050__ESEP__user1__ESEP__9f1503046640 - ['http://localhost:8634', 'emboss_datatypes_0050', 'user1', '596029c334b1'] + id: 2 key: http://toolshed.local:10001__ESEP__filtering__ESEP__test__ESEP__871602b4276b + ['http://toolshed.local:10001', 'emboss_5', 'test', '8de5fe0d7b04'] + id: 3 key: http://toolshed.local:10001__ESEP__emboss_datatypes__ESEP__test__ESEP__dbd4f... + ['http://toolshed.local:10001', 'freebayes', 'test', 'f40028114098'] + id: 4 key: http://toolshed.local:10001__ESEP__freebayes__ESEP__test__ESEP__f40028114098 + ['http://toolshed.local:10001', 'emboss_datatypes', 'test', 'dbd4f68bf507'] + ['http://toolshed.local:10001', 'emboss_5', 'test', '8de5fe0d7b04'] + ['http://toolshed.local:10001', 'column_maker', 'test', '83e956bdbac0'] + id: 5 key: http://toolshed.local:10001__ESEP__column_maker__ESEP__test__ESEP__83e956bdb... + ['http://toolshed.local:10001', 'convert_chars', 'test', 'b28134220c8a'] + id: 6 key: http://toolshed.local:10001__ESEP__convert_chars__ESEP__test__ESEP__b2813422... + ['http://toolshed.local:10001', 'column_maker', 'test', '83e956bdbac0'] + id: 7 key: http://toolshed.local:10001__ESEP__emboss_5__ESEP__test__ESEP__8de5fe0d7b04 + ['http://toolshed.local:10001', 'emboss_datatypes', 'test', 'dbd4f68bf507'] ''' 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 ): - self.check_repository_dependency( freebayes_repository, emboss_repository, changeset_revision ) + 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 ) + bismark_repository = test_db_util.get_repository_by_name_and_owner( bismark_repository_name, common.test_user_1_name ) + self.check_repository_dependency( convert_repository, column_repository ) + self.check_repository_dependency( column_repository, convert_repository ) + self.check_repository_dependency( emboss_datatypes_repository, bismark_repository ) + self.check_repository_dependency( emboss_repository, emboss_datatypes_repository ) + self.check_repository_dependency( filtering_repository, emboss_repository ) + for repository in [ emboss_datatypes_repository, emboss_repository, column_repository ]: + self.check_repository_dependency( freebayes_repository, repository ) + freebayes_dependencies = [ freebayes_repository, emboss_datatypes_repository, emboss_repository, column_repository ] + strings_displayed = [ '%s depends on %s.' % ( freebayes_repository.name, ', '.join( repo.name for repo in freebayes_dependencies ) ) ] self.display_manage_repository_page( freebayes_repository, - strings_displayed=[ 'Freebayes depends on the filtering repository.' ] ) - def test_0035_verify_tool_dependencies( self ): + 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 ) emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) self.display_manage_repository_page( freebayes_repository, strings_displayed=[ 'freebayes', '0.9.4_9696d0ce8a9', 'samtools', '0.1.18', 'Tool dependencies' ] ) self.display_manage_repository_page( emboss_repository, strings_displayed=[ 'Tool dependencies', 'emboss', '5.0.0', 'package' ] ) - def test_0040_verify_repository_metadata( self ): + 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 ) emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) diff -r 9bdc2c2e95aa05e9cc8cd01599b224e1a3c6b26e -r 2e96c23c760b7d9259168e007bec52ffcdfa00a9 test/tool_shed/functional/test_0070_invalid_tool.py --- a/test/tool_shed/functional/test_0070_invalid_tool.py +++ b/test/tool_shed/functional/test_0070_invalid_tool.py @@ -45,5 +45,6 @@ remove_repo_files_not_in_tar='No', commit_message='Uploaded an updated tool xml.' ) valid_revision = self.get_repository_tip( repository ) + test_db_util.refresh( repository ) self.check_repository_tools_for_changeset_revision( repository, valid_revision ) self.check_repository_invalid_tools_for_changeset_revision( repository, invalid_revision ) diff -r 9bdc2c2e95aa05e9cc8cd01599b224e1a3c6b26e -r 2e96c23c760b7d9259168e007bec52ffcdfa00a9 test/tool_shed/functional/test_1050_circular_dependencies_4_levels.py --- /dev/null +++ b/test/tool_shed/functional/test_1050_circular_dependencies_4_levels.py @@ -0,0 +1,314 @@ +from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os +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" +emboss_datatypes_repository_long_description = "Long description of Emboss' datatypes" + +emboss_repository_name = 'emboss_0050' +emboss_repository_description = "Galaxy's emboss tool" +emboss_repository_long_description = "Long description of Galaxy's emboss tool" + +filtering_repository_name = 'filtering_0050' +filtering_repository_description = "Galaxy's filtering tool" +filtering_repository_long_description = "Long description of Galaxy's filtering tool" + +freebayes_repository_name = 'freebayes_0050' +freebayes_repository_description = "Galaxy's freebayes tool" +freebayes_repository_long_description = "Long description of Galaxy's freebayes tool" + +column_repository_name = 'column_maker_0050' +column_repository_description = "Add column" +column_repository_long_description = "Compute an expression on every row" + +convert_repository_name = 'convert_chars_0050' +convert_repository_description = "Convert delimiters" +convert_repository_long_description = "Convert delimiters to tab" + +bismark_repository_name = 'bismark_0050' +bismark_repository_description = "A flexible aligner." +bismark_repository_long_description = "A flexible aligner and methylation caller for Bisulfite-Seq applications." + +category_name = 'Test 0050 Circular Dependencies 5 Levels' +category_description = 'Test circular dependency features' + +running_standalone = False + +class TestInstallRepositoryCircularDependencies( 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() + 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_0050.''' + category = self.create_category( name=category_name, description=category_description ) + global running_standalone + self.logout() + self.login( email=common.test_user_1_email, username=common.test_user_1_name ) + repository = self.get_or_create_repository( name=convert_repository_name, + description=convert_repository_description, + long_description=convert_repository_long_description, + owner=common.test_user_1_name, + category_id=self.security.encode_id( category.id ), + strings_displayed=[] ) + if self.repository_is_new( repository ): + running_standalone = True + self.upload_file( repository, + 'convert_chars/convert_chars.tar', + strings_displayed=[], + commit_message='Uploaded convert_chars.tar.' ) + def test_0010_create_column_repository( self ): + '''Create and populate convert_chars_0050.''' + 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=[] ) + if self.repository_is_new( repository ): + self.upload_file( repository, + 'column_maker/column_maker.tar', + strings_displayed=[], + commit_message='Uploaded column_maker.tar.' ) + def test_0015_create_emboss_datatypes_repository( self ): + '''Create and populate emboss_datatypes_0050.''' + category = self.create_category( name=category_name, description=category_description ) + repository = self.get_or_create_repository( name=emboss_datatypes_repository_name, + description=emboss_datatypes_repository_description, + long_description=emboss_datatypes_repository_long_description, + owner=common.test_user_1_name, + category_id=self.security.encode_id( category.id ), + strings_displayed=[] ) + if self.repository_is_new( repository ): + self.upload_file( repository, + 'emboss/datatypes/datatypes_conf.xml', + strings_displayed=[], + commit_message='Uploaded datatypes_conf.xml.' ) + def test_0020_create_emboss_repository( self ): + '''Create and populate emboss_0050.''' + category = self.create_category( name=category_name, description=category_description ) + repository = self.get_or_create_repository( name=emboss_repository_name, + description=emboss_repository_description, + long_description=emboss_repository_long_description, + owner=common.test_user_1_name, + category_id=self.security.encode_id( category.id ), + strings_displayed=[] ) + if self.repository_is_new( repository ): + self.upload_file( repository, + 'emboss/emboss.tar', + strings_displayed=[], + commit_message='Uploaded tool tarball.' ) + def test_0025_create_filtering_repository( self ): + '''Create and populate filtering_0050.''' + category = self.create_category( name=category_name, description=category_description ) + repository = self.get_or_create_repository( name=filtering_repository_name, + description=filtering_repository_description, + long_description=filtering_repository_long_description, + owner=common.test_user_1_name, + category_id=self.security.encode_id( category.id ), + strings_displayed=[] ) + if self.repository_is_new( repository ): + self.upload_file( repository, + 'filtering/filtering_1.1.0.tar', + strings_displayed=[], + commit_message='Uploaded filtering.tar.' ) + def test_0030_create_freebayes_repository( self ): + '''Create and populate freebayes_0050.''' + category = self.create_category( name=category_name, description=category_description ) + repository = self.get_or_create_repository( name=freebayes_repository_name, + description=freebayes_repository_description, + long_description=freebayes_repository_long_description, + owner=common.test_user_1_name, + category_id=self.security.encode_id( category.id ), + strings_displayed=[] ) + if self.repository_is_new( repository ): + self.upload_file( repository, + 'freebayes/freebayes.tar', + strings_displayed=[], + commit_message='Uploaded freebayes.tar.' ) + def test_0035_create_bismark_repository( self ): + '''Create and populate bismark_0050.''' + category = self.create_category( name=category_name, description=category_description ) + repository = self.get_or_create_repository( name=bismark_repository_name, + description=bismark_repository_description, + long_description=bismark_repository_long_description, + owner=common.test_user_1_name, + category_id=self.security.encode_id( category.id ), + strings_displayed=[] ) + if self.repository_is_new( repository ): + self.upload_file( repository, + 'bismark/bismark.tar', + strings_displayed=[], + valid_tools_only=False, + commit_message='Uploaded bismark.tar.' ) + def test_0040_create_and_upload_dependency_definitions( self ): + '''Set up the dependency structure.''' + global running_standalone + if running_standalone: + 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 ) + 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 ) + bismark_repository = test_db_util.get_repository_by_name_and_owner( bismark_repository_name, common.test_user_1_name ) + dependency_xml_path = self.generate_temp_path( 'test_1050', additional_paths=[ 'dependencies' ] ) + 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 ], + filepath=dependency_xml_path ) + self.create_repository_dependency( filtering_repository, depends_on=[ emboss_repository ], 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: + + id: 2 key: http://toolshed.local:10001__ESEP__filtering__ESEP__test__ESEP__871602b4276b + ['http://toolshed.local:10001', 'emboss_5', 'test', '8de5fe0d7b04'] + id: 3 key: http://toolshed.local:10001__ESEP__emboss_datatypes__ESEP__test__ESEP__dbd4f... + ['http://toolshed.local:10001', 'freebayes', 'test', 'f40028114098'] + id: 4 key: http://toolshed.local:10001__ESEP__freebayes__ESEP__test__ESEP__f40028114098 + ['http://toolshed.local:10001', 'emboss_datatypes', 'test', 'dbd4f68bf507'] + ['http://toolshed.local:10001', 'emboss_5', 'test', '8de5fe0d7b04'] + ['http://toolshed.local:10001', 'column_maker', 'test', '83e956bdbac0'] + id: 5 key: http://toolshed.local:10001__ESEP__column_maker__ESEP__test__ESEP__83e956bdb... + ['http://toolshed.local:10001', 'convert_chars', 'test', 'b28134220c8a'] + id: 6 key: http://toolshed.local:10001__ESEP__convert_chars__ESEP__test__ESEP__b2813422... + ['http://toolshed.local:10001', 'column_maker', 'test', '83e956bdbac0'] + id: 7 key: http://toolshed.local:10001__ESEP__emboss_5__ESEP__test__ESEP__8de5fe0d7b04 + ['http://toolshed.local:10001', 'emboss_datatypes', 'test', 'dbd4f68bf507'] + ''' + 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 ) + 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 ) + bismark_repository = test_db_util.get_repository_by_name_and_owner( bismark_repository_name, common.test_user_1_name ) + self.check_repository_dependency( convert_repository, column_repository ) + self.check_repository_dependency( column_repository, convert_repository ) + self.check_repository_dependency( emboss_datatypes_repository, bismark_repository ) + self.check_repository_dependency( emboss_repository, emboss_datatypes_repository ) + self.check_repository_dependency( filtering_repository, emboss_repository ) + for repository in [ emboss_datatypes_repository, emboss_repository, column_repository ]: + self.check_repository_dependency( freebayes_repository, repository ) + freebayes_dependencies = [ freebayes_repository, emboss_datatypes_repository, emboss_repository, column_repository ] + strings_displayed = [ '%s depends on %s.' % ( freebayes_repository.name, ', '.join( repo.name for repo in freebayes_dependencies ) ) ] + 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 ) + emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) + self.display_manage_repository_page( freebayes_repository, + strings_displayed=[ 'freebayes', '0.9.4_9696d0ce8a9', 'samtools', '0.1.18', 'Tool dependencies' ] ) + self.display_manage_repository_page( emboss_repository, strings_displayed=[ 'Tool dependencies', 'emboss', '5.0.0', 'package' ] ) + def test_0055_install_column_repository( self ): + '''Install column_maker with repository dependencies.''' + self.galaxy_logout() + self.galaxy_login( email=common.admin_email, username=common.admin_username ) + self.install_repository( column_repository_name, + common.test_user_1_name, + category_name, + install_tool_dependencies=False, + install_repository_dependencies=True, + new_tool_panel_section='column_maker' ) + installed_repositories = [ ( column_repository_name, common.test_user_1_name ), + ( convert_repository_name, common.test_user_1_name ) ] + uninstalled_repositories = [ ( emboss_datatypes_repository_name, common.test_user_1_name ), + ( emboss_repository_name, common.test_user_1_name ), + ( filtering_repository_name, common.test_user_1_name ), + ( freebayes_repository_name, common.test_user_1_name ), + ( bismark_repository_name, common.test_user_1_name ) ] + self.verify_installed_uninstalled_repositories( installed_repositories=installed_repositories, uninstalled_repositories=uninstalled_repositories ) + def test_0060_install_emboss_repository( self ): + '''Install emboss_5 with repository dependencies.''' + global running_standalone + original_datatypes = self.get_datatypes_count() + self.install_repository( emboss_repository_name, + common.test_user_1_name, + category_name, + install_tool_dependencies=False, + install_repository_dependencies=True, + new_tool_panel_section='emboss_5_0050' ) + if running_standalone: + assert original_datatypes < self.get_datatypes_count(), 'Installing a repository that depends on emboss_datatypes did not add datatypes.' + installed_repositories = [ ( emboss_datatypes_repository_name, common.test_user_1_name ), + ( column_repository_name, common.test_user_1_name ), + ( emboss_repository_name, common.test_user_1_name ), + ( convert_repository_name, common.test_user_1_name ), + ( bismark_repository_name, common.test_user_1_name ) ] + uninstalled_repositories = [ ( filtering_repository_name, common.test_user_1_name ), + ( freebayes_repository_name, common.test_user_1_name ) ] + self.verify_installed_uninstalled_repositories( installed_repositories=installed_repositories, uninstalled_repositories=uninstalled_repositories ) + def test_0065_deactivate_datatypes_repository( self ): + '''Deactivate emboss_datatypes and verify that the datatypes count is reduced.''' + original_datatypes = self.get_datatypes_count() + repository = test_db_util.get_installed_repository_by_name_owner( emboss_datatypes_repository_name, common.test_user_1_name ) + self.uninstall_repository( repository, remove_from_disk=False ) + assert original_datatypes > self.get_datatypes_count(), 'Deactivating emboss_datatypes did not remove datatypes.' + installed_repositories = [ ( column_repository_name, common.test_user_1_name ), + ( emboss_repository_name, common.test_user_1_name ), + ( convert_repository_name, common.test_user_1_name ), + ( bismark_repository_name, common.test_user_1_name ) ] + uninstalled_repositories = [ ( emboss_datatypes_repository_name, common.test_user_1_name ), + ( filtering_repository_name, common.test_user_1_name ), + ( freebayes_repository_name, common.test_user_1_name ) ] + self.verify_installed_uninstalled_repositories( installed_repositories=installed_repositories, uninstalled_repositories=uninstalled_repositories ) + strings_not_displayed = [ repository.name, repository.installed_changeset_revision ] + self.display_galaxy_browse_repositories_page( strings_not_displayed=strings_not_displayed ) + def test_0070_uninstall_emboss_repository( self ): + '''Uninstall the emboss_5 repository.''' + repository = test_db_util.get_installed_repository_by_name_owner( emboss_repository_name, common.test_user_1_name ) + self.uninstall_repository( repository, remove_from_disk=True ) + strings_not_displayed = [ repository.name, repository.installed_changeset_revision ] + self.display_galaxy_browse_repositories_page( strings_not_displayed=strings_not_displayed ) + test_db_util.ga_refresh( repository ) + self.check_galaxy_repository_tool_panel_section( repository, 'emboss_5_0050' ) + installed_repositories = [ ( column_repository_name, common.test_user_1_name ), + ( convert_repository_name, common.test_user_1_name ), + ( bismark_repository_name, common.test_user_1_name ) ] + uninstalled_repositories = [ ( emboss_datatypes_repository_name, common.test_user_1_name ), + ( emboss_repository_name, common.test_user_1_name ), + ( filtering_repository_name, common.test_user_1_name ), + ( freebayes_repository_name, common.test_user_1_name ) ] + self.verify_installed_uninstalled_repositories( installed_repositories=installed_repositories, uninstalled_repositories=uninstalled_repositories ) + def test_0075_install_freebayes_repository( self ): + '''Install freebayes with repository dependencies. This should also automatically reactivate emboss_datatypes and reinstall emboss_5.''' + original_datatypes = self.get_datatypes_count() + strings_displayed = [ 'Handle', 'tool dependencies', 'freebayes', '0.9.4_9696d0ce8a9', 'samtools', '0.1.18' ] + self.install_repository( freebayes_repository_name, + common.test_user_1_name, + category_name, + strings_displayed=strings_displayed, + install_tool_dependencies=False, + install_repository_dependencies=True, + new_tool_panel_section='freebayes' ) + assert original_datatypes < self.get_datatypes_count(), 'Installing a repository that depends on emboss_datatypes did not add datatypes.' + emboss_repository = test_db_util.get_installed_repository_by_name_owner( emboss_repository_name, common.test_user_1_name ) + datatypes_repository = test_db_util.get_installed_repository_by_name_owner( emboss_datatypes_repository_name, common.test_user_1_name ) + strings_displayed = [ emboss_repository.name, + emboss_repository.installed_changeset_revision, + datatypes_repository.name, + datatypes_repository.installed_changeset_revision ] + self.display_galaxy_browse_repositories_page( strings_displayed=strings_displayed ) + installed_repositories = [ ( column_repository_name, common.test_user_1_name ), + ( emboss_datatypes_repository_name, common.test_user_1_name ), + ( emboss_repository_name, common.test_user_1_name ), + ( freebayes_repository_name, common.test_user_1_name ), + ( convert_repository_name, common.test_user_1_name ), + ( bismark_repository_name, common.test_user_1_name ) ] + uninstalled_repositories = [ ( filtering_repository_name, common.test_user_1_name ) ] + self.verify_installed_uninstalled_repositories( installed_repositories=installed_repositories, uninstalled_repositories=uninstalled_repositories ) + diff -r 9bdc2c2e95aa05e9cc8cd01599b224e1a3c6b26e -r 2e96c23c760b7d9259168e007bec52ffcdfa00a9 test/tool_shed/functional/test_1080_advanced_circular_dependency_installation.py --- a/test/tool_shed/functional/test_1080_advanced_circular_dependency_installation.py +++ b/test/tool_shed/functional/test_1080_advanced_circular_dependency_installation.py @@ -210,10 +210,8 @@ common.test_user_1_name ) self.uninstall_repository( installed_convert_repository, remove_from_disk=False ) strings_not_displayed = [ installed_column_repository.name, - installed_column_repository.description, installed_column_repository.installed_changeset_revision, installed_convert_repository.name, - installed_convert_repository.description, installed_convert_repository.installed_changeset_revision ] self.display_galaxy_browse_repositories_page( strings_not_displayed=strings_not_displayed ) def test_0050_reactivate_column_repository( self ): diff -r 9bdc2c2e95aa05e9cc8cd01599b224e1a3c6b26e -r 2e96c23c760b7d9259168e007bec52ffcdfa00a9 test/tool_shed/functional_tests.py --- a/test/tool_shed/functional_tests.py +++ b/test/tool_shed/functional_tests.py @@ -139,6 +139,7 @@ galaxy_file_path = os.path.join( galaxy_db_path, 'files' ) hgweb_config_file_path = tempfile.mkdtemp( dir=tool_shed_test_tmp_dir ) new_repos_path = tempfile.mkdtemp( dir=tool_shed_test_tmp_dir ) + galaxy_tempfiles = tempfile.mkdtemp( dir=tool_shed_test_tmp_dir ) galaxy_shed_tool_path = tempfile.mkdtemp( dir=tool_shed_test_tmp_dir ) galaxy_tool_dependency_dir = tempfile.mkdtemp( dir=tool_shed_test_tmp_dir ) os.environ[ 'GALAXY_TEST_TOOL_DEPENDENCY_DIR' ] = galaxy_tool_dependency_dir @@ -269,6 +270,7 @@ database_connection = galaxy_database_connection, database_engine_option_pool_size = '10', file_path = galaxy_file_path, + new_file_path = galaxy_tempfiles, tool_path = tool_path, tool_data_path = tool_data_path, shed_tool_path = galaxy_shed_tool_path, 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.