def test_0060_search_for_bwa_tools( self ): '''Search for and install the repositories with BWA tools, and verify that this reinstalls emboss_datatypes and reactivates filtering.''' 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 ) bwa_base_revision = self.get_repository_tip( bwa_base_repository ) bwa_color_revision = self.get_repository_tip( bwa_color_repository ) self.search_for_valid_tools( search_fields={ 'tool_id': 'bwa' }, exact_matches=False, from_galaxy=True, strings_displayed=[ 'bwa_color_0090', 'bwa_base_0090', bwa_base_revision, bwa_color_revision ] ) strings_displayed=[ 'freebayes_0090', 'emboss_0090', 'filtering_0090' ] strings_displayed.extend( [ 'bwa_color_0090', 'bwa_base_0090' ] ) strings_displayed.extend( [ 'bwa', 'Handle', 'tool dependencies' ] ) repositories_to_install = [ bwa_color_repository, bwa_base_repository ] # BWA is a good candidate for testing the installation of tool dependencies, but it is a core requirement of functional # tests that they be able to run independently of any network connection or remote data. # # After this test, the repositories should be in the following state: # Installed: bwa_color, bwa_base, emboss_datatypes, emboss, filtering, freebayes self.install_repositories_from_search_results( repositories_to_install, install_repository_dependencies='True', install_tool_dependencies=False, new_tool_panel_section='bwa_1090', strings_displayed=strings_displayed ) installed_repositories = [ ( emboss_repository_name, common.test_user_1_name ), ( filtering_repository_name, common.test_user_1_name ), ( bwa_color_repository_name, common.test_user_1_name ), ( bwa_base_repository_name, common.test_user_1_name ), ( emboss_datatypes_repository_name, common.test_user_1_name ), ( freebayes_repository_name, common.test_user_1_name ) ] strings_displayed = [ 'emboss_datatypes_0090', 'filtering_0090', 'emboss_0090', 'bwa_color_0090', 'bwa_base_0090', 'freebayes_0090' ] self.display_galaxy_browse_repositories_page( strings_displayed=strings_displayed ) self.verify_installed_repositories( installed_repositories )
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 ) 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_0080_url_upload_to_complex_test( self ): '''Populate repository_dependency_test_4_0460.''' ''' This is step 16 - Upload to repository_dependency_test_5_0460 using the url hg://<tool shed url>/repos/user1/hg_subfolder_repository_dependency_0460. ''' url = 'hg://%s:%s/repos/user1/hg_subfolder_repository_dependency_0460' % ( self.host, self.port ) repository = test_db_util.get_repository_by_name_and_owner( 'repository_dependency_test_5_0460', common.test_user_1_name ) package_repository = test_db_util.get_repository_by_name_and_owner( 'emboss_datatypes_0460', common.test_user_1_name ) self.upload_url( repository, url=url, filepath=None, valid_tools_only=True, uncompress_file=False, remove_repo_files_not_in_tar=True, commit_message='Uploaded repository dependency definition.', strings_displayed=[], strings_not_displayed=[] ) changeset_revision = self.get_repository_tip( package_repository ) strings_displayed = [ 'emboss_datatypes_0460', 'user1', changeset_revision ] self.display_manage_repository_page( repository, strings_displayed=strings_displayed ) self.display_repository_file_contents( repository, filename='repository_dependencies.xml', filepath='subfolder', strings_displayed=[ changeset_revision ] )
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' ] ) 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_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', '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_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_0020_create_repository_dependencies( self ): '''Set up the filtering and freebayes repository dependencies.''' # The dependency structure should look like: # Filtering revision 0 -> freebayes revision 0. # Freebayes revision 0 -> filtering revision 1. # Filtering will have two revisions, one with just the filtering tool, and one with the filtering tool and a dependency on freebayes. global running_standalone if running_standalone: 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, 'repository_dependencies.xml', filepath=repository_dependencies_path, commit_message='Uploaded dependency on freebayes' ) 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, 'repository_dependencies.xml', filepath=repository_dependencies_path, commit_message='Uploaded dependency on filtering' )
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', 'package' ] ) self.display_manage_repository_page( emboss_repository, strings_displayed=[ 'Tool dependencies', 'emboss', '5.0.0', 'package' ] )
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 )
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.""" base_repository = test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name ) tool_repository = test_db_util.get_repository_by_name_and_owner( bwa_tool_repository_name, common.test_user_1_name ) previous_changeset = self.get_repository_tip(tool_repository) old_tool_dependency = self.get_filename(os.path.join("bwa", "complex", "readme", "tool_dependencies.xml")) new_tool_dependency_path = self.generate_temp_path("test_1100", additional_paths=["tool_dependency"]) xml_filename = os.path.abspath(os.path.join(new_tool_dependency_path, "tool_dependencies.xml")) # Generate a tool_dependencies.xml file that points to an arbitrary file in the local filesystem. file(xml_filename, "w").write( file(old_tool_dependency, "r").read().replace("__PATH__", self.get_filename("bwa/complex")) ) self.upload_file( tool_repository, xml_filename, filepath=new_tool_dependency_path, strings_displayed=[], commit_message="Uploaded new tool_dependencies.xml.", ) # Verify that the dependency display has been updated as a result of the new tool_dependencies.xml file. self.display_manage_repository_page( base_repository, strings_displayed=[self.get_repository_tip(tool_repository), "bwa", "0.5.9", "package"], strings_not_displayed=[previous_changeset], )
def test_0035_generate_complex_repository_dependency(self): """Generate and upload a valid tool_dependencies.xml file that specifies bwa_tool_repository_0100.""" base_repository = test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name ) 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 = tool_repository.name owner = tool_repository.user.username 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" ) self.upload_file( base_repository, "tool_dependencies.xml", valid_tools_only=True, filepath=dependency_path, commit_message="Uploaded valid complex dependency on bwa_tool_0100.", ) self.check_repository_dependency(base_repository, tool_repository) self.display_manage_repository_page(base_repository, strings_displayed=["bwa", "0.5.9", "package"])
def test_0040_update_tool_repository( self ): '''Upload a new tool_dependencies.xml to the tool repository, and verify that the base repository displays the new changeset.''' global running_standalone if running_standalone: base_repository = test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name ) tool_repository = test_db_util.get_repository_by_name_and_owner( bwa_package_repository_name, common.test_user_1_name ) previous_changeset = self.get_repository_tip( tool_repository ) old_tool_dependency = self.get_filename( os.path.join( 'bwa', 'complex', 'readme', 'tool_dependencies.xml' ) ) new_tool_dependency_path = self.generate_temp_path( 'test_1100', additional_paths=[ 'tool_dependency' ] ) xml_filename = os.path.abspath( os.path.join( new_tool_dependency_path, 'tool_dependencies.xml' ) ) file( xml_filename, 'w' ).write( file( old_tool_dependency, 'r' ) .read().replace( '__PATH__', self.get_filename( 'bwa/complex' ) ) ) self.upload_file( tool_repository, filename=xml_filename, filepath=new_tool_dependency_path, valid_tools_only=True, uncompress_file=False, remove_repo_files_not_in_tar=False, commit_message='Uploaded new tool_dependencies.xml.', strings_displayed=[], strings_not_displayed=[] ) # Verify that the dependency display has been updated as a result of the new tool_dependencies.xml file. self.display_manage_repository_page( base_repository, strings_displayed=[ self.get_repository_tip( tool_repository ), 'bwa', '0.5.9', 'package' ], strings_not_displayed=[ previous_changeset ] )
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' ] ) 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_0015_create_dependency_on_datatypes_repository( self ): '''Create a dependency definition file that specifies emboss_datatypes_0430 and upload it to emboss_0430.''' emboss_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 ) dependency_xml_path = self.generate_temp_path( 'test_0430', additional_paths=[ 'dependencies' ] ) datatypes_tuple = ( self.url, datatypes_repository.name, datatypes_repository.user.username, self.get_repository_tip( datatypes_repository ) ) self.create_repository_dependency( repository=emboss_repository, repository_tuples=[ datatypes_tuple ], filepath=dependency_xml_path ) self.check_repository_dependency( emboss_repository, datatypes_repository )
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 ) 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, freebayes_repository, filtering_repository ]: self.verify_unchanged_repository_metadata( repository )
def test_0015_create_and_upload_dependency_files( self ): convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) column_repository = test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name ) repository_dependencies_path = self.generate_temp_path( 'test_1085', additional_paths=[ 'column' ] ) 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 ) 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_0040_verify_repository_dependency( self ): '''Verify the created repository dependency.''' ''' We are at step 3a. Check the newly created repository dependency to ensure that it was defined and displays correctly. ''' 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 ) self.check_repository_dependency( tool_repository, datatypes_repository )
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, 'repository_dependencies.xml', filepath=repository_dependencies_path, commit_message='Uploaded repository_dependencies.xml' )
def test_0060_create_dependency_structure( self ): '''Create the dependency structure for test 0040.''' global running_standalone if running_standalone: freebayes_repository = test_db_util.get_repository_by_name_and_owner( 'freebayes_0040', common.test_user_1_name ) filtering_repository = test_db_util.get_repository_by_name_and_owner( 'filtering_0040', common.test_user_1_name ) repository_dependencies_path = self.generate_temp_path( 'test_0340', additional_paths=[ 'dependencies' ] ) freebayes_tuple = ( self.url, freebayes_repository.name, freebayes_repository.user.username, self.get_repository_tip( freebayes_repository ) ) filtering_tuple = ( self.url, filtering_repository.name, filtering_repository.user.username, self.get_repository_tip( filtering_repository ) ) self.create_repository_dependency( repository=filtering_repository, repository_tuples=[ freebayes_tuple ], filepath=repository_dependencies_path ) self.create_repository_dependency( repository=freebayes_repository, repository_tuples=[ filtering_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: # Filtering revision 0 -> freebayes revision 0. # Freebayes revision 0 -> filtering revision 1. # Filtering will have two revisions, one with just the filtering tool, and one with the filtering tool and a dependency on freebayes. repository = 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' ] ) 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 ) freebayes_repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name ) # The dependency structure should look like: # Filtering revision 0 -> freebayes revision 0. # Freebayes revision 0 -> filtering revision 1. # Filtering will have two revisions, one with just the filtering tool, and one with the filtering tool and a dependency on freebayes. # 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_0015_upload_dependency_xml_if_needed( self ): '''If this test is being run by itself, it will not have repository dependencies configured yet.''' global running_standalone if running_standalone: convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) column_repository = test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name ) repository_dependencies_path = self.generate_temp_path( 'test_1080', additional_paths=[ 'convert' ] ) 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 ) 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_0015_generate_repository_dependencies_for_emboss_5( self ): '''Generate a repository_dependencies.xml file specifying emboss_datatypes and upload it to the emboss_5 repository.''' datatypes_repository = 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, 'repository_dependencies.xml', filepath=repository_dependencies_path, commit_message='Uploaded repository_depepndencies.xml.' )
def test_0025_create_repository_dependency( self ): '''Create a repository dependency on blast_datatypes_0120.''' ''' We are at step 3. Create a simple repository dependency for blastxml_to_top_descr_0120 that defines a dependency on blast_datatypes_0120. ''' 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' ] ) 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_0030_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, 'repository_dependencies.xml', filepath=repository_dependencies_path, commit_message='Uploaded dependency configuration specifying emboss_6' )
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, 'repository_dependencies.xml', filepath=repository_dependencies_path, commit_message='Uploaded dependency on column' )
def test_0035_browse_repository_dependencies( self ): '''Browse repository dependencies and look for a dependency on emboss_datatypes_0430.''' ''' We are at step 3. Verify that the browse repository dependencies page shows emboss_datatypes_0430 as a dependency of emboss_0430. ''' emboss_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 ) datatypes_changeset_revision = self.get_repository_tip( datatypes_repository ) emboss_changeset_revision = self.get_repository_tip( emboss_repository ) strings_displayed = [ datatypes_changeset_revision, emboss_changeset_revision, 'emboss_datatypes_0430', 'user1', 'emboss_0430' ] self.browse_repository_dependencies( strings_displayed=strings_displayed )
def test_0020_verify_generated_dependency( self ): '''Verify that matplotlib now has a package tool dependency and a complex repository dependency.''' ''' This is step 3 - Verify that package_matplotlib_1_2_0170 now depends on package_numpy_1_7_0170, and that the inherited tool dependency displays correctly. 'Inhherited' in this case means that matplotlib should show a package tool dependency on numpy version 1.7, and a repository dependency on the latest revision of package_numpy_1_7_0170. ''' numpy_repository = test_db_util.get_repository_by_name_and_owner( numpy_repository_name, common.test_user_1_name ) matplotlib_repository = test_db_util.get_repository_by_name_and_owner( matplotlib_repository_name, common.test_user_1_name ) changeset_revision = self.get_repository_tip( numpy_repository ) self.check_repository_dependency( matplotlib_repository, depends_on_repository=numpy_repository ) self.display_manage_repository_page( matplotlib_repository, strings_displayed=[ 'numpy', '1.7', 'package', changeset_revision ] )
def test_0045_reset_repository_metadata( self ): '''Reset metadata on package_emboss_5_0_0_0470 and package_x11_client_1_5_proto_7_0.''' ''' This is step 9 - Reset metadata on the package_emboss_5_0_0 and package_x11_client_1_5_proto_7_0 repositories. They should now have only their tip as the installable revision. ''' package_emboss_repository = test_db_util.get_repository_by_name_and_owner( package_emboss_repository_name, common.test_user_1_name ) package_x11_repository = test_db_util.get_repository_by_name_and_owner( package_libx11_repository_name, common.test_user_1_name ) self.reset_repository_metadata( package_emboss_repository ) self.reset_repository_metadata( package_x11_repository ) assert len( package_emboss_repository.metadata_revisions ) == 1, 'Repository package_emboss_5_0_0 has %d installable revisions, expected 1.' % \ len( package_emboss_repository.metadata_revisions ) assert len( package_x11_repository.metadata_revisions ) == 1, 'Repository package_x11_client_1_5_proto_7_0 has %d installable revisions, expected 1.' % \ len( package_x11_repository.metadata_revisions )
def test_0045_install_base_repository( self ): '''Verify installation of the repository with complex repository dependencies.''' self.galaxy_logout() self.galaxy_login( email=common.admin_email, username=common.admin_username ) base_repository = test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name ) tool_repository = test_db_util.get_repository_by_name_and_owner( bwa_tool_repository_name, common.test_user_1_name ) preview_strings_displayed = [ tool_repository.name, self.get_repository_tip( tool_repository ) ] self.install_repository( bwa_base_repository_name, common.test_user_1_name, category_name, install_tool_dependencies=True, preview_strings_displayed=preview_strings_displayed, post_submit_strings_displayed=[ base_repository.name, tool_repository.name, 'new' ], includes_tools=True )
def test_0030_browse_with_other_user(self): '''Verify that test_user_3 is blocked from browsing the review.''' ''' We are at step 4 - Have test_user_3 browse the repository and make sure they are not allowed to browse the review. ''' self.logout() self.login(email=common.test_user_3_email, username=common.test_user_3_name) repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name) user = test_db_util.get_user(common.test_user_2_email) strings_not_displayed = ['Browse reviews of this repository'] self.display_manage_repository_page( repository, strings_not_displayed=strings_not_displayed) strings_not_displayed = [ 'A good set of functional tests.', 'Clear and concise readme file, a true pleasure to read.' ] strings_not_displayed.append('Excellent tool, easy to use.') changeset_revision = self.get_repository_tip(repository) review = test_db_util.get_repository_review_by_user_id_changeset_revision( user.id, repository.id, changeset_revision) self.browse_component_review( review, strings_not_displayed=strings_not_displayed)
def test_0035_verify_repository(self): '''Display basic repository pages''' repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name) latest_changeset_revision = self.get_repository_tip(repository) self.check_for_valid_tools(repository, strings_displayed=['Filter1']) self.check_count_of_metadata_revisions_associated_with_repository( repository, metadata_count=1) tip = self.get_repository_tip(repository) tool_guid = '%s/repos/user1/filtering_0000/Filter1/1.1.0' % self.url.replace( 'http://', '').rstrip('/') tool_metadata_strings_displayed = [ tool_guid, '1.1.0', # The tool version. 'Filter1', # The tool ID. 'Filter', # The tool name. 'data on any column using simple expressions' ] # The tool description. tool_page_strings_displayed = ['Filter (version 1.1.0)'] self.check_repository_tools_for_changeset_revision( repository, tip, tool_metadata_strings_displayed=tool_metadata_strings_displayed, tool_page_strings_displayed=tool_page_strings_displayed) self.check_repository_metadata(repository, tip_only=False) self.browse_repository(repository, strings_displayed=[ "Repository '%s' revision" % repository.name, '(repository tip)' ]) self.display_repository_clone_page(common.test_user_1_name, repository_name, strings_displayed=[ 'Uploaded filtering 1.1.0', latest_changeset_revision ])
def test_0070_upload_readme_txt_file(self): '''Upload readme.txt file associated with tool version 2.2.0.''' repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name) self.upload_file(repository, filename='readme.txt', filepath=None, valid_tools_only=True, uncompress_file=False, remove_repo_files_not_in_tar=False, commit_message="Uploaded readme.txt", strings_displayed=[], strings_not_displayed=[]) self.display_manage_repository_page( repository, strings_displayed=['This is a readme file.']) # Verify that there is a different readme file for each metadata revision. metadata_revisions = self.get_repository_metadata_revisions(repository) self.display_manage_repository_page( repository, strings_displayed=[ 'Readme file for filtering 1.1.0', 'This is a readme file.' ])
def test_0030_upload_updated_tool_dependency_to_emboss_5_repository(self): '''Upload a new tool_dependencies.xml to emboss_5_0470.''' ''' This is step 6 - Add a comment to the tool_dependencies.xml file in the emboss_5 repository, eliminating the changeset_revision attribute so that it gets automatically populated when uploaded. After uploading the file, the emboss5 repository should have 2 installable metadata revisions. ''' emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name) # Populate package_emboss_5_0_0_0470 with updated tool dependency definition. self.upload_file( emboss_repository, filename='emboss/0470_files/tool_dependencies.xml', filepath=None, valid_tools_only=True, uncompress_file=False, remove_repo_files_not_in_tar=False, commit_message= 'Upload updated complex repository dependency definition to emboss_5_0470.', strings_displayed=[], strings_not_displayed=[]) assert len( emboss_repository.metadata_revisions ) == 2, 'package_emboss_5_0_0_0470 has incorrect number of metadata revisions'
def test_0020_upload_updated_tool_dependency_to_package_x11(self): '''Upload a new tool_dependencies.xml to package_x11_client_1_5_proto_7_0_0470.''' ''' This is step 4 - Add a comment to the tool_dependencies.xml file to be uploaded to the package_x11_client_1_5_prot_7_0 repository, creating a new installable changeset revision at the repository tip. ''' package_x11_repository = test_db_util.get_repository_by_name_and_owner( package_libx11_repository_name, common.test_user_1_name) # Upload the tool dependency definition to the package_x11_client_1_5_proto_7_0_0470 repository. self.upload_file( package_x11_repository, filename= 'emboss/libx11_proto/second_tool_dependency/tool_dependencies.xml', filepath=None, valid_tools_only=True, uncompress_file=False, remove_repo_files_not_in_tar=False, commit_message= 'Populate package_x11_client_1_5_proto_7_0_0470 with tool dependency definitions.', strings_displayed=[], strings_not_displayed=[]) assert len( package_x11_repository.metadata_revisions ) == 1, 'package_x11_client_1_5_proto_7_0_0470 has incorrect number of metadata revisions'
def test_0135_verify_review_for_new_version(self): '''Verify that the reviews display correctly for this changeset revision.''' self.logout() self.login(email=common.test_user_1_email, username=common.test_user_1_name) repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name) user = test_db_util.get_user(common.test_user_2_email) strings_displayed = [ 'Data types', 'Functional tests', 'yes', 'A good set of functional tests.', 'README', 'yes', 'Workflows', 'Tools' ] strings_displayed.extend([ 'Clear and concise readme file, a true pleasure to read.', 'Tool dependencies', 'not_applicable' ]) strings_displayed.extend([ 'Repository dependencies', 'Version 2.2.0 does the impossible and improves this tool.' ]) self.verify_repository_reviews(repository, reviewer=user, strings_displayed=strings_displayed)
def test_0035_create_and_upload_dependency_definitions( self ): '''Create and upload repository dependency definitions.''' global running_standalone if running_standalone: 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 ) 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' ] ) 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, emboss_datatypes_repository.name, emboss_datatypes_repository.user.username, self.get_repository_tip( emboss_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) 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) 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) self.check_repository_dependency(emboss_repository, emboss_datatypes_repository) self.check_repository_dependency(filtering_repository, freebayes_repository) self.check_repository_dependency(bwa_base_repository, emboss_repository) self.check_repository_dependency(bwa_color_repository, filtering_repository)
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_0005_create_repositories_and_categories(self): '''Ensure that the necessary categories and repositories exist for these tests.''' global repository_datatypes_count global running_standalone category_0000 = self.create_category( name='Test 0000 Basic Repository Features 1', description='Test 0000 Basic Repository Features 1') category_0001 = self.create_category( name='Test 0000 Basic Repository Features 2', description='Test 0000 Basic Repository Features 2') category_0010 = self.create_category( name='Test 0010 Repository With Tool Dependencies', description='Tests for a repository with tool dependencies.') category_0020 = self.create_category( name='Test 0020 Basic Repository Dependencies', description='Testing basic repository dependency features.') category_0030 = self.create_category( name='Test 0030 Repository Dependency Revisions', description='Testing repository dependencies by revision.') category_0040 = self.create_category( name='test_0040_repository_circular_dependencies', description='Testing handling of circular repository dependencies.' ) category_0050 = self.create_category( name='test_0050_repository_n_level_circular_dependencies', description= 'Testing handling of circular repository dependencies to n levels.' ) category_0060 = self.create_category( name='Test 0060 Workflow Features', description='Test 0060 - Workflow Features') self.logout() self.login(email=common.test_user_1_email, username=common.test_user_1_name) repository = self.get_or_create_repository( name='filtering_0000', description="Galaxy's filtering tool", long_description="Long description of Galaxy's filtering tool", owner=common.test_user_1_name, category_id=self.security.encode_id(category_0000.id)) if self.repository_is_new(repository): 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=[]) self.upload_file( repository, filename='filtering/filtering_2.2.0.tar', filepath=None, valid_tools_only=True, uncompress_file=True, remove_repo_files_not_in_tar=False, commit_message='Uploaded filtering 2.2.0 tarball.', strings_displayed=[], strings_not_displayed=[]) repository = self.get_or_create_repository( name='freebayes_0010', description="Galaxy's freebayes tool", long_description="Long description of Galaxy's freebayes tool", owner=common.test_user_1_name, category_id=self.security.encode_id(category_0010.id), strings_displayed=[]) if self.repository_is_new(repository): self.upload_file(repository, filename='freebayes/freebayes.xml', filepath=None, valid_tools_only=False, uncompress_file=True, remove_repo_files_not_in_tar=False, commit_message='Uploaded freebayes.xml.', strings_displayed=[], strings_not_displayed=[]) self.upload_file( repository, filename='freebayes/tool_data_table_conf.xml.sample', filepath=None, valid_tools_only=False, uncompress_file=True, remove_repo_files_not_in_tar=False, commit_message='Uploaded tool_data_table_conf.xml.sample', strings_displayed=[], strings_not_displayed=[]) self.upload_file( repository, filename='freebayes/sam_fa_indices.loc.sample', filepath=None, valid_tools_only=False, uncompress_file=True, remove_repo_files_not_in_tar=False, commit_message='Uploaded sam_fa_indices.loc.sample', strings_displayed=[], strings_not_displayed=[]) self.upload_file(repository, filename='freebayes/tool_dependencies.xml', filepath=None, valid_tools_only=False, uncompress_file=True, remove_repo_files_not_in_tar=False, commit_message='Uploaded tool_dependencies.xml', strings_displayed=[], strings_not_displayed=[]) repository = self.get_or_create_repository( name='emboss_datatypes_0020', description="Galaxy applicable data formats used by Emboss tools.", long_description= "Galaxy applicable data formats used by Emboss tools. This repository contains no tools.", owner=common.test_user_1_name, category_id=self.security.encode_id(category_0010.id), strings_displayed=[]) if self.repository_is_new(repository): self.upload_file(repository, filename='emboss/datatypes/datatypes_conf.xml', filepath=None, valid_tools_only=False, uncompress_file=False, remove_repo_files_not_in_tar=False, commit_message='Uploaded datatypes_conf.xml.', strings_displayed=[], strings_not_displayed=[]) repository = self.get_or_create_repository( name='emboss_0020', description='Galaxy wrappers for Emboss version 5.0.0 tools', long_description= 'Galaxy wrappers for Emboss version 5.0.0 tools', owner=common.test_user_1_name, category_id=self.security.encode_id(category_0020.id), strings_displayed=[]) self.upload_file(repository, filename='emboss/emboss.tar', filepath=None, valid_tools_only=True, uncompress_file=True, remove_repo_files_not_in_tar=False, commit_message='Uploaded emboss.tar', strings_displayed=[], strings_not_displayed=[]) datatypes_repository = self.get_or_create_repository( name='emboss_datatypes_0030', description=datatypes_repository_description, long_description=datatypes_repository_long_description, owner=common.test_user_1_name, category_id=self.security.encode_id(category_0030.id), strings_displayed=[]) if self.repository_is_new(datatypes_repository): running_standalone = True self.upload_file(datatypes_repository, filename='emboss/datatypes/datatypes_conf.xml', filepath=None, valid_tools_only=False, uncompress_file=True, remove_repo_files_not_in_tar=False, commit_message='Uploaded datatypes_conf.xml.', strings_displayed=[], strings_not_displayed=[]) repository_datatypes_count = int( self.get_repository_datatypes_count(datatypes_repository)) emboss_5_repository = self.get_or_create_repository( name='emboss_5_0030', description=emboss_repository_description, long_description=emboss_repository_long_description, owner=common.test_user_1_name, category_id=self.security.encode_id(category_0030.id), strings_displayed=[]) self.upload_file(emboss_5_repository, filename='emboss/emboss.tar', filepath=None, valid_tools_only=True, uncompress_file=True, remove_repo_files_not_in_tar=False, commit_message='Uploaded emboss.tar', strings_displayed=[], strings_not_displayed=[]) repository_dependencies_path = self.generate_temp_path( 'test_0330', additional_paths=['emboss', '5']) dependency_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=[dependency_tuple], filepath=repository_dependencies_path) emboss_6_repository = self.get_or_create_repository( name='emboss_6_0030', description=emboss_repository_description, long_description=emboss_repository_long_description, owner=common.test_user_1_name, category_id=self.security.encode_id(category_0030.id), strings_displayed=[]) self.upload_file(emboss_6_repository, filename='emboss/emboss.tar', filepath=None, valid_tools_only=True, uncompress_file=True, remove_repo_files_not_in_tar=False, commit_message='Uploaded emboss.tar', strings_displayed=[], strings_not_displayed=[]) repository_dependencies_path = self.generate_temp_path( 'test_0330', additional_paths=['emboss', '6']) dependency_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=[dependency_tuple], filepath=repository_dependencies_path) emboss_repository = self.get_or_create_repository( name='emboss_0030', description=emboss_repository_description, long_description=emboss_repository_long_description, owner=common.test_user_1_name, category_id=self.security.encode_id(category_0030.id), strings_displayed=[]) self.upload_file(emboss_repository, filename='emboss/emboss.tar', filepath=None, valid_tools_only=True, uncompress_file=True, remove_repo_files_not_in_tar=False, commit_message='Uploaded emboss.tar', strings_displayed=[], strings_not_displayed=[]) repository_dependencies_path = self.generate_temp_path( 'test_0330', additional_paths=['emboss', '5']) dependency_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=[dependency_tuple], filepath=repository_dependencies_path) dependency_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=[dependency_tuple], filepath=repository_dependencies_path) repository = self.get_or_create_repository( name='freebayes_0040', description="Galaxy's freebayes tool", long_description="Long description of Galaxy's freebayes tool", owner=common.test_user_1_name, category_id=self.security.encode_id(category_0040.id), strings_displayed=[]) if self.repository_is_new(repository): self.upload_file(repository, filename='freebayes/freebayes.tar', filepath=None, valid_tools_only=True, uncompress_file=True, remove_repo_files_not_in_tar=False, commit_message='Uploaded freebayes tarball.', strings_displayed=[], strings_not_displayed=[]) repository = self.get_or_create_repository( name='filtering_0040', description="Galaxy's filtering tool", long_description="Long description of Galaxy's filtering tool", owner=common.test_user_1_name, category_id=self.security.encode_id(category_0040.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=[]) freebayes_repository = test_db_util.get_repository_by_name_and_owner( 'freebayes_0040', common.test_user_1_name) filtering_repository = test_db_util.get_repository_by_name_and_owner( 'filtering_0040', common.test_user_1_name) repository_dependencies_path = self.generate_temp_path( 'test_0340', additional_paths=['dependencies']) dependency_tuple = (self.url, freebayes_repository.name, freebayes_repository.user.username, self.get_repository_tip(freebayes_repository)) self.create_repository_dependency( repository=filtering_repository, repository_tuples=[dependency_tuple], filepath=repository_dependencies_path) dependency_tuple = (self.url, filtering_repository.name, filtering_repository.user.username, self.get_repository_tip(filtering_repository)) self.create_repository_dependency( repository=freebayes_repository, repository_tuples=[dependency_tuple], filepath=repository_dependencies_path) datatypes_repository = self.get_or_create_repository( name='emboss_datatypes_0050', description="Datatypes for emboss", long_description="Long description of Emboss' datatypes", owner=common.test_user_1_name, category_id=self.security.encode_id(category_0050.id), strings_displayed=[]) if self.repository_is_new(datatypes_repository): emboss_repository = self.get_or_create_repository( name='emboss_0050', description="Galaxy's emboss tool", long_description="Long description of Galaxy's emboss tool", owner=common.test_user_1_name, category_id=self.security.encode_id(category_0050.id), strings_displayed=[]) filtering_repository = self.get_or_create_repository( name='filtering_0050', description="Galaxy's filtering tool", long_description="Long description of Galaxy's filtering tool", owner=common.test_user_1_name, category_id=self.security.encode_id(category_0050.id), strings_displayed=[]) freebayes_repository = self.get_or_create_repository( name='freebayes_0050', description="Galaxy's freebayes tool", long_description="Long description of Galaxy's freebayes tool", owner=common.test_user_1_name, category_id=self.security.encode_id(category_0050.id), strings_displayed=[]) self.upload_file(datatypes_repository, filename='emboss/datatypes/datatypes_conf.xml', filepath=None, valid_tools_only=False, uncompress_file=False, remove_repo_files_not_in_tar=False, commit_message='Uploaded datatypes_conf.xml.', strings_displayed=[], strings_not_displayed=[]) self.upload_file(emboss_repository, filename='emboss/emboss.tar', filepath=None, valid_tools_only=True, uncompress_file=True, remove_repo_files_not_in_tar=False, commit_message='Uploaded emboss.tar', strings_displayed=[], strings_not_displayed=[]) self.upload_file(freebayes_repository, filename='freebayes/freebayes.tar', filepath=None, valid_tools_only=True, uncompress_file=True, remove_repo_files_not_in_tar=False, commit_message='Uploaded freebayes tarball.', strings_displayed=[], strings_not_displayed=[]) self.upload_file( filtering_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=[]) repository_dependencies_path = self.generate_temp_path( 'test_0350', additional_paths=['emboss']) dependency_tuple = (self.url, datatypes_repository.name, datatypes_repository.user.username, self.get_repository_tip(datatypes_repository)) self.create_repository_dependency( repository=emboss_repository, repository_tuples=[dependency_tuple], filepath=repository_dependencies_path) repository_dependencies_path = self.generate_temp_path( 'test_0350', additional_paths=['filtering']) dependency_tuple = (self.url, emboss_repository.name, emboss_repository.user.username, self.get_repository_tip(emboss_repository)) self.create_repository_dependency( repository=filtering_repository, repository_tuples=[dependency_tuple], filepath=repository_dependencies_path) repository_dependencies_path = self.generate_temp_path( 'test_0350', additional_paths=['freebayes']) dependency_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=[dependency_tuple], filepath=repository_dependencies_path) dependency_tuples = [ (self.url, datatypes_repository.name, datatypes_repository.user.username, self.get_repository_tip(datatypes_repository)), (self.url, emboss_repository.name, emboss_repository.user.username, self.get_repository_tip(emboss_repository)), (self.url, filtering_repository.name, filtering_repository.user.username, self.get_repository_tip(filtering_repository)), (self.url, freebayes_repository.name, freebayes_repository.user.username, self.get_repository_tip(freebayes_repository)) ] self.create_repository_dependency( repository=freebayes_repository, repository_tuples=dependency_tuples, filepath=repository_dependencies_path) workflow_repository = self.get_or_create_repository( name='filtering_0060', description="Galaxy's filtering tool", long_description="Long description of Galaxy's filtering tool", owner=common.test_user_1_name, category_id=self.security.encode_id(category_0060.id), strings_displayed=[]) if self.repository_is_new(workflow_repository): workflow = file( self.get_filename( 'filtering_workflow/Workflow_for_0060_filter_workflow_repository.ga' ), 'r').read() workflow = workflow.replace('__TEST_TOOL_SHED_URL__', self.url.replace('http://', '')) workflow_filepath = self.generate_temp_path( 'test_0360', additional_paths=['filtering_workflow']) if not os.path.exists(workflow_filepath): os.makedirs(workflow_filepath) file(os.path.join(workflow_filepath, workflow_filename), 'w+').write(workflow) self.upload_file(workflow_repository, filename=workflow_filename, filepath=workflow_filepath, valid_tools_only=True, uncompress_file=False, remove_repo_files_not_in_tar=False, commit_message='Uploaded filtering workflow.', strings_displayed=[], strings_not_displayed=[]) self.upload_file( workflow_repository, filename='filtering/filtering_2.2.0.tar', filepath=None, valid_tools_only=True, uncompress_file=True, remove_repo_files_not_in_tar=False, commit_message='Uploaded filtering 2.2.0 tarball.', strings_displayed=[], strings_not_displayed=[])
def test_0085_verify_repository_metadata(self): '''Verify that resetting the metadata does not change it.''' repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name) self.verify_unchanged_repository_metadata(repository)
def test_0100_create_and_upload_dependency_definitions(self): '''Create the dependency structure for test 0050.''' global running_standalone if running_standalone: self.logout() self.login(email=common.test_user_1_email, username=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) 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_0050', additional_paths=['freebayes']) # convert_chars depends on column_maker # column_maker depends on convert_chars # emboss depends on emboss_datatypes # emboss_datatypes depends on bismark # freebayes depends on freebayes, emboss, emboss_datatypes, and column_maker # filtering depends on emboss 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(repository=filtering_repository, repository_tuples=[emboss_tuple], filepath=dependency_xml_path)
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 ) convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) for repository in [ column_repository, convert_repository ]: self.verify_unchanged_repository_metadata( repository )
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_0005_create_repositories_and_categories(self): category_0000 = self.create_category( name='Test 0000 Basic Repository Features 1', description='Test 0000 Basic Repository Features 1') category_0001 = self.create_category( name='Test 0000 Basic Repository Features 2', description='Test 0000 Basic Repository Features 2') category_0010 = self.create_category( name='Test 0010 Repository With Tool Dependencies', description='Tests for a repository with tool dependencies.') category_0020 = self.create_category( name='Test 0020 Basic Repository Dependencies', description='Testing basic repository dependency features.') category_0030 = self.create_category( name='Test 0030 Repository Dependency Revisions', description='Testing repository dependencies by revision.') category_0040 = self.create_category( name='test_0040_repository_circular_dependencies', description='Testing handling of circular repository dependencies.' ) category_0050 = self.create_category( name='test_0050_repository_n_level_circular_dependencies', description= 'Testing handling of circular repository dependencies to n levels.' ) category_0060 = self.create_category( name='Test 0060 Workflow Features', description='Test 0060 - Workflow Features') self.logout() self.login(email=common.test_user_1_email, username=common.test_user_1_name) repository = self.get_or_create_repository( name='filtering_0000', description="Galaxy's filtering tool", long_description="Long description of Galaxy's filtering tool", owner=common.test_user_1_name, category_id=self.security.encode_id(category_0000.id)) if self.repository_is_new(repository): self.upload_file(repository, 'filtering/filtering_1.1.0.tar', commit_message="Uploaded filtering 1.1.0") self.upload_file(repository, 'filtering/filtering_2.2.0.tar', commit_message="Uploaded filtering 2.2.0") repository = self.get_or_create_repository( name='freebayes_0010', description="Galaxy's freebayes tool", long_description="Long description of Galaxy's freebayes tool", owner=common.test_user_1_name, category_id=self.security.encode_id(category_0000.id), strings_displayed=[]) if self.repository_is_new(repository): self.upload_file(repository, 'freebayes/freebayes.xml', valid_tools_only=False, commit_message='Uploaded.', strings_displayed=[]) self.upload_file(repository, 'freebayes/tool_data_table_conf.xml.sample', valid_tools_only=False, commit_message='Uploaded.', strings_displayed=[]) self.upload_file(repository, 'freebayes/sam_fa_indices.loc.sample', valid_tools_only=False, commit_message='Uploaded.', strings_displayed=[]) self.upload_file(repository, 'freebayes/tool_dependencies.xml', commit_message='Uploaded.') repository = self.get_or_create_repository( name='emboss_datatypes_0020', description="Galaxy applicable data formats used by Emboss tools.", long_description= "Galaxy applicable data formats used by Emboss tools. This repository contains no tools.", owner=common.test_user_1_name, category_id=self.security.encode_id(category_0010.id), strings_displayed=[]) if self.repository_is_new(repository): self.upload_file(repository, 'emboss/datatypes/datatypes_conf.xml', commit_message='Uploaded datatypes_conf.xml.') repository = self.get_or_create_repository( name='emboss_0020', description='Galaxy wrappers for Emboss version 5.0.0 tools', long_description= 'Galaxy wrappers for Emboss version 5.0.0 tools', owner=common.test_user_1_name, category_id=self.security.encode_id(category_0020.id), strings_displayed=[]) self.upload_file(repository, 'emboss/emboss.tar', commit_message='Uploaded emboss_5.tar') datatypes_repository = self.get_or_create_repository( name='emboss_datatypes_0030', description=datatypes_repository_description, long_description=datatypes_repository_long_description, owner=common.test_user_1_name, category_id=self.security.encode_id(category_0030.id), strings_displayed=[]) if self.repository_is_new(datatypes_repository): self.upload_file(datatypes_repository, 'emboss/datatypes/datatypes_conf.xml', commit_message='Uploaded datatypes_conf.xml.') emboss_5_repository = self.get_or_create_repository( name='emboss_5_0030', description=emboss_repository_description, long_description=emboss_repository_long_description, owner=common.test_user_1_name, category_id=self.security.encode_id(category_0030.id), strings_displayed=[]) self.upload_file(emboss_5_repository, 'emboss/emboss.tar', commit_message='Uploaded emboss.tar') repository_dependencies_path = self.generate_temp_path( 'test_0330', additional_paths=['emboss', '5']) self.generate_repository_dependency_xml( [datatypes_repository], self.get_filename('repository_dependencies.xml', filepath=repository_dependencies_path)) self.upload_file( emboss_5_repository, 'repository_dependencies.xml', filepath=repository_dependencies_path, commit_message='Uploaded repository_dependencies.xml') emboss_6_repository = self.get_or_create_repository( name='emboss_6_0030', description=emboss_repository_description, long_description=emboss_repository_long_description, owner=common.test_user_1_name, category_id=self.security.encode_id(category_0030.id), strings_displayed=[]) self.upload_file(emboss_6_repository, 'emboss/emboss.tar', commit_message='Uploaded emboss.tar') repository_dependencies_path = self.generate_temp_path( 'test_0330', additional_paths=['emboss', '6']) self.generate_repository_dependency_xml( [datatypes_repository], self.get_filename('repository_dependencies.xml', filepath=repository_dependencies_path)) self.upload_file( emboss_6_repository, 'repository_dependencies.xml', filepath=repository_dependencies_path, commit_message='Uploaded repository_dependencies.xml') emboss_repository = self.get_or_create_repository( name='emboss_0030', description=emboss_repository_description, long_description=emboss_repository_long_description, owner=common.test_user_1_name, category_id=self.security.encode_id(category_0030.id), strings_displayed=[]) self.upload_file(emboss_repository, 'emboss/emboss.tar', commit_message='Uploaded emboss.tar') repository_dependencies_path = self.generate_temp_path( 'test_0330', additional_paths=['emboss', '5']) self.generate_repository_dependency_xml( [emboss_5_repository], self.get_filename('repository_dependencies.xml', filepath=repository_dependencies_path)) self.upload_file( emboss_repository, 'repository_dependencies.xml', filepath=repository_dependencies_path, commit_message='Uploaded repository_dependencies.xml') self.generate_repository_dependency_xml( [emboss_6_repository], self.get_filename('repository_dependencies.xml', filepath=repository_dependencies_path)) self.upload_file( emboss_repository, 'repository_dependencies.xml', filepath=repository_dependencies_path, commit_message='Uploaded repository_dependencies.xml') repository = self.get_or_create_repository( name='freebayes_0040', description="Galaxy's freebayes tool", long_description="Long description of Galaxy's freebayes tool", owner=common.test_user_1_name, category_id=self.security.encode_id(category_0040.id), strings_displayed=[]) if self.repository_is_new(repository): self.upload_file(repository, 'freebayes/freebayes.tar', commit_message='Uploaded freebayes.tar.') repository = self.get_or_create_repository( name='filtering_0040', description="Galaxy's filtering tool", long_description="Long description of Galaxy's filtering tool", owner=common.test_user_1_name, category_id=self.security.encode_id(category_0040.id), strings_displayed=[]) self.upload_file(repository, 'filtering/filtering_1.1.0.tar', commit_message='Uploaded filtering.tar.') freebayes_repository = test_db_util.get_repository_by_name_and_owner( 'freebayes_0040', common.test_user_1_name) filtering_repository = test_db_util.get_repository_by_name_and_owner( 'filtering_0040', common.test_user_1_name) repository_dependencies_path = self.generate_temp_path( 'test_0340', additional_paths=['dependencies']) self.generate_repository_dependency_xml( [freebayes_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, 'repository_dependencies.xml', filepath=repository_dependencies_path, commit_message='Uploaded dependency on freebayes') self.generate_repository_dependency_xml( [filtering_repository], self.get_filename('repository_dependencies.xml', filepath=repository_dependencies_path), dependency_description= 'Freebayes depends on the filtering repository.') self.upload_file(freebayes_repository, 'repository_dependencies.xml', filepath=repository_dependencies_path, commit_message='Uploaded dependency on filtering') datatypes_repository = self.get_or_create_repository( name='emboss_datatypes_0050', description="Datatypes for emboss", long_description="Long description of Emboss' datatypes", owner=common.test_user_1_name, category_id=self.security.encode_id(category_0050.id), strings_displayed=[]) if self.repository_is_new(datatypes_repository): emboss_repository = self.get_or_create_repository( name='emboss_0050', description="Galaxy's emboss tool", long_description="Long description of Galaxy's emboss tool", owner=common.test_user_1_name, category_id=self.security.encode_id(category_0050.id), strings_displayed=[]) filtering_repository = self.get_or_create_repository( name='filtering_0050', description="Galaxy's filtering tool", long_description="Long description of Galaxy's filtering tool", owner=common.test_user_1_name, category_id=self.security.encode_id(category_0050.id), strings_displayed=[]) freebayes_repository = self.get_or_create_repository( name='freebayes_0050', description="Galaxy's freebayes tool", long_description="Long description of Galaxy's freebayes tool", owner=common.test_user_1_name, category_id=self.security.encode_id(category_0050.id), strings_displayed=[]) self.upload_file(datatypes_repository, 'emboss/datatypes/datatypes_conf.xml', commit_message='Uploaded datatypes_conf.xml.') self.upload_file(emboss_repository, 'emboss/emboss.tar', commit_message='Uploaded tool tarball.') self.upload_file(freebayes_repository, 'freebayes/freebayes.tar', commit_message='Uploaded freebayes.tar.') self.upload_file(filtering_repository, 'filtering/filtering_1.1.0.tar', commit_message='Uploaded filtering.tar.') repository_dependencies_path = self.generate_temp_path( 'test_0350', 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( emboss_repository, 'repository_dependencies.xml', filepath=repository_dependencies_path, commit_message='Uploaded dependency on emboss_datatypes.') repository_dependencies_path = self.generate_temp_path( 'test_0350', 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, 'repository_dependencies.xml', filepath=repository_dependencies_path, commit_message='Uploaded dependency on emboss.') repository_dependencies_path = self.generate_temp_path( 'test_0350', 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.') self.generate_repository_dependency_xml( [ datatypes_repository, emboss_repository, filtering_repository, freebayes_repository ], self.get_filename('repository_dependencies.xml', filepath=repository_dependencies_path), dependency_description= 'Freebayes depends on the filtering repository.') self.upload_file( freebayes_repository, 'repository_dependencies.xml', filepath=repository_dependencies_path, commit_message='Uploaded dependency on filtering.') workflow_repository = self.get_or_create_repository( name='filtering_0060', description="Galaxy's filtering tool", long_description="Long description of Galaxy's filtering tool", owner=common.test_user_1_name, category_id=self.security.encode_id(category_0060.id), strings_displayed=[]) if self.repository_is_new(workflow_repository): workflow = file( self.get_filename( 'filtering_workflow/Workflow_for_0060_filter_workflow_repository.ga' ), 'r').read() workflow = workflow.replace('__TEST_TOOL_SHED_URL__', self.url.replace('http://', '')) workflow_filepath = self.generate_temp_path( 'test_0360', additional_paths=['filtering_workflow']) os.makedirs(workflow_filepath) file(os.path.join(workflow_filepath, workflow_filename), 'w+').write(workflow) self.upload_file(workflow_repository, workflow_filename, filepath=workflow_filepath, commit_message='Uploaded filtering workflow.') self.upload_file(workflow_repository, 'filtering/filtering_2.2.0.tar', commit_message='Uploaded filtering tool.')
def test_0035_verify_tool_dependencies( self ): '''Verify that the uploaded tool_dependencies.xml specifies the correct package versions.''' repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.display_manage_repository_page( repository, strings_displayed=[ 'freebayes', '0.9.4_9696d0ce8a9', 'samtools', '0.1.18', 'Valid tools' ], strings_not_displayed=[ 'Invalid tools' ] )
def test_0025_grant_write_access(self): '''Grant write access to another user''' repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name) self.grant_write_access(repository, usernames=[common.admin_username]) self.revoke_write_access(repository, common.admin_username)
def test_0025_verify_repository_dependency( self ): '''Verify that the new revision of column_maker now depends on convert_chars.''' 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( column_repository, convert_repository )
def test_0030_upload_valid_tool_dependency_xml( self ): '''Upload tool_dependencies.xml defining version 0.9.4_9696d0ce8a962f7bb61c4791be5ce44312b81cf8 of the freebayes package.''' repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.upload_file( repository, os.path.join( 'freebayes', 'tool_dependencies.xml' ), commit_message='Uploaded valid tool dependency XML.' )