commit/galaxy-central: inithello: Added tool shed functional test script for repository dependencies.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/8a3f874b8e0a/ changeset: 8a3f874b8e0a user: inithello date: 2012-12-03 20:09:23 summary: Added tool shed functional test script for repository dependencies. affected #: 6 files diff -r 8510ddb2a507285890f95af5d2a8d88606d99d47 -r 8a3f874b8e0a20afb362b8c4e92989a6cf76509b test/tool_shed/base/twilltestcase.py --- a/test/tool_shed/base/twilltestcase.py +++ b/test/tool_shed/base/twilltestcase.py @@ -1,6 +1,7 @@ from base.twilltestcase import * from galaxy.webapps.community.util.hgweb_config import * from test_db_util import * +import string from galaxy import eggs eggs.require('mercurial') diff -r 8510ddb2a507285890f95af5d2a8d88606d99d47 -r 8a3f874b8e0a20afb362b8c4e92989a6cf76509b test/tool_shed/functional/test_0000_basic_repository_features.py --- a/test/tool_shed/functional/test_0000_basic_repository_features.py +++ b/test/tool_shed/functional/test_0000_basic_repository_features.py @@ -6,10 +6,10 @@ admin_email = 'test@bx.psu.edu' admin_username = 'admin-user' -regular_user = None -regular_user_private_role = None -regular_email = 'test-1@bx.psu.edu' -regular_username = 'user1' +test_user_1 = None +test_user_1_private_role = None +test_user_1_email = 'test-1@bx.psu.edu' +test_user_1_name = 'user1' repository_name = 'filtering' repository_description = "Galaxy's filtering tool" @@ -19,10 +19,10 @@ def test_0000_initiate_users( self ): """Create necessary user accounts and login as an admin user.""" - self.login( email=regular_email, username=regular_username ) - regular_user = get_user( regular_email ) - assert regular_user is not None, 'Problem retrieving user with email %s from the database' % regular_email - regular_user_private_role = get_private_role( regular_user ) + self.login( email=test_user_1_email, username=test_user_1_name ) + test_user_1 = get_user( test_user_1_email ) + assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email + test_user_1_private_role = get_private_role( test_user_1 ) self.logout() self.login( email=admin_email, username=admin_username ) admin_user = get_user( admin_email ) @@ -55,8 +55,8 @@ def test_0025_grant_write_access( self ): '''Grant write access to another user''' repository = get_repository_by_name_and_owner( repository_name, admin_username ) - self.grant_write_access( repository, usernames=[ regular_username ] ) - self.revoke_write_access( repository, regular_username ) + self.grant_write_access( repository, usernames=[ test_user_1_name ] ) + self.revoke_write_access( repository, test_user_1_name ) def test_0030_upload_filtering_1_1_0( self ): """Upload filtering_1.1.0.tar to the repository""" repository = get_repository_by_name_and_owner( repository_name, admin_username ) diff -r 8510ddb2a507285890f95af5d2a8d88606d99d47 -r 8a3f874b8e0a20afb362b8c4e92989a6cf76509b test/tool_shed/functional/test_0010_repository_with_tool_dependencies.py --- a/test/tool_shed/functional/test_0010_repository_with_tool_dependencies.py +++ b/test/tool_shed/functional/test_0010_repository_with_tool_dependencies.py @@ -6,10 +6,10 @@ admin_email = 'test@bx.psu.edu' admin_username = 'admin-user' -regular_user = None -regular_user_private_role = None -regular_email = 'test-1@bx.psu.edu' -regular_username = 'user1' +test_user_1 = None +test_user_1_private_role = None +test_user_1_email = 'test-1@bx.psu.edu' +test_user_1_name = 'user1' repository_name = 'freebayes' repository_description = "Galaxy's freebayes tool" @@ -18,17 +18,21 @@ class TestFreebayesRepository( ShedTwillTestCase ): '''Testing freebayes with tool data table entries, .loc files, and tool dependencies.''' def test_0000_create_or_login_admin_user( self ): + """Create necessary user accounts and login as an admin user.""" self.logout() self.login( email=admin_email, username=admin_username ) admin_user = get_user( admin_email ) assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email admin_user_private_role = get_private_role( admin_user ) + def test_0005_create_categories( self ): + """Create categories""" + self.create_category( 'SNP Analysis', 'Tools for single nucleotide polymorphism data such as WGA' ) def test_0005_create_freebayes_repository_and_upload_tool_xml( self ): '''Upload freebayes.xml without tool_data_table_conf.xml.sample. This should result in an error and invalid tool.''' self.create_repository( repository_name, repository_description, repository_long_description=repository_long_description, - categories=[ 'Text Manipulation' ], + categories=[ 'SNP Analysis' ], strings_displayed=[] ) repository = get_repository_by_name_and_owner( repository_name, admin_username ) self.upload_file( repository, @@ -36,7 +40,7 @@ valid_tools_only=False, strings_displayed=[ 'Metadata was defined', 'This file requires an entry', 'tool_data_table_conf' ], commit_message='Uploaded the tool xml.' ) - self.display_manage_repository_page( repository, strings_not_displayed=[ 'Valid tools' ] ) + self.display_manage_repository_page( repository, strings_displayed=[ 'Invalid tools' ], strings_not_displayed=[ 'Valid tools' ] ) tip = self.get_repository_tip( repository ) self.check_repository_invalid_tools_for_changeset_revision( repository, tip, @@ -50,6 +54,8 @@ commit_message='Uploaded the tool data table sample file.' ) def test_0015_upload_missing_sample_loc_file( self ): '''Upload the missing sam_fa_indices.loc.sample file to the repository.''' + # Freebayes does not generate an error when the loc file is missing. + # TODO: Generate a test case for that situation. repository = get_repository_by_name_and_owner( repository_name, admin_username ) self.upload_file( repository, 'freebayes/sam_fa_indices.loc.sample', diff -r 8510ddb2a507285890f95af5d2a8d88606d99d47 -r 8a3f874b8e0a20afb362b8c4e92989a6cf76509b test/tool_shed/functional/test_0020_emboss_repository_dependencies.py --- /dev/null +++ b/test/tool_shed/functional/test_0020_emboss_repository_dependencies.py @@ -0,0 +1,95 @@ +from tool_shed.base.twilltestcase import * +from tool_shed.base.test_db_util import * + +admin_user = None +admin_user_private_role = None +admin_email = 'test@bx.psu.edu' +admin_username = 'admin-user' + +test_user_1 = None +test_user_1_private_role = None +test_user_1_email = 'test-1@bx.psu.edu' +test_user_1_name = 'user1' + +datatypes_repository_name = 'emboss_datatypes' +datatypes_repository_description = "Galaxy applicable data formats used by Emboss tools." +datatypes_repository_long_description = "Galaxy applicable data formats used by Emboss tools. This repository contains no tools." + +emboss_repository_name = 'emboss_5' +emboss_repository_description = 'Galaxy wrappers for Emboss version 5.0.0 tools' +emboss_repository_long_description = 'Galaxy wrappers for Emboss version 5.0.0 tools' + +new_repository_dependencies_xml = '''<?xml version="1.0"?> +<repositories> + <repository toolshed="${toolshed_url}" name="${repository_name}" owner="${owner}" changeset_revision="${changeset_revision}" /> +</repositories> +''' + +class TestEmbossRepositoryDependencies( ShedTwillTestCase ): + '''Testing emboss 5 with repository dependencies.''' + def test_0000_initiate_users( self ): + """Create necessary user accounts and login as an admin user.""" + self.logout() + self.login( email=admin_email, username=admin_username ) + admin_user = get_user( admin_email ) + assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email + admin_user_private_role = get_private_role( admin_user ) + self.logout() + self.login( email=test_user_1_email, username=test_user_1_name ) + test_user_1 = get_user( test_user_1_email ) + assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % regular_email + test_user_1_private_role = get_private_role( test_user_1 ) + def test_0005_create_categories( self ): + """Create categories""" + self.logout() + self.login( email=admin_email, username=admin_username ) + self.create_category( 'Sequence Analysis', 'Tools for performing Protein and DNA/RNA analysis' ) + def test_0010_create_emboss_datatypes_repository_and_upload_tarball( self ): + '''Create the emboss_datatypes repository and upload the tarball.''' + self.logout() + self.login( email=test_user_1_email, username=test_user_1_name ) + self.create_repository( datatypes_repository_name, + datatypes_repository_description, + repository_long_description=datatypes_repository_long_description, + categories=[ 'Sequence Analysis' ], + strings_displayed=[] ) + repository = get_repository_by_name_and_owner( datatypes_repository_name, test_user_1_name ) + self.upload_file( repository, + 'emboss_5/datatypes_conf.xml', + commit_message='Uploaded datatypes_conf.xml.' ) + def test_0015_verify_datatypes_in_datatypes_repository( self ): + '''Verify that the emboss_datatypes repository contains datatype entries.''' + repository = get_repository_by_name_and_owner( datatypes_repository_name, test_user_1_name ) + self.display_manage_repository_page( repository, strings_displayed=[ 'Datatypes', 'equicktandem', 'hennig86', 'vectorstrip' ] ) + def test_0020_generate_repository_dependencies_xml( self ): + '''Generate the repository_dependencies.xml file for the emboss_5 repository.''' + datatypes_repository = get_repository_by_name_and_owner( datatypes_repository_name, test_user_1_name ) + changeset_revision = self.get_repository_tip( datatypes_repository ) + template_parser = string.Template( new_repository_dependencies_xml ) + repository_dependency_xml = template_parser.safe_substitute( toolshed_url=self.url, + owner=test_user_1_name, + repository_name=datatypes_repository.name, + changeset_revision=changeset_revision ) + # Save the generated xml to test-data/emboss_5/repository_dependencies.xml. + file( self.get_filename( 'emboss_5/repository_dependencies.xml' ), 'w' ).write( repository_dependency_xml ) + def test_0025_create_emboss_5_repository_and_upload_files( self ): + '''Create the emboss_5 repository and upload a tool tarball, then generate and upload repository_dependencies.xml.''' + self.create_repository( emboss_repository_name, + emboss_repository_description, + repository_long_description=emboss_repository_long_description, + categories=[ 'Text Manipulation' ], + strings_displayed=[] ) + repository = get_repository_by_name_and_owner( emboss_repository_name, test_user_1_name ) + self.upload_file( repository, 'emboss_5/emboss_5.tar', commit_message='Uploaded emboss_5.tar' ) + self.upload_file( repository, 'emboss_5/repository_dependencies.xml', commit_message='Uploaded repository_dependencies.xml' ) + def test_0030_verify_emboss_5_repository_dependency_on_emboss_datatypes( self ): + '''Verify that the emboss_5 repository now depends on the emboss_datatypes repository with correct name, owner, and changeset revision.''' + repository = get_repository_by_name_and_owner( emboss_repository_name, test_user_1_name ) + datatypes_repository = get_repository_by_name_and_owner( datatypes_repository_name, test_user_1_name ) + changeset_revision = self.get_repository_tip( datatypes_repository ) + strings_displayed = [ datatypes_repository_name, test_user_1_name, changeset_revision, 'Repository dependencies' ] + self.display_manage_repository_page( repository, strings_displayed=strings_displayed ) + def test_0035_cleanup( self ): + '''Clean up generated test data.''' + if os.path.exists( self.get_filename( 'emboss_5/repository_dependencies.xml' ) ): + os.remove( self.get_filename( 'emboss_5/repository_dependencies.xml' ) ) diff -r 8510ddb2a507285890f95af5d2a8d88606d99d47 -r 8a3f874b8e0a20afb362b8c4e92989a6cf76509b test/tool_shed/test_data/emboss_5/datatypes_conf.xml --- /dev/null +++ b/test/tool_shed/test_data/emboss_5/datatypes_conf.xml @@ -0,0 +1,101 @@ +<?xml version="1.0"?> +<datatypes> + <registration> + <datatype extension="acedb" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="asn1" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="btwisted" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="cai" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="charge" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="checktrans" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="chips" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="clustal" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="codata" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="codcmp" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="coderet" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="compseq" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="cpgplot" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="cpgreport" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="cusp" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="cut" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="dan" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="dbmotif" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="diffseq" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="digest" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="dreg" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="einverted" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="embl" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="epestfind" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="equicktandem" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="est2genome" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="etandem" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="excel" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="feattable" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="fitch" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="freak" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="fuzznuc" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="fuzzpro" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="fuzztran" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="garnier" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="gcg" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="geecee" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="genbank" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="helixturnhelix" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="hennig86" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="hmoment" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="ig" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="isochore" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="jackknifer" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="jackknifernon" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="markx0" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="markx1" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="markx10" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="markx2" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="markx3" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="match" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="mega" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="meganon" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="motif" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="msf" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="nametable" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="ncbi" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="needle" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="newcpgreport" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="newcpgseek" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="nexus" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="nexusnon" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="noreturn" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="pair" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="palindrome" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="pepcoil" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="pepinfo" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="pepstats" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="phylip" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="phylipnon" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="pir" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="polydot" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="preg" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="prettyseq" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="primersearch" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="regions" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="score" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="selex" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="seqtable" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="showfeat" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="showorf" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="simple" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="sixpack" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="srs" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="srspair" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="staden" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="strider" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="supermatcher" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="swiss" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="syco" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="table" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="tagseq" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="textsearch" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="vectorstrip" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="wobble" type="galaxy.datatypes.data:Text" subclass="True"/> + <datatype extension="wordcount" type="galaxy.datatypes.data:Text" subclass="True"/> + </registration> +</datatypes> diff -r 8510ddb2a507285890f95af5d2a8d88606d99d47 -r 8a3f874b8e0a20afb362b8c4e92989a6cf76509b test/tool_shed/test_data/emboss_5/emboss_5.tar Binary file test/tool_shed/test_data/emboss_5/emboss_5.tar has changed Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket