commit/galaxy-central: inithello: Refactor the tool shed functional tests' upload_file method for clarity.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/3ffe47cea647/ changeset: 3ffe47cea647 user: inithello date: 2013-02-14 05:36:18 summary: Refactor the tool shed functional tests' upload_file method for clarity. affected #: 34 files diff -r dde899d789b698f29269e521d2abc8a1f1373921 -r 3ffe47cea647ae61a02d74bbff68e0e07bff70e4 test/tool_shed/base/twilltestcase.py --- a/test/tool_shed/base/twilltestcase.py +++ b/test/tool_shed/base/twilltestcase.py @@ -168,11 +168,11 @@ raise AssertionError( errmsg ) def create_category( self, **kwd ): category = test_db_util.get_category_by_name( kwd[ 'name' ] ) - if category is not None: - return category - self.visit_url( '/admin/manage_categories?operation=create' ) - self.submit_form( form_no=1, button="create_category_button", **kwd ) - return test_db_util.get_category_by_name( kwd[ 'name' ] ) + if category is None: + self.visit_url( '/admin/manage_categories?operation=create' ) + self.submit_form( form_no=1, button="create_category_button", **kwd ) + category = test_db_util.get_category_by_name( kwd[ 'name' ] ) + return category def create_checkbox_query_string( self, field_name, value ): ''' From galaxy.web.form_builder.CheckboxField: @@ -213,8 +213,13 @@ dependency_description=dependency_description ) self.upload_file( repository, 'repository_dependencies.xml', - filepath=filepath, - commit_message='Uploaded dependency on %s.' % ', '.join( repo.name for repo in depends_on ) ) + filepath=filepath, + valid_tools_only=True, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded dependency on %s.' % ', '.join( repo.name for repo in depends_on ), + strings_displayed=[], + strings_not_displayed=[] ) def create_repository_review( self, repository, review_contents_dict, changeset_revision=None, copy_from=None): strings_displayed = [] if not copy_from: @@ -860,17 +865,35 @@ def upload_file( self, repository, filename, - filepath=None, - valid_tools_only=True, + filepath, + valid_tools_only, + uncompress_file, + remove_repo_files_not_in_tar, + commit_message, strings_displayed=[], - strings_not_displayed=[], - **kwd ): + strings_not_displayed=[] ): + removed_message = 'files were removed from the repository' + if remove_repo_files_not_in_tar: + if not self.repository_is_new( repository ): + if removed_message not in strings_displayed: + strings_displayed.append( removed_message ) + else: + if removed_message not in strings_not_displayed: + strings_not_displayed.append( removed_message ) self.visit_url( '/upload/upload?repository_id=%s' % self.security.encode_id( repository.id ) ) if valid_tools_only: strings_displayed.extend( [ 'has been successfully', 'uploaded to the repository.' ] ) - for key in kwd: - tc.fv( "1", key, kwd[ key ] ) tc.formfile( "1", "file_data", self.get_filename( filename, filepath ) ) + if uncompress_file: + tc.fv( 1, 'uncompress_file', 'Yes' ) + else: + tc.fv( 1, 'uncompress_file', 'No' ) + if not self.repository_is_new( repository ): + if remove_repo_files_not_in_tar: + tc.fv( 1, 'remove_repo_files_not_in_tar', 'Yes' ) + else: + tc.fv( 1, 'remove_repo_files_not_in_tar', 'No' ) + tc.fv( 1, 'commit_message', commit_message ) tc.submit( "upload_button" ) self.check_for_strings( strings_displayed, strings_not_displayed ) # Uncomment this if it becomes necessary to wait for an asynchronous process to complete after submitting an upload. diff -r dde899d789b698f29269e521d2abc8a1f1373921 -r 3ffe47cea647ae61a02d74bbff68e0e07bff70e4 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 @@ -56,7 +56,15 @@ def test_0030_upload_filtering_1_1_0( self ): """Upload filtering_1.1.0.tar to the repository""" repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) - self.upload_file( repository, 'filtering/filtering_1.1.0.tar', commit_message="Uploaded filtering 1.1.0" ) + 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=True, + commit_message="Uploaded filtering 1.1.0", + strings_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 ) @@ -102,15 +110,27 @@ '''Upload filtering.txt file associated with tool version 1.1.0.''' repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.upload_file( repository, - 'filtering/filtering_0000.txt', - commit_message="Uploaded filtering.txt", - uncompress_file='No', - remove_repo_files_not_in_tar='No' ) + filename='filtering/filtering_0000.txt', + filepath=None, + valid_tools_only=True, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message="Uploaded filtering.txt", + strings_displayed=[], + strings_not_displayed=[] ) self.display_manage_repository_page( repository, strings_displayed=[ 'Readme file for filtering 1.1.0' ] ) def test_0055_upload_filtering_test_data( self ): '''Upload filtering test data.''' repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) - self.upload_file( repository, 'filtering/filtering_test_data.tar', commit_message="Uploaded filtering test data", remove_repo_files_not_in_tar='No' ) + self.upload_file( repository, + filename='filtering/filtering_test_data.tar', + filepath=None, + valid_tools_only=True, + uncompress_file=True, + remove_repo_files_not_in_tar=False, + commit_message="Uploaded filtering test data", + strings_displayed=[], + strings_not_displayed=[] ) self.display_repository_file_contents( repository=repository, filename='1.bed', filepath='test-data', @@ -121,9 +141,14 @@ '''Upload filtering 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, - 'filtering/filtering_2.2.0.tar', - commit_message="Uploaded filtering 2.2.0", - remove_repo_files_not_in_tar='No' ) + 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", + strings_displayed=[], + strings_not_displayed=[] ) def test_0065_verify_filtering_repository( self ): '''Verify the new tool versions and repository metadata.''' repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) @@ -138,7 +163,15 @@ 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, 'readme.txt', commit_message="Uploaded readme.txt" ) + 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 ) diff -r dde899d789b698f29269e521d2abc8a1f1373921 -r 3ffe47cea647ae61a02d74bbff68e0e07bff70e4 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 @@ -34,10 +34,14 @@ category_id=self.security.encode_id( category.id ), strings_displayed=[] ) self.upload_file( repository, - 'freebayes/freebayes.xml', + filename='freebayes/freebayes.xml', + filepath=None, valid_tools_only=False, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded the tool xml.', strings_displayed=[ 'Metadata may have been defined', 'This file requires an entry', 'tool_data_table_conf' ], - commit_message='Uploaded the tool xml.' ) + strings_not_displayed=[] ) 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, @@ -47,10 +51,14 @@ '''Upload the missing tool_data_table_conf.xml.sample file to the repository.''' repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.upload_file( repository, - 'freebayes/tool_data_table_conf.xml.sample', + filename='freebayes/tool_data_table_conf.xml.sample', + filepath=None, valid_tools_only=False, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded the tool data table sample file.', strings_displayed=[], - commit_message='Uploaded the tool data table sample file.' ) + strings_not_displayed=[] ) 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, @@ -60,30 +68,50 @@ '''Upload the missing sam_fa_indices.loc.sample file to the repository.''' repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.upload_file( repository, - 'freebayes/sam_fa_indices.loc.sample', + filename='freebayes/sam_fa_indices.loc.sample', + filepath=None, + valid_tools_only=True, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded tool data table .loc file.', strings_displayed=[], - commit_message='Uploaded tool data table .loc file.' ) + strings_not_displayed=[] ) def test_0025_upload_malformed_tool_dependency_xml( self ): '''Upload tool_dependencies.xml with bad characters in the readme tag.''' 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', 'malformed_tool_dependencies', 'tool_dependencies.xml' ), + filename=os.path.join( 'freebayes', 'malformed_tool_dependencies', 'tool_dependencies.xml' ), + filepath=None, valid_tools_only=False, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded malformed tool dependency XML.', strings_displayed=[ 'Exception attempting to parse tool_dependencies.xml', 'not well-formed' ], - commit_message='Uploaded malformed tool dependency XML.' ) + strings_not_displayed=[] ) def test_0030_upload_invalid_tool_dependency_xml( self ): '''Upload tool_dependencies.xml defining version 0.9.5 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', 'invalid_tool_dependencies', 'tool_dependencies.xml' ), + filename=os.path.join( 'freebayes', 'invalid_tool_dependencies', 'tool_dependencies.xml' ), + filepath=None, + valid_tools_only=False, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded invalid tool dependency XML.', strings_displayed=[ 'Name, version and type from a tool requirement tag does not match' ], - commit_message='Uploaded invalid tool dependency XML.' ) + strings_not_displayed=[] ) def test_0035_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.' ) + filename=os.path.join( 'freebayes', 'tool_dependencies.xml' ), + filepath=None, + valid_tools_only=True, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded valid tool dependency XML.', + strings_displayed=[], + strings_not_displayed=[] ) def test_0040_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 ) diff -r dde899d789b698f29269e521d2abc8a1f1373921 -r 3ffe47cea647ae61a02d74bbff68e0e07bff70e4 test/tool_shed/functional/test_0020_basic_repository_dependencies.py --- a/test/tool_shed/functional/test_0020_basic_repository_dependencies.py +++ b/test/tool_shed/functional/test_0020_basic_repository_dependencies.py @@ -37,7 +37,15 @@ owner=common.test_user_1_name, category_id=self.security.encode_id( category.id ), strings_displayed=[] ) - self.upload_file( repository, 'emboss/datatypes/datatypes_conf.xml', commit_message='Uploaded datatypes_conf.xml.' ) + self.upload_file( repository, + filename='emboss/datatypes/datatypes_conf.xml', + filepath=None, + valid_tools_only=True, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded datatypes_conf.xml.', + strings_displayed=[], + strings_not_displayed=[] ) def test_0015_verify_datatypes_in_datatypes_repository( self ): '''Verify that the emboss_datatypes repository contains datatype entries.''' repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) @@ -51,7 +59,15 @@ owner=common.test_user_1_name, category_id=self.security.encode_id( category.id ), strings_displayed=[] ) - self.upload_file( repository, 'emboss/emboss.tar', commit_message='Uploaded emboss_5.tar' ) + 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=[] ) 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 ) @@ -60,9 +76,14 @@ 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' ) + filename='repository_dependencies.xml', + filepath=repository_dependencies_path, + valid_tools_only=True, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded repository_dependencies.xml.', + strings_displayed=[], + strings_not_displayed=[] ) def test_0030_verify_emboss_5_dependencies( self ): '''Verify that the emboss_5 repository now depends on the emboss_datatypes repository with correct name, owner, and changeset revision.''' repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) diff -r dde899d789b698f29269e521d2abc8a1f1373921 -r 3ffe47cea647ae61a02d74bbff68e0e07bff70e4 test/tool_shed/functional/test_0030_repository_dependency_revisions.py --- a/test/tool_shed/functional/test_0030_repository_dependency_revisions.py +++ b/test/tool_shed/functional/test_0030_repository_dependency_revisions.py @@ -28,36 +28,83 @@ def test_0005_create_category( self ): """Create a category for this test suite""" self.create_category( name='Test 0030 Repository Dependency Revisions', description='Testing repository dependencies by revision.' ) - def test_0010_create_repositories( self ): - '''Create the emboss_5_0030, emboss_6_0030, emboss_datatypes_0030, and emboss_0030 repositories and populate the emboss_datatypes repository.''' + def test_0010_create_emboss_5_repository( self ): + '''Create and populate the emboss_5_0030 repository.''' self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) category = test_db_util.get_category_by_name( 'Test 0030 Repository Dependency Revisions' ) - emboss_5_repository = self.get_or_create_repository( name=emboss_5_repository_name, - description=emboss_repository_description, - long_description=emboss_repository_long_description, - owner=common.test_user_1_name, - category_id=self.security.encode_id( category.id ) ) - emboss_6_repository = self.get_or_create_repository( name=emboss_6_repository_name, - description=emboss_repository_description, - long_description=emboss_repository_long_description, - owner=common.test_user_1_name, - category_id=self.security.encode_id( category.id ) ) - datatypes_repository = self.get_or_create_repository( name=datatypes_repository_name, - description=emboss_repository_description, - long_description=emboss_repository_long_description, - owner=common.test_user_1_name, - category_id=self.security.encode_id( category.id ) ) - emboss_repository = self.get_or_create_repository( name=emboss_repository_name, + repository = self.get_or_create_repository( name=emboss_5_repository_name, + description=emboss_repository_description, + long_description=emboss_repository_long_description, + owner=common.test_user_1_name, + category_id=self.security.encode_id( category.id ) ) + self.upload_file( repository, + filename='emboss/emboss.tar', + filepath=None, + valid_tools_only=True, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded tool tarball.', + strings_displayed=[], + strings_not_displayed=[] ) + def test_0015_create_emboss_6_repository( self ): + '''Create and populate the emboss_6_0030 repository.''' + self.logout() + self.login( email=common.test_user_1_email, username=common.test_user_1_name ) + category = test_db_util.get_category_by_name( 'Test 0030 Repository Dependency Revisions' ) + repository = self.get_or_create_repository( name=emboss_6_repository_name, + description=emboss_repository_description, + long_description=emboss_repository_long_description, + owner=common.test_user_1_name, + category_id=self.security.encode_id( category.id ) ) + self.upload_file( repository, + filename='emboss/emboss.tar', + filepath=None, + valid_tools_only=True, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded tool tarball.', + strings_displayed=[], + strings_not_displayed=[] ) + def test_0020_create_emboss_datatypes_repository( self ): + '''Create and populate the emboss_datatypes_0030 repository.''' + self.logout() + self.login( email=common.test_user_1_email, username=common.test_user_1_name ) + category = test_db_util.get_category_by_name( 'Test 0030 Repository Dependency Revisions' ) + repository = self.get_or_create_repository( name=datatypes_repository_name, + description=emboss_repository_description, + long_description=emboss_repository_long_description, + owner=common.test_user_1_name, + category_id=self.security.encode_id( category.id ) ) + self.upload_file( repository, + filename='emboss/datatypes/datatypes_conf.xml', + filepath=None, + valid_tools_only=True, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded datatypes_conf.xml.', + strings_displayed=[], + strings_not_displayed=[] ) + def test_0025_create_emboss_repository( self ): + '''Create and populate the emboss_0030 repository.''' + self.logout() + self.login( email=common.test_user_1_email, username=common.test_user_1_name ) + category = test_db_util.get_category_by_name( 'Test 0030 Repository Dependency Revisions' ) + repository = self.get_or_create_repository( name=emboss_repository_name, description=emboss_repository_description, long_description=emboss_repository_long_description, owner=common.test_user_1_name, category_id=self.security.encode_id( category.id ) ) - self.upload_file( emboss_5_repository, 'emboss/emboss.tar', commit_message='Uploaded tool tarball.' ) - self.upload_file( emboss_6_repository, 'emboss/emboss.tar', commit_message='Uploaded tool tarball.' ) - 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.' ) - def test_0015_generate_repository_dependencies_for_emboss_5( self ): + self.upload_file( repository, + filename='emboss/emboss.tar', + filepath=None, + valid_tools_only=True, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded the tool tarball.', + strings_displayed=[], + strings_not_displayed=[] ) + def test_0030_generate_repository_dependencies_for_emboss_5( self ): '''Generate a repository_dependencies.xml file specifying emboss_datatypes and upload it to the emboss_5 repository.''' datatypes_repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) repository_dependencies_path = self.generate_temp_path( 'test_0030', additional_paths=[ 'emboss' ] ) @@ -65,18 +112,28 @@ 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_0020_generate_repository_dependencies_for_emboss_6( self ): + filename='repository_dependencies.xml', + filepath=repository_dependencies_path, + valid_tools_only=True, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded repository_dependencies.xml.', + strings_displayed=[], + strings_not_displayed=[] ) + def test_0035_generate_repository_dependencies_for_emboss_6( self ): '''Generate a repository_dependencies.xml file specifying emboss_datatypes and upload it to the emboss_6 repository.''' emboss_6_repository = test_db_util.get_repository_by_name_and_owner( emboss_6_repository_name, common.test_user_1_name ) repository_dependencies_path = self.generate_temp_path( 'test_0030', additional_paths=[ 'emboss' ] ) self.upload_file( emboss_6_repository, - 'repository_dependencies.xml', - filepath=repository_dependencies_path, - commit_message='Uploaded repository_depepndencies.xml.' ) - def test_0025_generate_repository_dependency_on_emboss_5( self ): + filename='repository_dependencies.xml', + filepath=repository_dependencies_path, + valid_tools_only=True, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded repository_dependencies.xml.', + strings_displayed=[], + strings_not_displayed=[] ) + def test_0040_generate_repository_dependency_on_emboss_5( self ): '''Create and upload repository_dependencies.xml for the emboss_5_0030 repository.''' emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) emboss_5_repository = test_db_util.get_repository_by_name_and_owner( emboss_5_repository_name, common.test_user_1_name ) @@ -85,10 +142,15 @@ self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), dependency_description='Emboss requires the Emboss 5 repository.' ) self.upload_file( emboss_repository, - 'repository_dependencies.xml', - filepath=repository_dependencies_path, - commit_message='Uploaded dependency configuration specifying emboss_5' ) - def test_0030_generate_repository_dependency_on_emboss_6( self ): + filename='repository_dependencies.xml', + filepath=repository_dependencies_path, + valid_tools_only=True, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded repository_dependencies.xml.', + strings_displayed=[], + strings_not_displayed=[] ) + 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 ) @@ -97,10 +159,15 @@ 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_0035_verify_repository_dependency_revisions( self ): + filename='repository_dependencies.xml', + filepath=repository_dependencies_path, + valid_tools_only=True, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded repository_dependencies.xml.', + strings_displayed=[], + strings_not_displayed=[] ) + def test_0050_verify_repository_dependency_revisions( self ): '''Verify that different metadata revisions of the emboss repository have different repository dependencies.''' repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) repository_metadata = [ ( metadata.metadata, metadata.changeset_revision ) for metadata in self.get_repository_metadata( repository ) ] @@ -120,7 +187,7 @@ self.display_manage_repository_page( repository, changeset_revision=changeset_revision, strings_displayed=strings_displayed ) - def test_0040_verify_repository_metadata( self ): + def test_0055_verify_repository_metadata( self ): '''Verify that resetting the metadata does not change it.''' emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) emboss_5_repository = test_db_util.get_repository_by_name_and_owner( emboss_5_repository_name, common.test_user_1_name ) diff -r dde899d789b698f29269e521d2abc8a1f1373921 -r 3ffe47cea647ae61a02d74bbff68e0e07bff70e4 test/tool_shed/functional/test_0040_repository_circular_dependencies.py --- a/test/tool_shed/functional/test_0040_repository_circular_dependencies.py +++ b/test/tool_shed/functional/test_0040_repository_circular_dependencies.py @@ -37,9 +37,14 @@ categories=[ 'test_0040_repository_circular_dependencies' ], strings_displayed=[] ) self.upload_file( repository, - 'freebayes/freebayes.tar', + filename='freebayes/freebayes.tar', + filepath=None, + valid_tools_only=True, + uncompress_file=True, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded the tool tarball.', strings_displayed=[], - commit_message='Uploaded freebayes.tar.' ) + strings_not_displayed=[] ) def test_0015_create_filtering_repository( self ): '''Create and populate filtering_0040.''' self.logout() @@ -51,9 +56,14 @@ categories=[ 'test_0040_repository_circular_dependencies' ], strings_displayed=[] ) self.upload_file( repository, - 'filtering/filtering_1.1.0.tar', + 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 the tool tarball for filtering 1.1.0.', strings_displayed=[], - commit_message='Uploaded filtering.tar.' ) + strings_not_displayed=[] ) def test_0020_create_dependency_on_freebayes( self ): '''Upload a repository_dependencies.xml file that specifies the current revision of freebayes to the filtering_0040 repository.''' # The dependency structure should look like: @@ -67,9 +77,14 @@ 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', + filename='repository_dependencies.xml', filepath=repository_dependencies_path, - commit_message='Uploaded dependency on freebayes' ) + valid_tools_only=True, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded dependency on freebayes.', + strings_displayed=[], + strings_not_displayed=[] ) 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: @@ -83,9 +98,14 @@ 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', + filename='repository_dependencies.xml', filepath=repository_dependencies_path, - commit_message='Uploaded dependency on filtering' ) + valid_tools_only=True, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded dependency on filtering.', + strings_displayed=[], + strings_not_displayed=[] ) 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 ) diff -r dde899d789b698f29269e521d2abc8a1f1373921 -r 3ffe47cea647ae61a02d74bbff68e0e07bff70e4 test/tool_shed/functional/test_0050_circular_dependencies_4_levels.py --- a/test/tool_shed/functional/test_0050_circular_dependencies_4_levels.py +++ b/test/tool_shed/functional/test_0050_circular_dependencies_4_levels.py @@ -58,9 +58,14 @@ category_id=self.security.encode_id( category.id ), strings_displayed=[] ) self.upload_file( repository, - 'convert_chars/convert_chars.tar', + filename='convert_chars/convert_chars.tar', + filepath=None, + valid_tools_only=True, + uncompress_file=True, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded convert_chars tarball.', strings_displayed=[], - commit_message='Uploaded convert_chars.tar.' ) + strings_not_displayed=[] ) def test_0010_create_column_repository( self ): '''Create and populate convert_chars_0050.''' category = self.create_category( name=category_name, description=category_description ) @@ -71,9 +76,14 @@ category_id=self.security.encode_id( category.id ), strings_displayed=[] ) self.upload_file( repository, - 'column_maker/column_maker.tar', + filename='column_maker/column_maker.tar', + filepath=None, + valid_tools_only=True, + uncompress_file=True, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded column_maker tarball.', strings_displayed=[], - commit_message='Uploaded column_maker.tar.' ) + strings_not_displayed=[] ) def test_0015_create_emboss_datatypes_repository( self ): '''Create and populate emboss_datatypes_0050.''' category = self.create_category( name=category_name, description=category_description ) @@ -86,9 +96,14 @@ category_id=self.security.encode_id( category.id ), strings_displayed=[] ) self.upload_file( repository, - 'emboss/datatypes/datatypes_conf.xml', + filename='emboss/datatypes/datatypes_conf.xml', + filepath=None, + valid_tools_only=True, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded datatypes_conf.xml.', strings_displayed=[], - commit_message='Uploaded datatypes_conf.xml.' ) + strings_not_displayed=[] ) def test_0020_create_emboss_repository( self ): '''Create and populate emboss_0050.''' category = self.create_category( name=category_name, description=category_description ) @@ -99,18 +114,28 @@ category_id=self.security.encode_id( category.id ), strings_displayed=[] ) self.upload_file( repository, - 'emboss/emboss.tar', + filename='emboss/emboss.tar', + filepath=None, + valid_tools_only=True, + uncompress_file=True, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded emboss tarball.', strings_displayed=[], - commit_message='Uploaded tool tarball.' ) + strings_not_displayed=[] ) datatypes_repository = test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name ) repository_dependencies_path = self.generate_temp_path( 'test_0050', additional_paths=[ 'emboss' ] ) self.generate_repository_dependency_xml( [ datatypes_repository ], self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), dependency_description='Emboss depends on the emboss_datatypes repository.' ) self.upload_file( repository, - 'repository_dependencies.xml', + filename='repository_dependencies.xml', filepath=repository_dependencies_path, - commit_message='Uploaded dependency on emboss_datatypes.' ) + valid_tools_only=True, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded dependency on emboss_datatypes.', + strings_displayed=[], + strings_not_displayed=[] ) def test_0025_create_filtering_repository( self ): '''Create and populate filtering_0050.''' category = self.create_category( name=category_name, description=category_description ) @@ -121,18 +146,28 @@ category_id=self.security.encode_id( category.id ), strings_displayed=[] ) self.upload_file( filtering_repository, - 'filtering/filtering_1.1.0.tar', + 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=[], - commit_message='Uploaded filtering.tar.' ) + strings_not_displayed=[] ) emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) repository_dependencies_path = self.generate_temp_path( 'test_0050', additional_paths=[ 'filtering' ] ) self.generate_repository_dependency_xml( [ emboss_repository ], self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), dependency_description='Filtering depends on the emboss repository.' ) self.upload_file( filtering_repository, - 'repository_dependencies.xml', + filename='repository_dependencies.xml', filepath=repository_dependencies_path, - commit_message='Uploaded dependency on emboss.' ) + valid_tools_only=True, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded dependency on emboss.', + strings_displayed=[], + strings_not_displayed=[] ) def test_0030_create_freebayes_repository( self ): '''Create and populate freebayes_0050.''' category = self.create_category( name=category_name, description=category_description ) @@ -143,9 +178,14 @@ category_id=self.security.encode_id( category.id ), strings_displayed=[] ) self.upload_file( repository, - 'freebayes/freebayes.tar', + 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=[], - commit_message='Uploaded freebayes.tar.' ) + strings_not_displayed=[] ) def test_0035_create_bismark_repository( self ): '''Create and populate bismark_0050.''' category = self.create_category( name=category_name, description=category_description ) @@ -156,10 +196,14 @@ category_id=self.security.encode_id( category.id ), strings_displayed=[] ) self.upload_file( repository, - 'bismark/bismark.tar', + filename='bismark/bismark.tar', + filepath=None, + valid_tools_only=False, + uncompress_file=True, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded bismark tarball.', strings_displayed=[], - valid_tools_only=False, - commit_message='Uploaded bismark.tar.' ) + strings_not_displayed=[] ) def test_0040_create_and_upload_dependency_definitions( self ): column_repository = test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name ) convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) diff -r dde899d789b698f29269e521d2abc8a1f1373921 -r 3ffe47cea647ae61a02d74bbff68e0e07bff70e4 test/tool_shed/functional/test_0060_workflows.py --- a/test/tool_shed/functional/test_0060_workflows.py +++ b/test/tool_shed/functional/test_0060_workflows.py @@ -6,6 +6,8 @@ repository_long_description="Long description of Galaxy's filtering tool for test 0060" workflow_filename = 'Workflow_for_0060_filter_workflow_repository.ga' workflow_name = 'Workflow for 0060_filter_workflow_repository' +category_name = 'Test 0060 Workflow Features' +category_description = 'Test 0060 for workflow features' class TestToolShedWorkflowFeatures( ShedTwillTestCase ): '''Test valid and invalid workflows.''' @@ -26,13 +28,14 @@ self.create_category( name='Test 0060 Workflow Features', description='Test 0060 - Workflow Features' ) def test_0010_create_repository( self ): """Create and populate the filtering repository""" + category = self.create_category( name=category_name, description=category_description ) self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) self.get_or_create_repository( name=repository_name, description=repository_description, long_description=repository_long_description, owner=common.test_user_1_name, - categories=[ 'Test 0060 Workflow Features' ], + category_id=self.security.encode_id( category.id ), strings_displayed=[] ) def test_0015_upload_workflow( self ): '''Upload a workflow with a missing tool, and verify that the tool specified is marked as missing.''' @@ -44,18 +47,27 @@ os.makedirs( workflow_filepath ) file( os.path.join( workflow_filepath, workflow_filename ), 'w+' ).write( workflow ) self.upload_file( repository, - workflow_filename, + filename=workflow_filename, filepath=workflow_filepath, - commit_message='Uploaded filtering workflow.' ) + 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.load_workflow_image_in_tool_shed( repository, workflow_name, strings_displayed=[ '#EBBCB2' ] ) def test_0020_upload_tool( self ): '''Upload the missing tool for the workflow in the previous step, and verify that the error is no longer present.''' repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name ) self.upload_file( repository, - 'filtering/filtering_2.2.0.tar', - commit_message="Uploaded filtering 2.2.0", - remove_repo_files_not_in_tar='No' ) -# raise Exception( self.get_repository_tip( 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.', + strings_displayed=[], + strings_not_displayed=[] ) self.load_workflow_image_in_tool_shed( repository, workflow_name, strings_not_displayed=[ '#EBBCB2' ] ) def test_0025_verify_repository_metadata( self ): '''Verify that resetting the metadata does not change it.''' diff -r dde899d789b698f29269e521d2abc8a1f1373921 -r 3ffe47cea647ae61a02d74bbff68e0e07bff70e4 test/tool_shed/functional/test_0070_invalid_tool.py --- a/test/tool_shed/functional/test_0070_invalid_tool.py +++ b/test/tool_shed/functional/test_0070_invalid_tool.py @@ -5,6 +5,7 @@ repository_description = "Galaxy's bismark wrapper" repository_long_description = "Long description of Galaxy's bismark wrapper" category_name = 'Test 0070 Invalid Tool Revisions' +category_description = 'Tests for a repository with invalid tool revisions.' class TestBismarkRepository( ShedTwillTestCase ): '''Testing bismark with valid and invalid tool entries.''' @@ -22,7 +23,7 @@ admin_user_private_role = test_db_util.get_private_role( admin_user ) def test_0005_create_category_and_repository( self ): """Create a category for this test suite, then create and populate a bismark repository. It should contain at least one each valid and invalid tool.""" - category = self.create_category( name=category_name, description='Tests for a repository with invalid tool revisions.' ) + category = self.create_category( name=category_name, description=category_description ) self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) repository = self.get_or_create_repository( name=repository_name, @@ -32,18 +33,25 @@ category_id=self.security.encode_id( category.id ), strings_displayed=[] ) self.upload_file( repository, - 'bismark/bismark.tar', + filename='bismark/bismark.tar', + filepath=None, valid_tools_only=False, - strings_displayed=[], - commit_message='Uploaded the tool tarball.' ) + uncompress_file=True, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded bismark tarball.', + strings_displayed=[], + strings_not_displayed=[] ) self.display_manage_repository_page( repository, strings_displayed=[ 'Invalid tools' ] ) invalid_revision = self.get_repository_tip( repository ) self.upload_file( repository, - 'bismark/bismark_methylation_extractor.xml', - valid_tools_only=False, - strings_displayed=[], - remove_repo_files_not_in_tar='No', - commit_message='Uploaded an updated tool xml.' ) + filename='bismark/bismark_methylation_extractor.xml', + filepath=None, + valid_tools_only=False, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded an updated tool xml.', + strings_displayed=[], + strings_not_displayed=[] ) valid_revision = self.get_repository_tip( repository ) test_db_util.refresh( repository ) self.check_repository_tools_for_changeset_revision( repository, valid_revision ) diff -r dde899d789b698f29269e521d2abc8a1f1373921 -r 3ffe47cea647ae61a02d74bbff68e0e07bff70e4 test/tool_shed/functional/test_0080_advanced_circular_dependencies.py --- a/test/tool_shed/functional/test_0080_advanced_circular_dependencies.py +++ b/test/tool_shed/functional/test_0080_advanced_circular_dependencies.py @@ -26,8 +26,8 @@ admin_user = test_db_util.get_user( common.admin_email ) assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email admin_user_private_role = test_db_util.get_private_role( admin_user ) - def test_0005_initiate_category_repositories( self ): - """Create a category for this test suite and add repositories to it.""" + def test_0005_create_column_repository( self ): + """Create and populate the column_maker repository.""" category = self.create_category( name=category_name, description=category_description ) self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) @@ -38,9 +38,21 @@ category_id=self.security.encode_id( category.id ), strings_displayed=[] ) self.upload_file( repository, - 'column_maker/column_maker.tar', + filename='column_maker/column_maker.tar', + filepath=None, + valid_tools_only=True, + uncompress_file=True, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded column_maker tarball.', strings_displayed=[], - commit_message='Uploaded column_maker.tar.' ) + strings_not_displayed=[] ) + def test_0005_create_convert_repository( self ): + """Create and populate the convert_chars repository.""" + self.logout() + self.login( email=common.admin_email, username=common.admin_username ) + category = self.create_category( name=category_name, description=category_description ) + self.logout() + self.login( email=common.test_user_1_email, username=common.test_user_1_name ) repository = self.get_or_create_repository( name=convert_repository_name, description=convert_repository_description, long_description=convert_repository_long_description, @@ -48,9 +60,14 @@ category_id=self.security.encode_id( category.id ), strings_displayed=[] ) self.upload_file( repository, - 'convert_chars/convert_chars.tar', + filename='convert_chars/convert_chars.tar', + filepath=None, + valid_tools_only=True, + uncompress_file=True, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded convert_chars tarball.', strings_displayed=[], - commit_message='Uploaded convert_chars.tar.' ) + strings_not_displayed=[] ) def test_0020_create_repository_dependencies( self ): '''Upload a repository_dependencies.xml file that specifies the current revision of freebayes to the filtering_0040 repository.''' convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name ) @@ -60,9 +77,14 @@ self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), dependency_description='Column maker depends on the convert repository.' ) self.upload_file( column_repository, - 'repository_dependencies.xml', - filepath=repository_dependencies_path, - commit_message='Uploaded dependency on convert' ) + filename='repository_dependencies.xml', + filepath=repository_dependencies_path, + valid_tools_only=True, + uncompress_file=True, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded dependency on convert_chars.', + strings_displayed=[], + strings_not_displayed=[] ) 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 ) @@ -72,9 +94,14 @@ 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' ) + filename='repository_dependencies.xml', + filepath=repository_dependencies_path, + valid_tools_only=True, + uncompress_file=True, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded dependency on column_maker.', + strings_displayed=[], + strings_not_displayed=[] ) 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 ) diff -r dde899d789b698f29269e521d2abc8a1f1373921 -r 3ffe47cea647ae61a02d74bbff68e0e07bff70e4 test/tool_shed/functional/test_0090_tool_search.py --- a/test/tool_shed/functional/test_0090_tool_search.py +++ b/test/tool_shed/functional/test_0090_tool_search.py @@ -54,9 +54,14 @@ category_id=self.security.encode_id( category.id ), strings_displayed=[] ) self.upload_file( repository, - 'bwa/bwa_base.tar', + filename='bwa/bwa_base.tar', + filepath=None, + valid_tools_only=True, + uncompress_file=True, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded BWA tarball.', strings_displayed=[], - commit_message='Uploaded bwa_base.tar.' ) + strings_not_displayed=[] ) def test_0010_create_bwa_color_repository( self ): '''Create and populate bwa_color_0090.''' category = self.create_category( name=category_name, description=category_description ) @@ -69,9 +74,14 @@ category_id=self.security.encode_id( category.id ), strings_displayed=[] ) self.upload_file( repository, - 'bwa/bwa_color.tar', + filename='bwa/bwa_color.tar', + filepath=None, + valid_tools_only=True, + uncompress_file=True, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded BWA color tarball.', strings_displayed=[], - commit_message='Uploaded bwa_color.tar.' ) + strings_not_displayed=[] ) def test_0015_create_emboss_datatypes_repository( self ): '''Create and populate emboss_datatypes_0090.''' category = self.create_category( name=category_name, description=category_description ) @@ -84,9 +94,14 @@ category_id=self.security.encode_id( category.id ), strings_displayed=[] ) self.upload_file( repository, - 'emboss/datatypes/datatypes_conf.xml', + filename='emboss/datatypes/datatypes_conf.xml', + filepath=None, + valid_tools_only=True, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded datatypes_conf.xml.', strings_displayed=[], - commit_message='Uploaded datatypes_conf.xml.' ) + strings_not_displayed=[] ) def test_0020_create_emboss_repository( self ): '''Create and populate emboss_0090.''' category = self.create_category( name=category_name, description=category_description ) @@ -97,18 +112,28 @@ category_id=self.security.encode_id( category.id ), strings_displayed=[] ) self.upload_file( repository, - 'emboss/emboss.tar', + filename='emboss/emboss.tar', + filepath=None, + valid_tools_only=True, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded emboss tarball.', strings_displayed=[], - commit_message='Uploaded tool tarball.' ) + strings_not_displayed=[] ) datatypes_repository = test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name ) repository_dependencies_path = self.generate_temp_path( 'test_0090', additional_paths=[ 'emboss' ] ) self.generate_repository_dependency_xml( [ datatypes_repository ], self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), dependency_description='Emboss depends on the emboss_datatypes repository.' ) self.upload_file( repository, - 'repository_dependencies.xml', - filepath=repository_dependencies_path, - commit_message='Uploaded dependency on emboss_datatypes.' ) + filename='repository_dependencies.xml', + filepath=repository_dependencies_path, + valid_tools_only=True, + uncompress_file=True, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded dependency on emboss_datatypes.', + strings_displayed=[], + strings_not_displayed=[] ) def test_0025_create_filtering_repository( self ): '''Create and populate filtering_0090.''' category = self.create_category( name=category_name, description=category_description ) @@ -119,18 +144,28 @@ category_id=self.security.encode_id( category.id ), strings_displayed=[] ) self.upload_file( filtering_repository, - 'filtering/filtering_1.1.0.tar', + 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=[], - commit_message='Uploaded filtering.tar.' ) + strings_not_displayed=[] ) emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name ) repository_dependencies_path = self.generate_temp_path( 'test_0090', additional_paths=[ 'filtering' ] ) self.generate_repository_dependency_xml( [ emboss_repository ], self.get_filename( 'repository_dependencies.xml', filepath=repository_dependencies_path ), dependency_description='Filtering depends on the emboss repository.' ) self.upload_file( filtering_repository, - 'repository_dependencies.xml', - filepath=repository_dependencies_path, - commit_message='Uploaded dependency on emboss.' ) + filename='repository_dependencies.xml', + filepath=repository_dependencies_path, + valid_tools_only=True, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded dependency on emboss.', + strings_displayed=[], + strings_not_displayed=[] ) def test_0030_create_freebayes_repository( self ): '''Create and populate freebayes_0090.''' category = self.create_category( name=category_name, description=category_description ) @@ -141,9 +176,14 @@ category_id=self.security.encode_id( category.id ), strings_displayed=[] ) self.upload_file( repository, - 'freebayes/freebayes.tar', + 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=[], - commit_message='Uploaded freebayes.tar.' ) + strings_not_displayed=[] ) def test_0035_create_and_upload_dependency_definitions( self ): '''Create and upload repository dependency definitions.''' bwa_color_repository = test_db_util.get_repository_by_name_and_owner( bwa_color_repository_name, common.test_user_1_name ) diff -r dde899d789b698f29269e521d2abc8a1f1373921 -r 3ffe47cea647ae61a02d74bbff68e0e07bff70e4 test/tool_shed/functional/test_0100_complex_repository_dependencies.py --- a/test/tool_shed/functional/test_0100_complex_repository_dependencies.py +++ b/test/tool_shed/functional/test_0100_complex_repository_dependencies.py @@ -38,9 +38,14 @@ category_id=self.security.encode_id( category.id ), strings_displayed=[] ) self.upload_file( repository, - 'bwa/complex/tool_dependencies.xml', + filename='bwa/complex/tool_dependencies.xml', + filepath=None, + valid_tools_only=True, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded tool_dependencies.xml.', strings_displayed=[ 'Name, version and type from a tool requirement tag does not match' ], - commit_message='Uploaded tool_dependencies.xml.' ) + strings_not_displayed=[] ) self.display_manage_repository_page( repository, strings_displayed=[ 'Tool dependencies', 'may not be', 'in this repository' ] ) def test_0010_create_bwa_base_repository( self ): '''Create and populate bwa_base_0100.''' @@ -55,9 +60,14 @@ strings_displayed=[] ) tool_repository = test_db_util.get_repository_by_name_and_owner( bwa_tool_repository_name, common.test_user_1_name ) self.upload_file( repository, - 'bwa/complex/bwa_base.tar', + filename='bwa/complex/bwa_base.tar', + filepath=None, + valid_tools_only=True, + uncompress_file=True, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded bwa_base.tar with tool wrapper XML, but without tool dependency XML.', strings_displayed=[], - commit_message='Uploaded bwa_base.tar with tool wrapper XML, but without tool dependency XML.' ) + strings_not_displayed=[] ) def test_0015_generate_complex_repository_dependency_invalid_shed_url( self ): '''Generate and upload a complex repository definition that specifies an invalid tool shed URL.''' dependency_path = self.generate_temp_path( 'test_0100', additional_paths=[ 'complex', 'invalid' ] ) @@ -71,34 +81,40 @@ self.generate_invalid_dependency_xml( xml_filename, url, name, owner, changeset_revision, complex=True, package='bwa', version='0.5.9' ) strings_displayed = [ 'Invalid tool shed <b>%s</b> defined' % url ] self.upload_file( repository, - 'tool_dependencies.xml', + filename='tool_dependencies.xml', + filepath=dependency_path, valid_tools_only=False, - filepath=dependency_path, + uncompress_file=False, + remove_repo_files_not_in_tar=False, commit_message='Uploaded dependency on bwa_tool_0100 with invalid url.', - strings_displayed=strings_displayed ) + strings_displayed=strings_displayed, + strings_not_displayed=[] ) def test_0020_generate_complex_repository_dependency_invalid_repository_name( self ): '''Generate and upload a complex repository definition that specifies an invalid repository name.''' dependency_path = self.generate_temp_path( 'test_0100', additional_paths=[ 'complex', 'invalid' ] ) xml_filename = self.get_filename( 'tool_dependencies.xml', filepath=dependency_path ) - repository = test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name ) + base_repository = test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name ) tool_repository = test_db_util.get_repository_by_name_and_owner( bwa_tool_repository_name, common.test_user_1_name ) url = self.url name = 'invalid_repository!?' owner = tool_repository.user.username changeset_revision = self.get_repository_tip( tool_repository ) self.generate_invalid_dependency_xml( xml_filename, url, name, owner, changeset_revision, complex=True, package='bwa', version='0.5.9' ) - strings_displayed = 'Invalid repository name <b>%s</b> defined.' % name - self.upload_file( repository, - 'tool_dependencies.xml', + strings_displayed = [ 'Invalid repository name <b>%s</b> defined.' % name ] + self.upload_file( base_repository, + filename='tool_dependencies.xml', + filepath=dependency_path, valid_tools_only=False, - filepath=dependency_path, + uncompress_file=False, + remove_repo_files_not_in_tar=False, commit_message='Uploaded dependency on bwa_tool_0100 with invalid repository name.', - strings_displayed=[ strings_displayed ] ) + strings_displayed=strings_displayed, + strings_not_displayed=[] ) def test_0025_generate_complex_repository_dependency_invalid_owner_name( self ): '''Generate and upload a complex repository definition that specifies an invalid owner.''' dependency_path = self.generate_temp_path( 'test_0100', additional_paths=[ 'complex', 'invalid' ] ) xml_filename = self.get_filename( 'tool_dependencies.xml', filepath=dependency_path ) - repository = test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name ) + base_repository = test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name ) tool_repository = test_db_util.get_repository_by_name_and_owner( bwa_tool_repository_name, common.test_user_1_name ) url = self.url name = tool_repository.name @@ -106,30 +122,36 @@ changeset_revision = self.get_repository_tip( tool_repository ) self.generate_invalid_dependency_xml( xml_filename, url, name, owner, changeset_revision, complex=True, package='bwa', version='0.5.9' ) strings_displayed = [ 'Invalid owner <b>%s</b> defined' % owner ] - self.upload_file( repository, - 'tool_dependencies.xml', + self.upload_file( base_repository, + filename='tool_dependencies.xml', + filepath=dependency_path, valid_tools_only=False, - filepath=dependency_path, + uncompress_file=False, + remove_repo_files_not_in_tar=False, commit_message='Uploaded dependency on bwa_tool_0100 with invalid owner.', - strings_displayed=strings_displayed ) + strings_displayed=strings_displayed, + strings_not_displayed=[] ) def test_0030_generate_complex_repository_dependency_invalid_changeset_revision( self ): '''Generate and upload a complex repository definition that specifies an invalid changeset revision.''' dependency_path = self.generate_temp_path( 'test_0100', additional_paths=[ 'complex', 'invalid' ] ) xml_filename = self.get_filename( 'tool_dependencies.xml', filepath=dependency_path ) - repository = test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name ) + base_repository = test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name ) tool_repository = test_db_util.get_repository_by_name_and_owner( bwa_tool_repository_name, common.test_user_1_name ) url = self.url name = tool_repository.name owner = tool_repository.user.username changeset_revision = '1234abcd' self.generate_invalid_dependency_xml( xml_filename, url, name, owner, changeset_revision, complex=True, package='bwa', version='0.5.9' ) - strings_displayed = 'Invalid changeset revision <b>%s</b> defined.' % changeset_revision - self.upload_file( repository, - 'tool_dependencies.xml', + strings_displayed = [ 'Invalid changeset revision <b>%s</b> defined.' % changeset_revision ] + self.upload_file( base_repository, + filename='tool_dependencies.xml', + filepath=dependency_path, valid_tools_only=False, - filepath=dependency_path, + uncompress_file=False, + remove_repo_files_not_in_tar=False, commit_message='Uploaded dependency on bwa_tool_0100 with invalid changeset revision.', - strings_displayed=[ strings_displayed ] ) + strings_displayed=strings_displayed, + strings_not_displayed=[] ) 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 ) @@ -142,10 +164,14 @@ 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', + filename='tool_dependencies.xml', + filepath=dependency_path, valid_tools_only=True, - filepath=dependency_path, - commit_message='Uploaded valid complex dependency on bwa_tool_0100.' ) + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded valid complex dependency on bwa_tool_0100.', + strings_displayed=[], + strings_not_displayed=[] ) self.check_repository_dependency( base_repository, tool_repository ) self.display_manage_repository_page( base_repository, strings_displayed=[ 'bwa', '0.5.9', 'package' ] ) def test_0040_generate_tool_dependency( self ): @@ -160,10 +186,14 @@ 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, + 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=[], - commit_message='Uploaded new tool_dependencies.xml.' ) + 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' ], diff -r dde899d789b698f29269e521d2abc8a1f1373921 -r 3ffe47cea647ae61a02d74bbff68e0e07bff70e4 test/tool_shed/functional/test_0110_invalid_simple_repository_dependencies.py --- a/test/tool_shed/functional/test_0110_invalid_simple_repository_dependencies.py +++ b/test/tool_shed/functional/test_0110_invalid_simple_repository_dependencies.py @@ -40,7 +40,15 @@ owner=common.test_user_1_name, category_id=self.security.encode_id( category.id ), strings_displayed=[] ) - self.upload_file( repository, 'emboss/datatypes/datatypes_conf.xml', commit_message='Uploaded datatypes_conf.xml.' ) + self.upload_file( repository, + filename='emboss/datatypes/datatypes_conf.xml', + filepath=None, + valid_tools_only=True, + uncompress_file=True, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded datatypes_conf.xml.', + strings_displayed=[], + strings_not_displayed=[] ) def test_0015_verify_datatypes_in_datatypes_repository( self ): '''Verify that the emboss_datatypes repository contains datatype entries.''' repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name ) @@ -54,7 +62,15 @@ owner=common.test_user_1_name, category_id=self.security.encode_id( category.id ), strings_displayed=[] ) - self.upload_file( repository, 'emboss/emboss.tar', commit_message='Uploaded emboss_5.tar' ) + 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 tool tarball.', + strings_displayed=[], + strings_not_displayed=[] ) def test_0025_generate_repository_dependency_with_invalid_url( self ): '''Generate a repository dependency for emboss 5 with an invalid URL.''' dependency_path = self.generate_temp_path( 'test_0110', additional_paths=[ 'simple' ] ) @@ -68,11 +84,14 @@ self.generate_invalid_dependency_xml( xml_filename, url, name, owner, changeset_revision, complex=False, description='This is invalid.' ) strings_displayed = [ 'Invalid tool shed <b>%s</b> defined for repository <b>%s</b>' % ( url, repository.name ) ] self.upload_file( emboss_repository, - 'repository_dependencies.xml', + filename='repository_dependencies.xml', + filepath=dependency_path, valid_tools_only=False, - filepath=dependency_path, + uncompress_file=False, + remove_repo_files_not_in_tar=False, commit_message='Uploaded dependency on emboss_datatypes_0110 with invalid url.', - strings_displayed=strings_displayed ) + strings_displayed=strings_displayed, + strings_not_displayed=[] ) def test_0030_generate_repository_dependency_with_invalid_name( self ): '''Generate a repository dependency for emboss 5 with an invalid name.''' dependency_path = self.generate_temp_path( 'test_0110', additional_paths=[ 'simple' ] ) @@ -86,11 +105,14 @@ self.generate_invalid_dependency_xml( xml_filename, url, name, owner, changeset_revision, complex=False, description='This is invalid.' ) strings_displayed = [ 'Invalid repository name <b>%s</b> defined.' % name ] self.upload_file( emboss_repository, - 'repository_dependencies.xml', + filename='repository_dependencies.xml', + filepath=dependency_path, valid_tools_only=False, - filepath=dependency_path, - commit_message='Uploaded dependency on emboss_datatypes_0110 with invalid url.', - strings_displayed=strings_displayed ) + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded dependency on emboss_datatypes_0110 with invalid name.', + strings_displayed=strings_displayed, + strings_not_displayed=[] ) def test_0035_generate_repository_dependency_with_invalid_owner( self ): '''Generate a repository dependency for emboss 5 with an invalid owner.''' dependency_path = self.generate_temp_path( 'test_0110', additional_paths=[ 'simple' ] ) @@ -104,11 +126,14 @@ self.generate_invalid_dependency_xml( xml_filename, url, name, owner, changeset_revision, complex=False, description='This is invalid.' ) strings_displayed = [ 'Invalid owner <b>%s</b> defined for repository <b>%s</b>' % ( owner, repository.name ) ] self.upload_file( emboss_repository, - 'repository_dependencies.xml', + filename='repository_dependencies.xml', + filepath=dependency_path, valid_tools_only=False, - filepath=dependency_path, - commit_message='Uploaded dependency on emboss_datatypes_0110 with invalid url.', - strings_displayed=strings_displayed ) + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded dependency on emboss_datatypes_0110 with invalid owner.', + strings_displayed=strings_displayed, + strings_not_displayed=[] ) def test_0040_generate_repository_dependency_with_invalid_changeset_revision( self ): '''Generate a repository dependency for emboss 5 with an invalid changeset revision.''' dependency_path = self.generate_temp_path( 'test_0110', additional_paths=[ 'simple', 'invalid' ] ) @@ -122,8 +147,11 @@ self.generate_invalid_dependency_xml( xml_filename, url, name, owner, changeset_revision, complex=False, description='This is invalid.' ) strings_displayed = [ 'Invalid changeset revision <b>%s</b> defined.' % changeset_revision ] self.upload_file( emboss_repository, - 'repository_dependencies.xml', + filename='repository_dependencies.xml', + filepath=dependency_path, valid_tools_only=False, - filepath=dependency_path, - commit_message='Uploaded dependency on emboss_datatypes_0110 with invalid url.', - strings_displayed=strings_displayed ) + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded dependency on emboss_datatypes_0110 with invalid changeset revision.', + strings_displayed=strings_displayed, + strings_not_displayed=[] ) diff -r dde899d789b698f29269e521d2abc8a1f1373921 -r 3ffe47cea647ae61a02d74bbff68e0e07bff70e4 test/tool_shed/functional/test_0300_reset_all_metadata.py --- a/test/tool_shed/functional/test_0300_reset_all_metadata.py +++ b/test/tool_shed/functional/test_0300_reset_all_metadata.py @@ -23,15 +23,12 @@ admin_user = test_db_util.get_user( common.admin_email ) assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email admin_user_private_role = test_db_util.get_private_role( admin_user ) - def test_0005_create_repositories_and_categories( self ): + def test_0005_create_filtering_repository( self ): + '''Create and populate the filtering_0000 repository.''' + self.logout() + self.login( email=common.admin_email, username=common.admin_username ) 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', @@ -40,34 +37,119 @@ 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" ) + 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=[] ) + def test_0010_create_freebayes_repository( self ): + '''Create and populate the freebayes_0010 repository.''' + self.logout() + self.login( email=common.admin_email, username=common.admin_username ) + category_0010 = self.create_category( name='Test 0010 Repository With Tool Dependencies', description='Tests for a repository with tool dependencies.' ) + self.logout() + self.login( email=common.test_user_1_email, username=common.test_user_1_name ) 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 ), + category_id=self.security.encode_id( category_0010.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.' ) + 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=[] ) + def test_0015_create_emboss_repository( self ): + '''Create and populate the emboss_0020 repository.''' + self.logout() + self.login( email=common.admin_email, username=common.admin_username ) + category_0020 = self.create_category( name='Test 0020 Basic Repository Dependencies', description='Testing basic repository dependency features.' ) + self.logout() + self.login( email=common.test_user_1_email, username=common.test_user_1_name ) repository = self.get_or_create_repository( name='emboss_datatypes_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 ), + category_id=self.security.encode_id( category_0020.id ), strings_displayed=[] ) if self.repository_is_new( repository ): - self.upload_file( repository, 'emboss/datatypes/datatypes_conf.xml', commit_message='Uploaded datatypes_conf.xml.' ) + 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, 'emboss/emboss.tar', commit_message='Uploaded emboss_5.tar' ) + 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=[] ) + def test_0020_create_emboss_datatypes_repository( self ): + '''Create and populate the emboss_0030 repository.''' + self.logout() + self.login( email=common.admin_email, username=common.admin_username ) + category_0030 = self.create_category( name='Test 0030 Repository Dependency Revisions', description='Testing repository dependencies by revision.' ) + self.logout() + self.login( email=common.test_user_1_email, username=common.test_user_1_name ) datatypes_repository = self.get_or_create_repository( name='emboss_datatypes_0030', description=datatypes_repository_description, long_description=datatypes_repository_long_description, @@ -75,55 +157,114 @@ 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.' ) + 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=[] ) 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' ) + 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' ] ) 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', + filename='repository_dependencies.xml', filepath=repository_dependencies_path, - commit_message='Uploaded repository_dependencies.xml' ) + valid_tools_only=True, + uncompress_file=True, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded repository_dependencies.xml', + strings_displayed=[], + strings_not_displayed=[] ) 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' ) + 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' ] ) 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', + filename='repository_dependencies.xml', filepath=repository_dependencies_path, - commit_message='Uploaded repository_dependencies.xml' ) + valid_tools_only=True, + uncompress_file=True, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded repository_dependencies.xml', + strings_displayed=[], + strings_not_displayed=[] ) 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' ) + 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' ] ) 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', + filename='repository_dependencies.xml', filepath=repository_dependencies_path, - commit_message='Uploaded repository_dependencies.xml' ) + valid_tools_only=True, + uncompress_file=True, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded repository_dependencies.xml', + strings_displayed=[], + strings_not_displayed=[] ) 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', + filename='repository_dependencies.xml', filepath=repository_dependencies_path, - commit_message='Uploaded repository_dependencies.xml' ) + valid_tools_only=True, + uncompress_file=True, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded repository_dependencies.xml', + strings_displayed=[], + strings_not_displayed=[] ) + def test_0025_create_freebayes_repository( self ): + '''Create and populate the freebayes_0040 repository.''' + self.logout() + self.login( email=common.admin_email, username=common.admin_username ) + category_0040 = self.create_category( name='test_0040_repository_circular_dependencies', description='Testing handling of circular repository dependencies.' ) + self.logout() + self.login( email=common.test_user_1_email, username=common.test_user_1_name ) repository = self.get_or_create_repository( name='freebayes_0040', description="Galaxy's freebayes tool", long_description="Long description of Galaxy's freebayes tool", @@ -131,14 +272,30 @@ 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.' ) + 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, 'filtering/filtering_1.1.0.tar', commit_message='Uploaded filtering.tar.' ) + 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' ] ) @@ -146,16 +303,33 @@ 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', + filename='repository_dependencies.xml', filepath=repository_dependencies_path, - commit_message='Uploaded dependency on freebayes' ) + valid_tools_only=True, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded repository_dependencies.xml specifying freebayes', + strings_displayed=[], + strings_not_displayed=[] ) 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', + filename='repository_dependencies.xml', filepath=repository_dependencies_path, - commit_message='Uploaded dependency on filtering' ) + valid_tools_only=True, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded repository_dependencies.xml specifying filtering', + strings_displayed=[], + strings_not_displayed=[] ) + def test_0030_create_emboss_repository( self ): + '''Create and populate the emboss_0050 repository.''' + self.logout() + self.login( email=common.admin_email, username=common.admin_username ) + category_0050 = self.create_category( name='test_0050_repository_n_level_circular_dependencies', description='Testing handling of circular repository dependencies to n levels.' ) + self.logout() + self.login( email=common.test_user_1_email, username=common.test_user_1_name ) datatypes_repository = self.get_or_create_repository( name='emboss_datatypes_0050', description="Datatypes for emboss", long_description="Long description of Emboss' datatypes", @@ -181,41 +355,100 @@ 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.' ) + 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' ] ) 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', + filename='repository_dependencies.xml', filepath=repository_dependencies_path, - commit_message='Uploaded dependency on emboss_datatypes.' ) + valid_tools_only=True, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded repository_dependencies.xml', + strings_displayed=[], + strings_not_displayed=[] ) repository_dependencies_path = self.generate_temp_path( 'test_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', + filename='repository_dependencies.xml', filepath=repository_dependencies_path, - commit_message='Uploaded dependency on emboss.' ) + valid_tools_only=True, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded repository_dependencies.xml', + strings_displayed=[], + strings_not_displayed=[] ) repository_dependencies_path = self.generate_temp_path( 'test_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', + filename='repository_dependencies.xml', filepath=repository_dependencies_path, - commit_message='Uploaded dependency on filtering.' ) + valid_tools_only=True, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded repository_dependencies.xml', + strings_displayed=[], + strings_not_displayed=[] ) 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', + filename='repository_dependencies.xml', filepath=repository_dependencies_path, - commit_message='Uploaded dependency on filtering.' ) + valid_tools_only=True, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded repository_dependencies.xml', + strings_displayed=[], + strings_not_displayed=[] ) + def test_0035_create_filtering_repository( self ): + '''Create and populate the filtering_0060 repository.''' + self.logout() + self.login( email=common.admin_email, username=common.admin_username ) + 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 ) workflow_repository = self.get_or_create_repository( name='filtering_0060', description="Galaxy's filtering tool", long_description="Long description of Galaxy's filtering tool", @@ -226,16 +459,28 @@ 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 ) + 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, - workflow_filename, + filename=workflow_filename, filepath=workflow_filepath, - commit_message='Uploaded filtering workflow.' ) + 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, - 'filtering/filtering_2.2.0.tar', - commit_message='Uploaded filtering tool.' ) - def test_0010_reset_metadata_on_all_repositories( self ): + 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_0040_reset_metadata_on_all_repositories( self ): '''Reset metadata on all repositories, then verify that it has not changed.''' self.logout() self.login( email=common.admin_email, username=common.admin_username ) diff -r dde899d789b698f29269e521d2abc8a1f1373921 -r 3ffe47cea647ae61a02d74bbff68e0e07bff70e4 test/tool_shed/functional/test_0400_repository_component_reviews.py --- a/test/tool_shed/functional/test_0400_repository_component_reviews.py +++ b/test/tool_shed/functional/test_0400_repository_component_reviews.py @@ -100,7 +100,15 @@ owner=common.test_user_1_name, category_id=self.security.encode_id( category.id ), strings_displayed=strings_displayed ) - self.upload_file( repository, 'filtering/filtering_1.1.0.tar', commit_message="Uploaded filtering 1.1.0" ) + self.upload_file( repository, + filename='filtering/filtering_1.1.0.tar', + filepath=None, + valid_tools_only=True, + uncompress_file=True, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded filtering 1.1.0 tarball.', + strings_displayed=[], + strings_not_displayed=[] ) def test_0020_review_initial_revision_data_types( self ): '''Review the datatypes component for the current tip revision.''' """ @@ -396,7 +404,15 @@ 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 ) - self.upload_file( repository, 'readme.txt', commit_message="Uploaded readme.txt" ) + 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=[] ) def test_0095_review_new_changeset_readme_component( self ): '''Update the filtering repository's readme component review to reflect the presence of the readme file.''' """ @@ -452,10 +468,15 @@ """ 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 ) - self.upload_file( repository, - 'filtering/filtering_test_data.tar', - commit_message="Uploaded test data.", - remove_repo_files_not_in_tar='No' ) + self.upload_file( repository, + filename='filtering/filtering_test_data.tar', + filepath=None, + valid_tools_only=True, + uncompress_file=True, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded filtering 1.1.0 tarball.', + strings_displayed=[], + strings_not_displayed=[] ) def test_0110_review_new_changeset_functional_tests( self ): '''Update the filtering repository's readme component review to reflect the presence of the readme file.''' """ @@ -509,9 +530,14 @@ 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 ) self.upload_file( repository, - 'filtering/filtering_2.2.0.tar', - commit_message="Uploaded filtering 2.2.0", - remove_repo_files_not_in_tar='No' ) + 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_0125_review_new_changeset_functional_tests( self ): '''Update the filtering repository's review to apply to the new changeset with filtering 2.2.0.''' """ diff -r dde899d789b698f29269e521d2abc8a1f1373921 -r 3ffe47cea647ae61a02d74bbff68e0e07bff70e4 test/tool_shed/functional/test_1000_install_basic_repository.py --- a/test/tool_shed/functional/test_1000_install_basic_repository.py +++ b/test/tool_shed/functional/test_1000_install_basic_repository.py @@ -32,10 +32,42 @@ owner=common.test_user_1_name, category_id=self.security.encode_id( category.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_0000.txt', commit_message="Uploaded readme for 1.1.0", remove_repo_files_not_in_tar='No' ) - self.upload_file( repository, 'filtering/filtering_2.2.0.tar', commit_message="Uploaded filtering 2.2.0", remove_repo_files_not_in_tar='No' ) - self.upload_file( repository, 'readme.txt', commit_message="Uploaded readme for 2.2.0", remove_repo_files_not_in_tar='No' ) + 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_0000.txt', + filepath=None, + valid_tools_only=True, + uncompress_file=False, + remove_repo_files_not_in_tar=False, + commit_message='Uploaded readme for 1.1.0', + 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=[] ) + 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 for 2.2.0', + strings_displayed=[], + strings_not_displayed=[] ) def test_0010_browse_tool_sheds( self ): """Browse the available tool sheds in this Galaxy instance.""" self.galaxy_logout() This diff is so big that we needed to truncate the remainder. Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket