galaxy-commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
December 2013
- 1 participants
- 207 discussions
commit/galaxy-central: greg: Fix in the tool shed's install and test framework.
by commits-noreply@bitbucket.org 16 Dec '13
by commits-noreply@bitbucket.org 16 Dec '13
16 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/46521f5722c6/
Changeset: 46521f5722c6
User: greg
Date: 2013-12-16 23:25:23
Summary: Fix in the tool shed's install and test framework.
Affected #: 1 file
diff -r 32d4520018961092d767e350c9a2ad49031347d1 -r 46521f5722c621a8b84d2a8101af87d82cc5eba8 test/install_and_test_tool_shed_repositories/functional_tests.py
--- a/test/install_and_test_tool_shed_repositories/functional_tests.py
+++ b/test/install_and_test_tool_shed_repositories/functional_tests.py
@@ -525,7 +525,7 @@
deactivate_repository( app, repository_dict )
else:
# We are uninstalling this repository and all of its repository dependencies.
- uninstall_repository( app, repository_dict )
+ uninstall_repository_and_repository_dependencies( app, repository_dict )
results_dict[ 'repositories_failed_install' ].append( dict( name=str( repository.name ),
owner=str( repository.owner ),
changeset_revision=str( repository.changeset_revision ) ) )
@@ -730,7 +730,7 @@
deactivate_repository( app, repository_dict )
else:
# We are uninstalling this repository and all of its repository dependencies.
- uninstall_repository( app, repository_dict )
+ uninstall_repository_and_repository_dependencies( app, repository_dict )
except:
log.exception( 'Encountered error attempting to deactivate or uninstall %s.', str( repository_dict[ 'name' ] ) )
results_dict[ 'repositories_failed_install' ].append( repository_identifier_dict )
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.
1
0
commit/galaxy-central: jmchilton: RFC: API design guidelines and considerations.
by commits-noreply@bitbucket.org 16 Dec '13
by commits-noreply@bitbucket.org 16 Dec '13
16 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/32d452001896/
Changeset: 32d452001896
User: jmchilton
Date: 2013-12-16 22:57:31
Summary: RFC: API design guidelines and considerations.
Affected #: 1 file
diff -r 2025eca47bca55eb69d3ea4fe95c54b3163e61ac -r 32d4520018961092d767e350c9a2ad49031347d1 doc/source/lib/galaxy.webapps.galaxy.api.rst
--- a/doc/source/lib/galaxy.webapps.galaxy.api.rst
+++ b/doc/source/lib/galaxy.webapps.galaxy.api.rst
@@ -208,7 +208,8 @@
API Return Codes and Formats
==================
-TODO (here, or add a new page and link it)
+A set of error codes for API requests is being established and will be
+documented here. This is a long-term project however so stayed tuned.
API Controllers
===============
@@ -397,3 +398,67 @@
:undoc-members:
:show-inheritance:
+
+API Design Guidelines
+=====================
+
+The following section outlines guidelines related to extending and/or modifing
+the Galaxy API. The Galaxy API has grown in an ad-hoc fashion over time by
+many contributors and so clients SHOULD NOT expect the API will conform to
+these guidelines - but developers contributing to the Galaxy API SHOULD follow
+these guidelines.
+
+ - API functionality should include docstring documentation for consumption
+ by readthedocs.org.
+ - Developers should familarize themselves with the HTTP status code definitions
+ http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html. The API responses
+ should properly set the status code according to the result - in particular
+ 2XX responses should be used for successful requests, 4XX for various
+ kinds of client errors, and 5XX for errors on the server side.
+ - If there is an error processing some part of request (one item in a list
+ for instance), the status code should be set to reflect the error and the
+ partial result may or may not be returned depending on the controller -
+ this behavior should be documented.
+ - (TODO) API methods should throw a finite number of exceptions (defined in)
+ `galaxy.exceptions` and these should subclass `MessageException` and not
+ paste/wsgi HTTP exceptions. When possible, the framework itself should be
+ responsible catching these exceptions, setting the status code, and
+ building an error response.
+ - Error responses should not consist of plain text strings - they should be
+ dictionaries describing the error and containing the following keys (TODO:
+ spell out nature of this.) Various error conditions (once a format has
+ been chosen and framework to enforce it in place) should be spelled out
+ in this document.
+ - Backward compatibility is important and should maintained when possible.
+ If changing behavior in a non-backward compatibile way please ensure one
+ of the following holds - there is a strong reason to believe no consumers
+ depend on a behavior, the behavior is effectively broken, or the API
+ method being modified has not been part of a tagged dist release.
+
+The following bullet points represent good practices more than guidelines, please
+consider them when modifying the API.
+
+ - Functionality should not be copied and pasted between controllers -
+ consider refactoring functionality into associated classes or short of
+ that into Mixins (http://en.wikipedia.org/wiki/Composition_over_inheritance)
+ - API additions are more permanent changes to Galaxy than many other potential
+ changes and so a second opinion on API changes should be sought. (Consider a
+ pull request!)
+ - New API functionality should include functional tests. These functional
+ tests should be implemented in Python and placed in
+ `test/functional/api`. (Once such a framework is in place - it is not
+ right now).
+ - Changes to reflect modifications to the API should be pushed upstream to
+ the BioBlend project possible.
+
+Longer term goals/notes.
+
+ - It would be advantageous to have a clearer separation of anonymous and
+ admin handling functionality.
+ - If at some point in the future, functionality needs to be added that
+ breaks backward compatibility in a significant way to a compontent used by
+ the community should be alerted - a "dev" variant of the API will be
+ established and the community should be alerted and given a timeframe
+ for when the old behavior will be replaced with the new behavior.
+ - Consistent standards for range-based requests, batch requests, filtered
+ requests, etc... should be established and documented here.
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.
1
0
commit/galaxy-central: greg: Fix for uninstalling repositories in an ordered fashion.
by commits-noreply@bitbucket.org 16 Dec '13
by commits-noreply@bitbucket.org 16 Dec '13
16 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/2025eca47bca/
Changeset: 2025eca47bca
User: greg
Date: 2013-12-16 22:01:25
Summary: Fix for uninstalling repositories in an ordered fashion.
Affected #: 1 file
diff -r 10f283c957e5f8dbca6c93aae7655926600a3d12 -r 2025eca47bca55eb69d3ea4fe95c54b3163e61ac test/install_and_test_tool_shed_repositories/functional_tests.py
--- a/test/install_and_test_tool_shed_repositories/functional_tests.py
+++ b/test/install_and_test_tool_shed_repositories/functional_tests.py
@@ -1363,10 +1363,9 @@
# Run the uninstall method.
result, _ = run_tests( test_config )
success = result.wasSuccessful()
- if not success:
- log.debug( 'Uninstallation of revision %s of repository %s owned by %s failed: %s' % \
- ( rd_changeset_revision, rd_name, rd_owner, str( e ) ) )
- break
+ if not success:
+ log.debug( 'Uninstallation of revision %s of repository %s owned by %s failed: %s' % \
+ ( rd_changeset_revision, rd_name, rd_owner, str( e ) ) )
else:
log.debug( 'Uninstallation of revision %s of repository %s owned by %s failed.' % ( changeset_revision, name, owner ) )
else:
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.
1
0
commit/galaxy-central: greg: Enhance the tool shed's install and test framework to uninstall repositories in an ordered fashion so that repositories are not uninstalled when they are dependencies of other installed repositories.
by commits-noreply@bitbucket.org 16 Dec '13
by commits-noreply@bitbucket.org 16 Dec '13
16 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/10f283c957e5/
Changeset: 10f283c957e5
User: greg
Date: 2013-12-16 21:52:29
Summary: Enhance the tool shed's install and test framework to uninstall repositories in an ordered fashion so that repositories are not uninstalled when they are dependencies of other installed repositories.
Affected #: 6 files
diff -r f2ce61f7d1ad2ea38faedf952aa0abf60ca06e2c -r 10f283c957e5f8dbca6c93aae7655926600a3d12 lib/tool_shed/scripts/check_tool_dependency_definition_repositories.py
--- a/lib/tool_shed/scripts/check_tool_dependency_definition_repositories.py
+++ b/lib/tool_shed/scripts/check_tool_dependency_definition_repositories.py
@@ -30,6 +30,7 @@
from galaxy.model.orm import and_
from galaxy.model.orm import not_
from galaxy.model.orm import select
+from galaxy.util import listify
from galaxy.web import url_for
from tool_shed.repository_types.util import TOOL_DEPENDENCY_DEFINITION
diff -r f2ce61f7d1ad2ea38faedf952aa0abf60ca06e2c -r 10f283c957e5f8dbca6c93aae7655926600a3d12 test/base/tool_shed_util.py
--- a/test/base/tool_shed_util.py
+++ b/test/base/tool_shed_util.py
@@ -38,6 +38,47 @@
return None, repository_name, changeset_revision
return last_galaxy_test_file_dir, last_tested_repository_name, last_tested_changeset_revision
+def log_reason_repository_cannot_be_uninstalled( app, repository ):
+ # This method should be altered if / when the app.install_model.ToolShedRepository.can_uninstall()
+ # method is altered. Any block returning a False value from that method should be handled here.
+ name = str( repository.name )
+ owner = str( repository.owner )
+ installed_changeset_revision = str( repository.installed_changeset_revision )
+ log.debug( "Revision %s of repository %s owned by %s cannot be uninstalled because:" % \
+ ( installed_changeset_revision, name, owner ) )
+ if repository.status == app.install_model.ToolShedRepository.installation_status.UNINSTALLED:
+ log.debug( 'it is already uninstalled.' )
+ else:
+ irm = app.installed_repository_manager
+ repository_tup = ( str( repository.tool_shed ), name, owner, installed_changeset_revision )
+ # Find other installed repositories that require this repository.
+ installed_dependent_repository_tups = \
+ irm.installed_dependent_repositories_of_installed_repositories.get( repository_tup, [] )
+ if installed_dependent_repository_tups:
+ for installed_dependent_repository_tup in installed_dependent_repository_tups:
+ idr_tool_shed, idr_name, idr_owner, idr_installed_changeset_revision = installed_dependent_repository_tup
+ log.debug( "it is required by revision %s of repository %s owned by %s" % \
+ ( idr_installed_changeset_revision, idr_name, idr_owner ) )
+ else:
+ # Find installed tool dependencies that require this repository's installed tool dependencies.
+ installed_dependent_td_tups = None
+ installed_tool_dependency_tups = irm.installed_tool_dependencies_of_installed_repositories.get( repository_tup, [] )
+ for td_tup in installed_tool_dependency_tups:
+ installed_dependent_td_tups = \
+ irm.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies.get( td_tup, [] )
+ if installed_dependent_td_tups is not None:
+ # This repository cannot be uninstalled because it contains installed tool dependencies that
+ # are required at run time by other installed tool dependencies.
+ log.debug( "it contains installed tool dependencies that are required at run time by these installed tool dependencies:" )
+ for installed_dependent_td_tup in installed_dependent_td_tups:
+ repository_id, td_name, td_version, td_type = installed_dependent_td_tup
+ dependent_repository = test_db_util.get_repository( repository_id )
+ dr_name = str( dependent_repository.name )
+ dr_owner = str( dependent_repository.owner )
+ dr_installed_changeset_revison = str( dependent_repository.installed_changeset_revision )
+ log.debug( "- version %s of %s %s contained in revision %s of repository %s owned by %s" % \
+ ( td_version, td_type, td_name, dr_installed_changeset_revison, dr_name, dr_owner ) )
+
def parse_tool_panel_config( config, shed_tools_dict ):
"""
Parse a shed-related tool panel config to generate the shed_tools_dict. This only happens when testing tools installed from the tool shed.
diff -r f2ce61f7d1ad2ea38faedf952aa0abf60ca06e2c -r 10f283c957e5f8dbca6c93aae7655926600a3d12 test/install_and_test_tool_shed_repositories/base/test_db_util.py
--- a/test/install_and_test_tool_shed_repositories/base/test_db_util.py
+++ b/test/install_and_test_tool_shed_repositories/base/test_db_util.py
@@ -26,16 +26,15 @@
def get_repository( repository_id ):
return database_contexts.install_context.query( install_model.ToolShedRepository ) \
- .filter( install_model.ToolShedRepository.table.c.id == repository_id ) \
- .first()
+ .filter( install_model.ToolShedRepository.table.c.id == repository_id ) \
+ .first()
def get_installed_repository_by_name_owner_changeset_revision( name, owner, changeset_revision ):
return database_contexts.install_context.query( install_model.ToolShedRepository ) \
- .filter( and_( install_model.ToolShedRepository.table.c.name == name,
- install_model.ToolShedRepository.table.c.owner == owner,
- install_model.ToolShedRepository.table.c.installed_changeset_revision == changeset_revision ) ) \
- .one()
-
+ .filter( and_( install_model.ToolShedRepository.table.c.name == name,
+ install_model.ToolShedRepository.table.c.owner == owner,
+ install_model.ToolShedRepository.table.c.installed_changeset_revision == changeset_revision ) ) \
+ .one()
def get_private_role( user ):
for role in user.all_roles():
@@ -46,18 +45,18 @@
def get_tool_dependencies_for_installed_repository( repository_id, status=None, exclude_status=None ):
if status is not None:
return database_contexts.install_context.query( install_model.ToolDependency ) \
- .filter( and_( install_model.ToolDependency.table.c.tool_shed_repository_id == repository_id,
- install_model.ToolDependency.table.c.status == status ) ) \
- .all()
+ .filter( and_( install_model.ToolDependency.table.c.tool_shed_repository_id == repository_id,
+ install_model.ToolDependency.table.c.status == status ) ) \
+ .all()
elif exclude_status is not None:
return database_contexts.install_context.query( install_model.ToolDependency ) \
- .filter( and_( install_model.ToolDependency.table.c.tool_shed_repository_id == repository_id,
- install_model.ToolDependency.table.c.status != exclude_status ) ) \
- .all()
+ .filter( and_( install_model.ToolDependency.table.c.tool_shed_repository_id == repository_id,
+ install_model.ToolDependency.table.c.status != exclude_status ) ) \
+ .all()
else:
return database_contexts.install_context.query( install_model.ToolDependency ) \
- .filter( install_model.ToolDependency.table.c.tool_shed_repository_id == repository_id ) \
- .all()
+ .filter( install_model.ToolDependency.table.c.tool_shed_repository_id == repository_id ) \
+ .all()
def mark_obj_deleted( obj ):
obj.deleted = True
@@ -75,5 +74,5 @@
def get_user( email ):
return database_contexts.galaxy_context.query( model.User ) \
- .filter( model.User.table.c.email==email ) \
- .first()
+ .filter( model.User.table.c.email==email ) \
+ .first()
diff -r f2ce61f7d1ad2ea38faedf952aa0abf60ca06e2c -r 10f283c957e5f8dbca6c93aae7655926600a3d12 test/install_and_test_tool_shed_repositories/base/twilltestcase.py
--- a/test/install_and_test_tool_shed_repositories/base/twilltestcase.py
+++ b/test/install_and_test_tool_shed_repositories/base/twilltestcase.py
@@ -28,19 +28,14 @@
self.shed_tools_dict = {}
self.home()
- def deactivate_or_uninstall_repository( self, installed_repository, deactivate=False ):
- url = '/admin_toolshed/deactivate_or_uninstall_repository?id=%s' % self.security.encode_id( installed_repository.id )
+ def deactivate_repository( self, repository ):
+ """Deactivate a repository."""
+ url = '/admin_toolshed/deactivate_or_uninstall_repository?id=%s' % self.security.encode_id( repository.id )
self.visit_url( url )
- if deactivate:
- tc.fv ( 1, "remove_from_disk", 'false' )
- else:
- tc.fv ( 1, "remove_from_disk", 'true' )
+ tc.fv ( 1, "remove_from_disk", 'false' )
tc.submit( 'deactivate_or_uninstall_repository_button' )
strings_displayed = [ 'The repository named' ]
- if deactivate:
- strings_displayed.append( 'has been deactivated' )
- else:
- strings_displayed.append( 'has been uninstalled' )
+ strings_displayed.append( 'has been deactivated' )
self.check_for_strings( strings_displayed, strings_not_displayed=[] )
def initiate_installation_process( self,
@@ -129,7 +124,18 @@
log.debug( 'No field %s in form %s, discarding from return value.' % ( str( control ), str( form_id ) ) )
del( kwd[ field_name ] )
return kwd
-
+
+ def uninstall_repository( self, repository ):
+ """Uninstall a repository."""
+ # A repository can be uninstalled only if no dependent repositories are installed.
+ url = '/admin_toolshed/deactivate_or_uninstall_repository?id=%s' % self.security.encode_id( repository.id )
+ self.visit_url( url )
+ tc.fv ( 1, "remove_from_disk", 'true' )
+ tc.submit( 'deactivate_or_uninstall_repository_button' )
+ strings_displayed = [ 'The repository named' ]
+ strings_displayed.append( 'has been uninstalled' )
+ self.check_for_strings( strings_displayed, strings_not_displayed=[] )
+
def visit_url( self, url, allowed_codes=[ 200 ] ):
new_url = tc.go( url )
return_code = tc.browser.get_code()
@@ -145,11 +151,13 @@
if repository_ids:
for repository_id in repository_ids:
galaxy_repository = test_db_util.get_repository( self.security.decode_id( repository_id ) )
- log.debug( 'Repository %s with ID %s has initial state %s.' % ( str( galaxy_repository.name ), str( repository_id ), str( galaxy_repository.status ) ) )
+ log.debug( 'Repository %s with ID %s has initial state %s.' % \
+ ( str( galaxy_repository.name ), str( repository_id ), str( galaxy_repository.status ) ) )
timeout_counter = 0
while galaxy_repository.status not in final_states:
test_db_util.refresh( galaxy_repository )
- log.debug( 'Repository %s with ID %s is in state %s, continuing to wait.' % ( str( galaxy_repository.name ), str( repository_id ), str( galaxy_repository.status ) ) )
+ log.debug( 'Repository %s with ID %s is in state %s, continuing to wait.' % \
+ ( str( galaxy_repository.name ), str( repository_id ), str( galaxy_repository.status ) ) )
timeout_counter = timeout_counter + 1
if timeout_counter % 10 == 0:
log.debug( 'Waited %d seconds for repository %s.' % ( timeout_counter, str( galaxy_repository.name ) ) )
diff -r f2ce61f7d1ad2ea38faedf952aa0abf60ca06e2c -r 10f283c957e5f8dbca6c93aae7655926600a3d12 test/install_and_test_tool_shed_repositories/functional/test_install_repositories.py
--- a/test/install_and_test_tool_shed_repositories/functional/test_install_repositories.py
+++ b/test/install_and_test_tool_shed_repositories/functional/test_install_repositories.py
@@ -9,27 +9,74 @@
class InstallTestRepositories( InstallTestRepository ):
"""Abstract test case that installs and uninstalls a predefined list of repositories."""
- def do_installation( self, repository_info_dict ):
+ def do_deactivate( self, repository_dict ):
+ self.logout()
+ self.login( email='test(a)bx.psu.edu', username='test' )
+ admin_user = test_db_util.get_user( 'test(a)bx.psu.edu' )
+ assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email
+ # Get the repository defined by the received repository_dict along with all of its repository dependencies
+ # from the database.
+ name = repository_dict[ 'name' ]
+ owner = repository_dict[ 'owner' ]
+ changeset_revision = repository_dict[ 'changeset_revision' ]
+ repository = test_db_util.get_installed_repository_by_name_owner_changeset_revision( name, owner, changeset_revision )
+ admin_user_private_role = test_db_util.get_private_role( admin_user )
+ # Uninstall the repository through the web interface using twill.
+ self.deactivate_repository( repository )
+
+ def do_install( self, repository_dict ):
self.logout()
self.login( email='test(a)bx.psu.edu', username='test' )
admin_user = test_db_util.get_user( 'test(a)bx.psu.edu' )
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 )
- # Install the repository through the web interface using twill.
- self.install_repository( repository_info_dict )
+ # Install the repository through the web interface using twill. The install_repository() method may
+ # actually install more than this singe repository because repository dependencies can be installed.
+ self.install_repository( repository_dict )
- def do_deactivate_or_uninstall( self, repository_info_dict, deactivate=False ):
+ def do_uninstall( self, repository_dict ):
self.logout()
self.login( email='test(a)bx.psu.edu', username='test' )
admin_user = test_db_util.get_user( 'test(a)bx.psu.edu' )
assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email
- # Get the repository from the database.
- repository = test_db_util.get_installed_repository_by_name_owner_changeset_revision( repository_info_dict[ 'name' ],
- repository_info_dict[ 'owner' ],
- repository_info_dict[ 'changeset_revision' ] )
+ # Get the repository defined by the received repository_dict along with all of its repository dependencies
+ # from the database.
+ name = repository_dict[ 'name' ]
+ owner = repository_dict[ 'owner' ]
+ changeset_revision = repository_dict[ 'changeset_revision' ]
+ repository = test_db_util.get_installed_repository_by_name_owner_changeset_revision( name, owner, changeset_revision )
admin_user_private_role = test_db_util.get_private_role( admin_user )
- # Uninstall the repository through the web interface using twill.
- self.deactivate_or_uninstall_repository( repository, deactivate )
+ # Uninstall the repository and all of its repository dependencies through the Galaxy web interface using twill.
+ self.uninstall_repository( repository )
+
+def generate_deactivate_method( repository_dict=None ):
+ """Generate abstract test cases for the received repository_dict."""
+ if repository_dict is None:
+ return
+ # Push all the toolbox tests to module level
+ G = globals()
+ # Eliminate all previous tests from G.
+ for key, val in G.items():
+ if key.startswith( 'TestInstallRepository_' ) or key.startswith( 'TestForTool_' ):
+ del G[ key ]
+ # Create a new subclass with a method named install_repository_XXX that deactivates the
+ # repository specified by the received repository_dict.
+ name = "TestDeactivateRepository_%s_%s" % \
+ ( str( repository_dict[ 'name' ] ), str( repository_dict[ 'changeset_revision' ] ) )
+ baseclasses = ( InstallTestRepositories, )
+ namespace = dict()
+ def make_deactivate_method( repository_dict ):
+ def test_deactivate_repository( self ):
+ self.do_deactivate( repository_dict )
+ return test_deactivate_repository
+ test_method = make_deactivate_method( repository_dict )
+ test_method.__doc__ = "Deactivate the repository %s." % str( repository_dict[ 'name' ] )
+ namespace[ 'uninstall_repository_%s_%s' % ( str( repository_dict[ 'name' ] ),
+ str( repository_dict[ 'changeset_revision' ] ) ) ] = test_method
+ # The new.classobj function returns a new class object, with name name, derived
+ # from baseclasses (which should be a tuple of classes) and with namespace dict.
+ new_class_obj = new.classobj( str( name ), baseclasses, namespace )
+ G[ name ] = new_class_obj
def generate_install_method( repository_dict=None ):
"""Generate abstract test cases for the defined list of repositories."""
@@ -47,17 +94,18 @@
namespace = dict()
def make_install_method( repository_dict ):
def test_install_repository( self ):
- self.do_installation( repository_dict )
+ self.do_install( repository_dict )
return test_install_repository
test_method = make_install_method( repository_dict )
- test_method.__doc__ = "Install the repository %s from %s." % ( repository_dict[ 'name' ], repository_dict[ 'tool_shed_url' ] )
- namespace[ 'install_repository_%s' % repository_dict[ 'name' ] ] = test_method
- # The new.classobj function returns a new class object, with name name, derived
+ test_method.__doc__ = "Install the repository %s from %s." % \
+ ( str( repository_dict[ 'name' ] ), str( repository_dict[ 'tool_shed_url' ] ) )
+ namespace[ 'install_repository_%s' % str( repository_dict[ 'name' ] ) ] = test_method
+ # The new.classobj function returns a new class object with name name derived
# from baseclasses (which should be a tuple of classes) and with namespace dict.
new_class_obj = new.classobj( str( name ), baseclasses, namespace )
G[ name ] = new_class_obj
-def generate_deactivate_or_uninstall_method( repository_dict=None, deactivate=False ):
+def generate_uninstall_method( repository_dict=None ):
"""Generate abstract test cases for the received repository_dict."""
if repository_dict is None:
return
@@ -67,17 +115,20 @@
for key, val in G.items():
if key.startswith( 'TestInstallRepository_' ) or key.startswith( 'TestForTool_' ):
del G[ key ]
- # Create a new subclass with a method named install_repository_XXX that installs the repository specified by the provided dict.
- name = "TestUninstallRepository_%s_%s" % ( repository_dict[ 'name' ], repository_dict[ 'changeset_revision' ] )
+ # Create a new subclass with a method named install_repository_XXX that installs the repository
+ # specified by the received repository_dict.
+ name = "TestUninstallRepository_%s_%s" % \
+ ( str( repository_dict[ 'name' ] ), str( repository_dict[ 'changeset_revision' ] ) )
baseclasses = ( InstallTestRepositories, )
namespace = dict()
- def make_deactivate_or_uninstall_method( repository_dict ):
- def test_install_repository( self ):
- self.do_deactivate_or_uninstall( repository_dict, deactivate )
- return test_install_repository
- test_method = make_deactivate_or_uninstall_method( repository_dict )
- test_method.__doc__ = "Deactivate or uninstall the repository %s." % repository_dict[ 'name' ]
- namespace[ 'uninstall_repository_%s_%s' % ( str( repository_dict[ 'name' ] ), repository_dict[ 'changeset_revision' ] ) ] = test_method
+ def make_uninstall_method( repository_dict ):
+ def test_uninstall_repository( self ):
+ self.do_uninstall( repository_dict )
+ return test_uninstall_repository
+ test_method = make_uninstall_method( repository_dict )
+ test_method.__doc__ = "Uninstall the repository %s." % repository_dict[ 'name' ]
+ namespace[ 'uninstall_repository_%s_%s' % ( str( repository_dict[ 'name' ] ),
+ str( repository_dict[ 'changeset_revision' ] ) ) ] = test_method
# The new.classobj function returns a new class object, with name name, derived
# from baseclasses (which should be a tuple of classes) and with namespace dict.
new_class_obj = new.classobj( str( name ), baseclasses, namespace )
diff -r f2ce61f7d1ad2ea38faedf952aa0abf60ca06e2c -r 10f283c957e5f8dbca6c93aae7655926600a3d12 test/install_and_test_tool_shed_repositories/functional_tests.py
--- a/test/install_and_test_tool_shed_repositories/functional_tests.py
+++ b/test/install_and_test_tool_shed_repositories/functional_tests.py
@@ -42,6 +42,7 @@
import tool_shed.util.shed_util_common as suc
import urllib
+from base.tool_shed_util import log_reason_repository_cannot_be_uninstalled
from base.tool_shed_util import parse_tool_panel_config
from install_and_test_tool_shed_repositories.base.util import get_database_version
from install_and_test_tool_shed_repositories.base.util import get_repository_current_revision
@@ -64,7 +65,6 @@
from functional import database_contexts
-
log = logging.getLogger( 'install_and_test_repositories' )
assert sys.version_info[ :2 ] >= ( 2, 6 )
@@ -222,58 +222,62 @@
return []
def deactivate_repository( app, repository_dict ):
+ sa_session = app.install_model.context
# Clean out any generated tests. This is necessary for Twill.
remove_generated_tests( app )
- sa_session = app.install_model.context.current
# The dict contains the only repository the app should have installed at this point.
- repository = test_db_util.get_installed_repository_by_name_owner_changeset_revision( str( repository_dict[ 'name' ] ),
- str( repository_dict[ 'owner' ] ),
- str( repository_dict[ 'changeset_revision' ] ) )
- # We have to do this through Twill, in order to maintain app.toolbox and shed_tool_conf.xml in a state that is valid for future tests.
- for required_repository in repository.repository_dependencies:
- repository_dict = dict( name=required_repository.name,
- owner=required_repository.owner,
- changeset_revision=required_repository.changeset_revision )
- # Generate a test method to uninstall this repository through the embedded Galaxy application's web interface.
- test_install_repositories.generate_deactivate_or_uninstall_method( repository_dict, deactivate=True )
- log.debug( 'Changeset revision %s of %s repository %s selected for deactivation.' % \
- ( str( required_repository.changeset_revision ), str( required_repository.status ), str( required_repository.name ) ) )
- repository_dict = dict( name=repository.name,
- owner=repository.owner,
- changeset_revision=repository.changeset_revision )
- test_install_repositories.generate_deactivate_or_uninstall_method( repository_dict, deactivate=True )
- log.debug( 'Changeset revision %s of %s repository %s selected for deactivation.' % \
- ( str( repository.changeset_revision ), str( repository.status ), str( repository.name ) ) )
+ name = str( repository_dict[ 'name' ] )
+ owner = str( repository_dict[ 'owner' ] )
+ changeset_revision = str( repository_dict[ 'changeset_revision' ] )
+ repository = test_db_util.get_installed_repository_by_name_owner_changeset_revision( name, owner, changeset_revision )
+ repository_dict_for_deactivation = dict( name=name,
+ owner=owner,
+ changeset_revision=changeset_revision )
+ log.debug( 'Changeset revision %s of repository %s owned by %s selected for deactivation.' % ( changeset_revision, name, owner ) )
+ test_install_repositories.generate_deactivate_method( repository_dict_for_deactivation )
# Set up nose to run the generated uninstall method as a functional test.
test_config = nose.config.Config( env=os.environ, plugins=nose.plugins.manager.DefaultPluginManager() )
test_config.configure( sys.argv )
- # Run the uninstall method. This method uses the Galaxy web interface to uninstall the previously installed
- # repository and delete it from disk.
+ # Run the deactivate method which uses the Galaxy web interface to deactivate the repository.
result, _ = run_tests( test_config )
success = result.wasSuccessful()
if not success:
- log.debug( 'Failed deactivation of repository %s.' % str( repository.name ) )
+ log.debug( 'Deactivation of revision %s repository %s owned by %s failed.' % ( changeset_revision, name, owner ) )
-def extract_log_data( test_result, from_tool_test=True ):
- '''Extract any useful data from the test_result.failures and test_result.errors attributes.'''
- log_data = []
+def get_api_url( base, parts=[], params=None ):
+ if 'api' in parts and parts.index( 'api' ) != 0:
+ parts.pop( parts.index( 'api' ) )
+ parts.insert( 0, 'api' )
+ elif 'api' not in parts:
+ parts.insert( 0, 'api' )
+ url = suc.url_join( base, *parts )
+ if params is not None:
+ query_string = urllib.urlencode( params )
+ url += '?%s' % query_string
+ return url
+
+def get_failed_test_dicts( test_result, from_tool_test=True ):
+ """Extract any useful data from the test_result.failures and test_result.errors attributes."""
+ failed_test_dicts = []
for failure in test_result.failures + test_result.errors:
- # Record the twill test identifier and information about the tool, so the repository owner can discover which test is failing.
- test_id = str( failure[0] )
+ # Record the twill test identifier and information about the tool so the repository owner
+ # can discover which test is failing.
+ test_id = str( failure[ 0 ] )
if not from_tool_test:
tool_id = None
tool_version = None
else:
tool_id, tool_version = get_tool_info_from_test_id( test_id )
- test_status = dict( test_id=test_id, tool_id=tool_id, tool_version=tool_version )
- log_output = failure[1].replace( '\\n', '\n' )
- # Remove debug output that the reviewer or owner doesn't need.
+ test_status_dict = dict( test_id=test_id, tool_id=tool_id, tool_version=tool_version )
+ log_output = failure[ 1 ].replace( '\\n', '\n' )
+ # Remove debug output.
log_output = re.sub( r'control \d+:.+', r'', log_output )
log_output = re.sub( r'\n+', r'\n', log_output )
appending_to = 'output'
tmp_output = {}
output = {}
- # Iterate through the functional test output and extract only the important data. Captured logging and stdout are not recorded.
+ # Iterate through the functional test output and extract only the important data. Captured
+ # logging and stdout are not recorded.
for line in log_output.split( '\n' ):
if line.startswith( 'Traceback' ):
appending_to = 'traceback'
@@ -290,26 +294,15 @@
elif '>> begin captured stderr <<' in line or '>> begin tool stderr <<' in line:
appending_to = 'stderr'
continue
- if appending_to not in tmp_output:
- tmp_output[ appending_to ] = []
- tmp_output[ appending_to ].append( line )
+ if appending_to in tmp_output:
+ tmp_output[ appending_to ].append( line )
+ else:
+ tmp_output[ appending_to ] = [ line ]
for output_type in [ 'stderr', 'traceback' ]:
if output_type in tmp_output:
- test_status[ output_type ] = '\n'.join( tmp_output[ output_type ] )
- log_data.append( test_status )
- return log_data
-
-def get_api_url( base, parts=[], params=None ):
- if 'api' in parts and parts.index( 'api' ) != 0:
- parts.pop( parts.index( 'api' ) )
- parts.insert( 0, 'api' )
- elif 'api' not in parts:
- parts.insert( 0, 'api' )
- url = suc.url_join( base, *parts )
- if params is not None:
- query_string = urllib.urlencode( params )
- url += '?%s' % query_string
- return url
+ test_status_dict[ output_type ] = '\n'.join( tmp_output[ output_type ] )
+ failed_test_dicts.append( test_status_dict )
+ return failed_test_dicts
def get_latest_downloadable_changeset_revision( url, name, owner ):
error_message = ''
@@ -415,16 +408,16 @@
if tsr_changeset_revision == rti_changeset_revision:
return repository_dicts, error_message
return repository_dicts, error_message
- # Get a list of repositories to test from the tool shed specified in the GALAXY_INSTALL_TEST_TOOL_SHED_URL environment variable.
+ # Get a list of repositories to test from the tool shed specified in the GALAXY_INSTALL_TEST_TOOL_SHED_URL
+ # environment variable.
log.debug( "The Tool Shed's API url...\n%s" % str( api_url ) )
log.debug( "...retrieved %d repository revisions for testing." % len( repository_dicts ) )
- #if '-list_repositories' in sys.argv:
log.debug( "Repository revisions for testing:" )
for repository_dict in repository_dicts:
- log.debug( "Revision %s of repository %s owned by %s" % \
- ( str( repository_dict.get( 'changeset_revision', None ) ), \
- str( repository_dict.get( 'name', None ) ), \
- str( repository_dict.get( 'owner', None ) ) ) )
+ name = str( repository_dict.get( 'name', None ) )
+ owner = str( repository_dict.get( 'owner', None ) )
+ changeset_revision = str( repository_dict.get( 'changeset_revision', None ) )
+ log.debug( "Revision %s of repository %s owned by %s" % ( changeset_revision, name, owner ) )
return repository_dicts, error_message
def get_static_settings():
@@ -488,16 +481,23 @@
log.debug( 'The following dependencies of this repository are missing, so skipping functional tests.' )
# In keeping with the standard display layout, add the error message to the dict for each tool individually.
for dependency in repository.missing_tool_dependencies:
- log.debug( 'Missing tool dependency %s of type %s version %s: %s' % \
- ( str( dependency.name ), str( dependency.type ), str( dependency.version ), unicodify( dependency.error_message ) ) )
+ name = str( dependency.name )
+ type = str( dependency.type )
+ version = str( dependency.version )
+ error_message = unicodify( dependency.error_message )
+ log.debug( 'Missing tool dependency %s of type %s version %s: %s' % ( name, type, version, error_message ) )
test_result = dict( type=dependency.type,
name=dependency.name,
version=dependency.version,
error_message=dependency.error_message )
tool_test_results_dict[ 'installation_errors' ][ 'tool_dependencies' ].append( test_result )
for dependency in repository.missing_repository_dependencies:
+ name = str( dependency.name )
+ owner = str( dependency.owner )
+ changeset_revision = str( dependency.changeset_revision )
+ error_message = unicodify( dependency.error_message )
log.debug( 'Missing repository dependency %s changeset revision %s owned by %s: %s' % \
- ( str( dependency.name ), str( dependency.changeset_revision ), str( dependency.owner ), unicodify( dependency.error_message ) ) )
+ ( name, changeset_revision, owner, error_message ) )
test_result = dict( tool_shed=dependency.tool_shed,
name=dependency.name,
owner=dependency.owner,
@@ -509,7 +509,11 @@
do_not_test=False,
test_install_error=True )
# TODO: do something useful with response_dict
- response_dict = register_test_result( galaxy_tool_shed_url, tool_test_results_dicts, tool_test_results_dict, repository_dict, params )
+ response_dict = register_test_result( galaxy_tool_shed_url,
+ tool_test_results_dicts,
+ tool_test_results_dict,
+ repository_dict,
+ params )
# Since this repository is missing components, we do not want to test it, so deactivate it or uninstall it.
# The deactivate flag is set to True if the environment variable GALAXY_INSTALL_TEST_KEEP_TOOL_DEPENDENCIES
# is set to 'true'.
@@ -533,19 +537,19 @@
# Initialize a dictionary for the summary that will be printed to stdout.
results_dict = {}
results_dict[ 'total_repositories_tested' ] = 0
- results_dict[ 'repositories_passed' ] = []
- results_dict[ 'repositories_failed' ] = []
+ results_dict[ 'all_tests_passed' ] = []
+ results_dict[ 'at_least_one_test_failed' ] = []
results_dict[ 'repositories_failed_install' ] = []
return results_dict
def install_repository( app, repository_dict ):
- """Attempt to install a repository defined by the received repository_dict from the tool shed into Galaxy."""
+ """Install a repository defined by the received repository_dict from the tool shed into Galaxy."""
name = str( repository_dict[ 'name' ] )
owner = str( repository_dict[ 'owner' ] )
changeset_revision = str( repository_dict[ 'changeset_revision' ] )
error_message = ''
repository = None
- log.debug( "Installing revision %s of repository %s owned by %s..." % ( str( changeset_revision ), str( name ), str( owner ) ) )
+ log.debug( "Installing revision %s of repository %s owned by %s." % ( changeset_revision, name, owner ) )
# Explicitly clear tests from twill's test environment.
remove_generated_tests( app )
# Use the repository information dictionary to generate an install method that will install the repository into the
@@ -560,8 +564,7 @@
try:
repository = test_db_util.get_installed_repository_by_name_owner_changeset_revision( name, owner, changeset_revision )
except Exception, e:
- error_message = 'Error getting revision %s of installed repository %s owned by %s: %s' % \
- ( str( changeset_revision ), str( name ), str( owner ), str( e ) )
+ error_message = 'Error getting revision %s of repository %s owned by %s: %s' % ( changeset_revision, name, owner, str( e ) )
log.exception( error_message )
return repository, error_message
@@ -624,6 +627,7 @@
owner = str( repository_dict[ 'owner' ] )
changeset_revision = str( repository_dict[ 'changeset_revision' ] )
log.debug( "Processing revision %s of repository %s owned by %s..." % ( changeset_revision, name, owner ) )
+ repository_identifier_dict = dict( name=name, owner=owner, changeset_revision=changeset_revision )
# Retrieve the stored list of tool_test_results_dicts.
tool_test_results_dicts, error_message = get_tool_test_results_dicts( galaxy_tool_shed_url, encoded_repository_metadata_id )
if error_message:
@@ -715,7 +719,11 @@
test_install_error=True,
do_not_test=False )
# TODO: do something useful with response_dict
- response_dict = register_test_result( galaxy_tool_shed_url, tool_test_results_dicts, tool_test_results_dict, repository_dict, params )
+ response_dict = register_test_result( galaxy_tool_shed_url,
+ tool_test_results_dicts,
+ tool_test_results_dict,
+ repository_dict,
+ params )
try:
if deactivate:
# We are deactivating this repository and all of its repository dependencies.
@@ -725,7 +733,7 @@
uninstall_repository( app, repository_dict )
except:
log.exception( 'Encountered error attempting to deactivate or uninstall %s.', str( repository_dict[ 'name' ] ) )
- results_dict[ 'repositories_failed_install' ].append( dict( name=name, owner=owner, changeset_revision=changeset_revision ) )
+ results_dict[ 'repositories_failed_install' ].append( repository_identifier_dict )
log.debug( 'Repository %s failed to install correctly.' % str( name ) )
else:
# Configure and run functional tests for this repository. This is equivalent to sh run_functional_tests.sh -installed
@@ -773,12 +781,12 @@
do_not_test=False,
test_install_error=False )
# TODO: do something useful with response_dict
- response_dict = register_test_result( galaxy_tool_shed_url,
- tool_test_results_dicts,
- tool_test_results_dict,
- repository_dict,
- params )
- results_dict[ 'repositories_failed' ].append( dict( name=name, owner=owner, changeset_revision=changeset_revision ) )
+ response_dict = register_test_result( galaxy_tool_shed_url,
+ tool_test_results_dicts,
+ tool_test_results_dict,
+ repository_dict,
+ params )
+ results_dict[ 'at_least_one_test_failed' ].append( repository_identifier_dict )
total_repositories_tested += 1
results_dict[ 'total_repositories_tested' ] = total_repositories_tested
return results_dict, error_message
@@ -1015,8 +1023,8 @@
log.debug( error_message )
else:
total_repositories_tested = results_dict[ 'total_repositories_tested' ]
- repositories_passed = results_dict[ 'repositories_passed' ]
- repositories_failed = results_dict[ 'repositories_failed' ]
+ all_tests_passed = results_dict[ 'all_tests_passed' ]
+ at_least_one_test_failed = results_dict[ 'at_least_one_test_failed' ]
repositories_failed_install = results_dict[ 'repositories_failed_install' ]
now = time.strftime( "%Y-%m-%d %H:%M:%S" )
print "####################################################################################"
@@ -1025,19 +1033,19 @@
if not can_update_tool_shed:
print "# This run will not update the Tool Shed database."
if total_repositories_tested > 0:
- if repositories_passed:
+ if all_tests_passed:
print '# ----------------------------------------------------------------------------------'
- print "# %d repositories passed all tests:" % len( repositories_passed )
- show_summary_output( repositories_passed )
- if repositories_failed:
+ print "# %d repositories successfully passed all functional tests:" % len( all_tests_passed )
+ show_summary_output( all_tests_passed )
+ if at_least_one_test_failed:
print '# ----------------------------------------------------------------------------------'
- print "# %d repositories failed one or more tests:" % len( repositories_failed )
- show_summary_output( repositories_failed )
+ print "# %d repositories failed at least 1 functional test:" % len( at_least_one_test_failed )
+ show_summary_output( at_least_one_test_failed )
if repositories_failed_install:
# Set success to False so that the return code will not be 0.
success = False
print '# ----------------------------------------------------------------------------------'
- print "# %d repositories with installation errors:" % len( repositories_failed_install )
+ print "# %d repositories have installation errors:" % len( repositories_failed_install )
show_summary_output( repositories_failed_install )
else:
success = True
@@ -1198,21 +1206,31 @@
return result, test_config.plugins._plugins
def show_summary_output( repository_dicts ):
- repositories_by_owner = {}
- for repository in repository_dicts:
- if repository[ 'owner' ] not in repositories_by_owner:
- repositories_by_owner[ repository[ 'owner' ] ] = []
- repositories_by_owner[ repository[ 'owner' ] ].append( repository )
- for owner in repositories_by_owner:
+ # Group summary display by repository owner.
+ repository_dicts_by_owner = {}
+ for repository_dict in repository_dicts:
+ name = str( repository_dict[ 'name' ] )
+ owner = str( repository_dict[ 'owner' ] )
+ changeset_revision = str( repository_dict[ 'changeset_revision' ] )
+ if owner in repository_dicts_by_owner:
+ repository_dicts_by_owner[ owner ].append( repository_dict )
+ else:
+ repository_dicts_by_owner[ owner ] = [ repository_dict ]
+ # Display grouped summary.
+ for owner, grouped_repository_dicts in repository_dicts_by_owner.items():
print "# "
- for repository in repositories_by_owner[ owner ]:
- print "# %s owned by %s, changeset revision %s" % ( repository[ 'name' ], repository[ 'owner' ], repository[ 'changeset_revision' ] )
+ for repository_dict in grouped_repository_dicts:
+ name = repository_dict[ 'name' ]
+ owner = repository_dict[ 'owner' ]
+ changeset_revision = repository_dict[ 'changeset_revision' ]
+ print "# Revision %s of repository %s owned by %s" % ( changeset_revision, name, owner )
def test_repository_tools( app, repository, repository_dict, tool_test_results_dicts, tool_test_results_dict, results_dict ):
"""Test tools contained in the received repository."""
name = str( repository.name )
owner = str( repository.owner )
changeset_revision = str( repository.changeset_revision )
+ repository_identifier_dict = dict( name=name, owner=owner, changeset_revision=changeset_revision )
# Set the module-level variable 'toolbox', so that test.functional.test_toolbox will generate the appropriate test methods.
test_toolbox.toolbox = app.toolbox
# Generate the test methods for this installed repository. We need to pass in True here, or it will look
@@ -1223,43 +1241,55 @@
test_config.configure( sys.argv )
# Run the configured tests.
result, test_plugins = run_tests( test_config )
- success = result.wasSuccessful()
- # Use the ReportResults nose plugin to get a list of tests that passed.
- for plugin in test_plugins:
- if hasattr( plugin, 'getTestStatus' ):
- test_identifier = '%s/%s' % ( owner, name )
- passed_tests = plugin.getTestStatus( test_identifier )
- break
- tool_test_results_dict[ 'passed_tests' ] = []
- for test_id in passed_tests:
- # Normalize the tool ID and version display.
- tool_id, tool_version = get_tool_info_from_test_id( test_id )
- test_result = dict( test_id=test_id, tool_id=tool_id, tool_version=tool_version )
- tool_test_results_dict[ 'passed_tests' ].append( test_result )
- if success:
- # This repository's tools passed all functional tests. Update the repository_metadata table in the tool shed's database
- # to reflect that. Call the register_test_result method, which executes a PUT request to the repository_revisions API
- # controller with the status of the test. This also sets the do_not_test and tools_functionally correct flags, and
- # updates the time_last_tested field to today's date.
- results_dict[ 'repositories_passed' ].append( dict( name=name, owner=owner, changeset_revision=changeset_revision ) )
+ if result.wasSuccessful():
+ # This repository's tools passed all functional tests. Use the ReportResults nose plugin to get a list
+ # of tests that passed.
+ for plugin in test_plugins:
+ if hasattr( plugin, 'getTestStatus' ):
+ test_identifier = '%s/%s' % ( owner, name )
+ passed_tests = plugin.getTestStatus( test_identifier )
+ break
+ tool_test_results_dict[ 'passed_tests' ] = []
+ for test_id in passed_tests:
+ # Normalize the tool ID and version display.
+ tool_id, tool_version = get_tool_info_from_test_id( test_id )
+ test_result = dict( test_id=test_id, tool_id=tool_id, tool_version=tool_version )
+ tool_test_results_dict[ 'passed_tests' ].append( test_result )
+ # Update the repository_metadata table in the tool shed's database to include the passed tests.
+ passed_repository_dict = repository_identifier_dict
+ results_dict[ 'all_tests_passed' ].append( passed_repository_dict )
params = dict( tools_functionally_correct=True,
do_not_test=False,
test_install_error=False )
+ # Call the register_test_result() method to execute a PUT request to the repository_revisions API
+ # controller with the status of the test. This also sets the do_not_test and tools_functionally
+ # correct flags and updates the time_last_tested field to today's date.
# TODO: do something useful with response_dict
- response_dict = register_test_result( galaxy_tool_shed_url, tool_test_results_dicts, tool_test_results_dict, repository_dict, params )
- log.debug( 'Revision %s of repository %s installed and passed functional tests.' % ( str( changeset_revision ), str( name ) ) )
+ response_dict = register_test_result( galaxy_tool_shed_url,
+ tool_test_results_dicts,
+ tool_test_results_dict,
+ repository_dict,
+ params )
+ log.debug( 'Revision %s of repository %s owned by %s installed and passed functional tests.' % \
+ ( changeset_revision, name, owner ) )
else:
- # The extract_log_data() netod returns a list.
- tool_test_results_dict[ 'failed_tests' ] = extract_log_data( result, from_tool_test=True )
- results_dict[ 'repositories_failed' ].append( dict( name=name, owner=owner, changeset_revision=changeset_revision ) )
+ # The get_failed_test_dicts() method returns a list.
+ failed_test_dicts = get_failed_test_dicts( result, from_tool_test=True )
+ tool_test_results_dict[ 'failed_tests' ] = failed_test_dicts
+ failed_repository_dict = repository_identifier_dict
+ results_dict[ 'at_least_one_test_failed' ].append( failed_repository_dict )
set_do_not_test = not is_latest_downloadable_revision( galaxy_tool_shed_url, repository_dict )
params = dict( tools_functionally_correct=False,
test_install_error=False,
do_not_test=str( set_do_not_test ) )
# TODO: do something useful with response_dict
- response_dict = register_test_result( galaxy_tool_shed_url, tool_test_results_dicts, tool_test_results_dict, repository_dict, params )
- log.debug( 'Revision %s of repository %s installed successfully but did not pass functional tests.' % \
- ( str( changeset_revision ), str( name ) ) )
+ response_dict = register_test_result( galaxy_tool_shed_url,
+ tool_test_results_dicts,
+ tool_test_results_dict,
+ repository_dict,
+ params )
+ log.debug( 'Revision %s of repository %s owned by %s installed successfully but did not pass functional tests.' % \
+ ( changeset_revision, name, owner ) )
# Run the uninstall method. This removes tool functional test methods from the test_toolbox module and uninstalls the
# repository using Twill.
deactivate = asbool( os.environ.get( 'GALAXY_INSTALL_TEST_KEEP_TOOL_DEPENDENCIES', False ) )
@@ -1270,47 +1300,81 @@
else:
log.debug( 'Uninstalling changeset revision %s of repository %s' % ( str( changeset_revision ), str( name ) ) )
# We are uninstalling this repository and all of its repository dependencies.
- uninstall_repository( app, repository_dict )
-
+ uninstall_repository_and_repository_dependencies( app, repository_dict )
# Set the test_toolbox.toolbox module-level variable to the new app.toolbox.
test_toolbox.toolbox = app.toolbox
return results_dict
-def uninstall_repository( app, repository_dict ):
- """Attempt to uninstall a repository."""
- sa_session = app.model.context.current
+def uninstall_repository_and_repository_dependencies( app, repository_dict ):
+ """Uninstall a repository and all of its repository dependencies."""
+ # This method assumes that the repositor defined by the received repository_dict is not a repository
+ # dependency of another repository.
+ sa_session = app.install_model.context
# Clean out any generated tests. This is necessary for Twill.
remove_generated_tests( app )
# The dict contains the only repository the app should have installed at this point.
name = str( repository_dict[ 'name' ] )
owner = str( repository_dict[ 'owner' ] )
changeset_revision = str( repository_dict[ 'changeset_revision' ] )
+ # Since this install and test framework uninstalls repositories immediately after installing and testing
+ # them, the values of repository.installed_changeset_revision and repository.changeset_revision should be
+ # the same.
repository = test_db_util.get_installed_repository_by_name_owner_changeset_revision( name, owner, changeset_revision )
- # We have to do this through Twill, in order to maintain app.toolbox and shed_tool_conf.xml in a state that is valid for future tests.
- for required_repository in repository.repository_dependencies:
- repository_dict = dict( name=str( required_repository.name ),
- owner=str( required_repository.owner ),
- changeset_revision=str( required_repository.changeset_revision ) )
- # Generate a test method to uninstall this repository through the embedded Galaxy application's web interface.
- test_install_repositories.generate_deactivate_or_uninstall_method( repository_dict, deactivate=False )
- log.debug( 'Changeset revision %s of %s repository %s selected for uninstallation.' % \
- ( str( required_repository.changeset_revision ), str( required_repository.status ), str( required_repository.name ) ) )
- repository_dict = dict( name=name, owner=owner, changeset_revision=changeset_revision )
- test_install_repositories.generate_deactivate_or_uninstall_method( repository_dict, deactivate=False )
- log.debug( 'Changeset revision %s of %s repository %s selected for uninstallation.' % ( changeset_revision, str( repository.status ), name ) )
- # Set up nose to run the generated uninstall method as a functional test.
- test_config = nose.config.Config( env=os.environ, plugins=nose.plugins.manager.DefaultPluginManager() )
- test_config.configure( sys.argv )
- # Run the uninstall method. This method uses the Galaxy web interface to uninstall the previously installed
- # repository and delete it from disk.
- result, _ = run_tests( test_config )
- success = result.wasSuccessful()
- if not success:
- log.debug( 'Repository %s failed to uninstall.' % str( name ) )
+ if repository.can_uninstall( app ):
+ # A repository can be uninstalled only if no dependent repositories are installed. So uninstallation order
+ # id critical. A repository is always uninstalled first, and the each of its dependencies is checked to see
+ # if it can be uninstalled.
+ uninstall_repository_dict = dict( name=name,
+ owner=owner,
+ changeset_revision=changeset_revision )
+ log.debug( 'Revision %s of repository %s owned by %s selected for uninstallation.' % ( changeset_revision, name, owner ) )
+ test_install_repositories.generate_uninstall_method( uninstall_repository_dict )
+ # Set up nose to run the generated uninstall method as a functional test.
+ test_config = nose.config.Config( env=os.environ, plugins=nose.plugins.manager.DefaultPluginManager() )
+ test_config.configure( sys.argv )
+ # Run the uninstall method. This method uses the Galaxy web interface to uninstall the previously installed
+ # repository and all of its repository dependencies, deleting each of them from disk.
+ result, _ = run_tests( test_config )
+ success = result.wasSuccessful()
+ if success:
+ # Now that the repository is uninstalled we can attempt to uninstall each of its repository dependencies.
+ # We have to do this through Twill in order to maintain app.toolbox and shed_tool_conf.xml in a state that
+ # is valid for future tests. Since some of the repository's repository dependencies may require other of
+ # the repository's repository dependencies, we'll keep track of the repositories we've been able to unistall.
+ processed_repository_dependency_ids = []
+ while len( processed_repository_dependency_ids ) < len( repository.repository_dependencies ):
+ for repository_dependency in repository.repository_dependencies:
+ if repository_dependency.id not in processed_repository_dependency_ids and repository_dependency.can_uninstall( app ):
+ processed_repository_dependency_ids.append( repository_dependency.id )
+ rd_name = str( repository_dependency.name )
+ rd_owner = str( repository_dependency.owner )
+ rd_changeset_revision = str( repository_dependency.changeset_revision )
+ uninstall_repository_dict = dict( name=rd_name,
+ owner=rd_owner,
+ changeset_revision=rd_changeset_revision )
+ log.debug( 'Revision %s of repository dependency %s owned by %s selected for uninstallation.' % \
+ ( rd_changeset_revision, rd_name, rd_owner ) )
+ # Generate a test method to uninstall the repository dependency through the embedded Galaxy application's
+ # web interface.
+ test_install_repositories.generate_uninstall_method( uninstall_repository_dict )
+ # Set up nose to run the generated uninstall method as a functional test.
+ test_config = nose.config.Config( env=os.environ, plugins=nose.plugins.manager.DefaultPluginManager() )
+ test_config.configure( sys.argv )
+ # Run the uninstall method.
+ result, _ = run_tests( test_config )
+ success = result.wasSuccessful()
+ if not success:
+ log.debug( 'Uninstallation of revision %s of repository %s owned by %s failed: %s' % \
+ ( rd_changeset_revision, rd_name, rd_owner, str( e ) ) )
+ break
+ else:
+ log.debug( 'Uninstallation of revision %s of repository %s owned by %s failed.' % ( changeset_revision, name, owner ) )
+ else:
+ log_reason_repository_cannot_be_uninstalled( app, repository )
def uninstall_tool_dependency( app, tool_dependency ):
"""Attempt to uninstall a tool dependency."""
- sa_session = app.model.context.current
+ sa_session = app.install_model.context
# Clean out any generated tests. This is necessary for Twill.
tool_dependency_install_path = tool_dependency.installation_directory( app )
uninstalled, error_message = tool_dependency_util.remove_tool_dependency( app, tool_dependency )
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.
1
0
commit/galaxy-central: jgoecks: JavaScript MVC: remove BaseModel because it is not used.
by commits-noreply@bitbucket.org 16 Dec '13
by commits-noreply@bitbucket.org 16 Dec '13
16 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/f2ce61f7d1ad/
Changeset: f2ce61f7d1ad
User: jgoecks
Date: 2013-12-16 21:35:51
Summary: JavaScript MVC: remove BaseModel because it is not used.
Affected #: 3 files
diff -r c49caf699d9c5fdec10763ea01b3a167b9ac4bdd -r f2ce61f7d1ad2ea38faedf952aa0abf60ca06e2c static/scripts/mvc/base-mvc.js
--- a/static/scripts/mvc/base-mvc.js
+++ b/static/scripts/mvc/base-mvc.js
@@ -1,26 +1,3 @@
-/**
- * Simple base model for any visible element. Includes useful attributes and ability
- * to set and track visibility.
- */
-var BaseModel = Backbone.Model.extend({
- defaults: {
- name: null,
- hidden: false
- },
-
- show: function() {
- this.set("hidden", false);
- },
-
- hide: function() {
- this.set("hidden", true);
- },
-
- is_visible: function() {
- return !this.attributes.hidden;
- }
-});
-
/**
* Base view that handles visibility based on model's hidden attribute.
*/
@@ -52,10 +29,10 @@
*
* @example
* // Add to your models/views at the definition using chaining:
- * var MyModel = BaseModel.extend( LoggableMixin ).extend({ // ... });
+ * var MyModel = Backbone.Model.extend( LoggableMixin ).extend({ // ... });
*
* // or - more explicitly AFTER the definition:
- * var MyModel = BaseModel.extend({
+ * var MyModel = Backbone.Model.extend({
* logger : console
* // ...
* this.log( '$#%& it! - broken already...' );
diff -r c49caf699d9c5fdec10763ea01b3a167b9ac4bdd -r f2ce61f7d1ad2ea38faedf952aa0abf60ca06e2c static/scripts/mvc/history/history-model.js
--- a/static/scripts/mvc/history/history-model.js
+++ b/static/scripts/mvc/history/history-model.js
@@ -57,7 +57,6 @@
* @param {Object} historyJSON model data for this History
* @param {Object[]} hdaJSON array of model data for this History's HDAs
* @param {Object} options any extra settings including logger
- * @see BaseModel#initialize
*/
initialize : function( historyJSON, hdaJSON, options ){
options = options || {};
diff -r c49caf699d9c5fdec10763ea01b3a167b9ac4bdd -r f2ce61f7d1ad2ea38faedf952aa0abf60ca06e2c static/scripts/mvc/user/user-model.js
--- a/static/scripts/mvc/user/user-model.js
+++ b/static/scripts/mvc/user/user-model.js
@@ -67,7 +67,7 @@
if( idOrCurrent === User.CURRENT_ID_STR ){
options.url = this.urlRoot + '/' + User.CURRENT_ID_STR;
}
- return BaseModel.prototype.fetch.call( this, options );
+ return Backbone.Model.prototype.fetch.call( this, options );
},
/** Clears all data from the sessionStorage.
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.
1
0
commit/galaxy-central: dannon: Placeholder in api documentation for Return Codes and Format standards.
by commits-noreply@bitbucket.org 16 Dec '13
by commits-noreply@bitbucket.org 16 Dec '13
16 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/c49caf699d9c/
Changeset: c49caf699d9c
User: dannon
Date: 2013-12-16 21:17:51
Summary: Placeholder in api documentation for Return Codes and Format standards.
Affected #: 1 file
diff -r 4fe46fd3181bfb63e8093200d71801cb507b586d -r c49caf699d9c5fdec10763ea01b3a167b9ac4bdd doc/source/lib/galaxy.webapps.galaxy.api.rst
--- a/doc/source/lib/galaxy.webapps.galaxy.api.rst
+++ b/doc/source/lib/galaxy.webapps.galaxy.api.rst
@@ -205,6 +205,10 @@
The request and response format should be considered alpha and are subject to change.
+API Return Codes and Formats
+==================
+
+TODO (here, or add a new page and link it)
API Controllers
===============
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.
1
0
commit/galaxy-central: inithello: Remove debugging code.
by commits-noreply@bitbucket.org 13 Dec '13
by commits-noreply@bitbucket.org 13 Dec '13
13 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/4fe46fd3181b/
Changeset: 4fe46fd3181b
User: inithello
Date: 2013-12-14 05:23:32
Summary: Remove debugging code.
Affected #: 2 files
diff -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 -r 4fe46fd3181bfb63e8093200d71801cb507b586d test/tool_shed/base/twilltestcase.py
--- a/test/tool_shed/base/twilltestcase.py
+++ b/test/tool_shed/base/twilltestcase.py
@@ -132,7 +132,6 @@
galaxy_model.ToolShedRepository.installation_status.DEACTIVATED ]:
tool_panel_section = self.get_tool_panel_section_from_repository_metadata( metadata )
else:
- log.debug( 'Status is %s' % repository.status )
tool_panel_section = self.get_tool_panel_section_from_api( metadata )
assert tool_panel_section == expected_tool_panel_section, 'Expected to find tool panel section *%s*, but instead found *%s*\nMetadata: %s\n' % \
( expected_tool_panel_section, tool_panel_section, metadata )
@@ -1070,13 +1069,11 @@
def reset_metadata_on_selected_repositories( self, repository_ids ):
self.visit_url( '/admin/reset_metadata_on_selected_repositories_in_tool_shed' )
- log.debug( repository_ids )
kwd = dict( repository_ids=repository_ids )
self.submit_form( form_no=1, button="reset_metadata_on_selected_repositories_button", **kwd )
def reset_metadata_on_selected_installed_repositories( self, repository_ids ):
self.visit_galaxy_url( '/admin_toolshed/reset_metadata_on_selected_installed_repositories' )
- log.debug( repository_ids )
kwd = dict( repository_ids=repository_ids )
self.submit_form( form_no=1, button="reset_metadata_on_selected_repositories_button", **kwd )
diff -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 -r 4fe46fd3181bfb63e8093200d71801cb507b586d test/tool_shed/functional_tests.py
--- a/test/tool_shed/functional_tests.py
+++ b/test/tool_shed/functional_tests.py
@@ -85,9 +85,6 @@
# should this serve static resources (scripts, images, styles, etc.)
STATIC_ENABLED = True
-global galaxyapp
-galaxyapp = None
-
def get_static_settings():
"""Returns dictionary of the settings necessary for a galaxy App
to be wrapped in the static middleware.
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.
1
0
commit/galaxy-central: inithello: Update functional tests to account for the changes to when repositories can be uninstalled. Add tool panel section to tool API return value. Move test_db_util import to twilltestcase. Update tool test metadata generation.
by commits-noreply@bitbucket.org 13 Dec '13
by commits-noreply@bitbucket.org 13 Dec '13
13 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/c2511b37db9b/
Changeset: c2511b37db9b
User: inithello
Date: 2013-12-14 05:07:07
Summary: Update functional tests to account for the changes to when repositories can be uninstalled. Add tool panel section to tool API return value. Move test_db_util import to twilltestcase. Update tool test metadata generation.
Affected #: 69 files
diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -1075,6 +1075,22 @@
:returns: galaxy.jobs.JobDestination -- The destination definition and runner parameters.
"""
return self.app.job_config.get_destination(self.__get_job_tool_configuration(job_params=job_params).destination)
+
+ def get_panel_section( self ):
+ for key, item in self.app.toolbox.integrated_tool_panel.items():
+ if item:
+ if key.startswith( 'tool_' ):
+ if item.id == self.id:
+ return '', ''
+ if key.startswith( 'section_' ):
+ section_id = item.id or ''
+ section_name = item.name or ''
+ for section_key, section_item in item.elems.items():
+ if section_key.startswith( 'tool_' ):
+ if section_item:
+ if section_item.id == self.id:
+ return section_id, section_name
+ return None, None
def parse( self, root, guid=None ):
"""
@@ -3010,6 +3026,8 @@
if io_details:
tool_dict[ 'inputs' ] = [ input.to_dict( trans ) for input in self.inputs.values() ]
tool_dict[ 'outputs' ] = [ output.to_dict() for output in self.outputs.values() ]
+
+ tool_dict[ 'panel_section_id' ], tool_dict[ 'panel_section_name' ] = self.get_panel_section()
return tool_dict
diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 lib/tool_shed/util/metadata_util.py
--- a/lib/tool_shed/util/metadata_util.py
+++ b/lib/tool_shed/util/metadata_util.py
@@ -940,7 +940,12 @@
for required_file in ttb.required_files:
value, extra = required_file
required_files.append( ( value ) )
- inputs = [ input for input in ttb.inputs ]
+ inputs = []
+ for input_field, values in ttb.inputs.iteritems():
+ if len( values ) == 1:
+ inputs.append( ( input_field, values[0] ) )
+ else:
+ inputs.append( ( input_field, values ) )
outputs = []
for output in ttb.outputs:
name, file_name, extra = output
diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 test/tool_shed/base/twilltestcase.py
--- a/test/tool_shed/base/twilltestcase.py
+++ b/test/tool_shed/base/twilltestcase.py
@@ -9,6 +9,7 @@
import time
import tempfile
import tarfile
+import urllib
import galaxy.webapps.tool_shed.util.hgweb_config
import galaxy.model.tool_shed_install as galaxy_model
import galaxy.util as util
@@ -46,6 +47,7 @@
self.tool_shed_test_file = None
self.tool_data_path = os.environ.get( 'GALAXY_TEST_TOOL_DATA_PATH' )
self.shed_tool_conf = os.environ.get( 'GALAXY_TEST_SHED_TOOL_CONF' )
+ self.test_db_util = test_db_util
# TODO: Figure out a way to alter these attributes during tests.
self.galaxy_tool_dependency_dir = os.environ.get( 'GALAXY_TEST_TOOL_DEPENDENCY_DIR' )
self.shed_tools_dict = {}
@@ -121,20 +123,17 @@
def check_galaxy_repository_tool_panel_section( self, repository, expected_tool_panel_section ):
metadata = repository.metadata
- assert 'tools' in metadata, 'Tools not found in metadata: %s' % metadata
+ assert 'tools' in metadata, 'Tools not found in repository metadata: %s' % metadata
tool_metadata = metadata[ 'tools' ]
# If integrated_tool_panel.xml is to be tested, this test method will need to be enhanced to handle tools
# from the same repository in different tool panel sections. Getting the first tool guid is ok, because
# currently all tools contained in a single repository will be loaded into the same tool panel section.
- tool_guid = tool_metadata[ 0 ][ 'guid' ]
- assert 'tool_panel_section' in metadata, 'Tool panel section not found in metadata: %s' % metadata
- tool_panel_section_metadata = metadata[ 'tool_panel_section' ]
- # tool_section_dict = dict( tool_config=guids_and_configs[ guid ],
- # id=section_id,
- # name=section_name,
- # version=section_version )
- # This dict is appended to tool_panel_section_metadata[ tool_guid ]
- tool_panel_section = tool_panel_section_metadata[ tool_guid ][ 0 ][ 'name' ]
+ if repository.status in [ galaxy_model.ToolShedRepository.installation_status.UNINSTALLED,
+ galaxy_model.ToolShedRepository.installation_status.DEACTIVATED ]:
+ tool_panel_section = self.get_tool_panel_section_from_repository_metadata( metadata )
+ else:
+ log.debug( 'Status is %s' % repository.status )
+ tool_panel_section = self.get_tool_panel_section_from_api( metadata )
assert tool_panel_section == expected_tool_panel_section, 'Expected to find tool panel section *%s*, but instead found *%s*\nMetadata: %s\n' % \
( expected_tool_panel_section, tool_panel_section, metadata )
@@ -765,6 +764,28 @@
invalid_tools.append( dict( tools=repository_metadata.metadata[ 'invalid_tools' ], changeset_revision=repository_metadata.changeset_revision ) )
return valid_tools, invalid_tools
+ def get_tool_panel_section_from_api( self, metadata ):
+ tool_metadata = metadata[ 'tools' ]
+ tool_guid = urllib.quote_plus( tool_metadata[ 0 ][ 'guid' ], safe='' )
+ api_url = '/%s' % '/'.join( [ 'api', 'tools', tool_guid ] )
+ self.visit_galaxy_url( api_url )
+ tool_dict = from_json_string( self.last_page() )
+ tool_panel_section = tool_dict[ 'panel_section_name' ]
+ return tool_panel_section
+
+ def get_tool_panel_section_from_repository_metadata( self, metadata ):
+ tool_metadata = metadata[ 'tools' ]
+ tool_guid = tool_metadata[ 0 ][ 'guid' ]
+ assert 'tool_panel_section' in metadata, 'Tool panel section not found in metadata: %s' % metadata
+ tool_panel_section_metadata = metadata[ 'tool_panel_section' ]
+ # tool_section_dict = dict( tool_config=guids_and_configs[ guid ],
+ # id=section_id,
+ # name=section_name,
+ # version=section_version )
+ # This dict is appended to tool_panel_section_metadata[ tool_guid ]
+ tool_panel_section = tool_panel_section_metadata[ tool_guid ][ 0 ][ 'name' ]
+ return tool_panel_section
+
def grant_role_to_user( self, user, role ):
strings_displayed = [ self.security.encode_id( role.id ), role.name ]
strings_not_displayed = []
@@ -1049,11 +1070,13 @@
def reset_metadata_on_selected_repositories( self, repository_ids ):
self.visit_url( '/admin/reset_metadata_on_selected_repositories_in_tool_shed' )
+ log.debug( repository_ids )
kwd = dict( repository_ids=repository_ids )
self.submit_form( form_no=1, button="reset_metadata_on_selected_repositories_button", **kwd )
def reset_metadata_on_selected_installed_repositories( self, repository_ids ):
self.visit_galaxy_url( '/admin_toolshed/reset_metadata_on_selected_installed_repositories' )
+ log.debug( repository_ids )
kwd = dict( repository_ids=repository_ids )
self.submit_form( form_no=1, button="reset_metadata_on_selected_repositories_button", **kwd )
@@ -1173,16 +1196,15 @@
self.visit_url( url )
self.check_for_strings( strings_displayed, strings_not_displayed )
- def uninstall_repository( self, installed_repository, remove_from_disk=True ):
+ def uninstall_repository( self, installed_repository, remove_from_disk=True, is_required=False, strings_displayed=[], strings_not_displayed=[] ):
url = '/admin_toolshed/deactivate_or_uninstall_repository?id=%s' % self.security.encode_id( installed_repository.id )
self.visit_galaxy_url( url )
- if remove_from_disk:
- tc.fv ( 1, "remove_from_disk", 'true' )
- else:
- tc.fv ( 1, "remove_from_disk", 'false' )
+ self.check_for_strings( strings_displayed, strings_not_displayed )
+ form = tc.browser.get_form( 'deactivate_or_uninstall_repository' )
+ kwd = self.set_form_value( form, {}, 'remove_from_disk', remove_from_disk )
tc.submit( 'deactivate_or_uninstall_repository_button' )
strings_displayed = [ 'The repository named' ]
- if remove_from_disk:
+ if remove_from_disk and not is_required:
strings_displayed.append( 'has been uninstalled' )
else:
strings_displayed.append( 'has been deactivated' )
diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 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
@@ -1,11 +1,8 @@
from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
-import tool_shed.base.test_db_util as test_db_util
-
repository_name = 'filtering_0000'
repository_description = "Galaxy's filtering tool for test 0000"
repository_long_description = "Long description of Galaxy's filtering tool for test 0000"
-
class TestBasicRepositoryFeatures( ShedTwillTestCase ):
'''Test core repository features.'''
@@ -13,19 +10,19 @@
"""Create necessary user accounts and login as an admin user."""
self.logout()
self.login( email=common.test_user_1_email, username=common.test_user_1_name )
- test_user_1 = test_db_util.get_user( common.test_user_1_email )
+ test_user_1 = self.test_db_util.get_user( common.test_user_1_email )
assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % common.test_user_1_email
- test_user_1_private_role = test_db_util.get_private_role( test_user_1 )
+ test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 )
self.logout()
self.login( email=common.test_user_2_email, username=common.test_user_2_name )
- test_user_2 = test_db_util.get_user( common.test_user_2_email )
+ test_user_2 = self.test_db_util.get_user( common.test_user_2_email )
assert test_user_2 is not None, 'Problem retrieving user with email %s from the database' % common.test_user_2_email
- test_user_2_private_role = test_db_util.get_private_role( test_user_2 )
+ test_user_2_private_role = self.test_db_util.get_private_role( test_user_2 )
self.logout()
self.login( email=common.admin_email, username=common.admin_username )
- admin_user = test_db_util.get_user( common.admin_email )
+ admin_user = self.test_db_util.get_user( common.admin_email )
assert admin_user is not None, 'Problem retrieving user with email %s from the database' % common.admin_email
- admin_user_private_role = test_db_util.get_private_role( admin_user )
+ admin_user_private_role = self.test_db_util.get_private_role( admin_user )
def test_0005_create_categories( self ):
"""Create categories for this test suite"""
@@ -36,7 +33,7 @@
"""Create the filtering 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 0000 Basic Repository Features 1' )
+ category = self.test_db_util.get_category_by_name( 'Test 0000 Basic Repository Features 1' )
strings_displayed = [ 'Repository %s' % "'%s'" % repository_name,
'Repository %s has been created' % "<b>%s</b>" % repository_name ]
self.get_or_create_repository( name=repository_name,
@@ -48,7 +45,7 @@
def test_0015_edit_repository( self ):
"""Edit the repository name, description, and long description"""
- repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
new_name = "renamed_filtering"
new_description = "Edited filtering tool"
new_long_description = "Edited long description"
@@ -56,20 +53,20 @@
def test_0020_change_repository_category( self ):
"""Change the categories associated with the filtering repository"""
- repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
self.edit_repository_categories( repository,
categories_to_add=[ "Test 0000 Basic Repository Features 2" ],
categories_to_remove=[ "Test 0000 Basic Repository Features 1" ] )
def test_0025_grant_write_access( self ):
'''Grant write access to another user'''
- repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
self.grant_write_access( repository, usernames=[ common.test_user_2_name ] )
self.revoke_write_access( repository, common.test_user_2_name )
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 )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
self.upload_file( repository,
filename='filtering/filtering_1.1.0.tar',
filepath=None,
@@ -82,7 +79,7 @@
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 )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
latest_changeset_revision = self.get_repository_tip( repository )
self.check_for_valid_tools( repository, strings_displayed=[ 'Filter1' ] )
self.check_count_of_metadata_revisions_associated_with_repository( repository, metadata_count=1 )
@@ -106,7 +103,7 @@
def test_0040_alter_repository_states( self ):
'''Test toggling the malicious and deprecated repository flags.'''
- repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
self.logout()
self.login( email=common.admin_email, username=common.admin_username )
self.set_repository_malicious( repository,
@@ -132,7 +129,7 @@
def test_0045_display_repository_tip_file( self ):
'''Display the contents of filtering.xml in the repository tip revision'''
- repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
self.display_repository_file_contents( repository=repository,
filename='filtering.xml',
filepath=None,
@@ -141,7 +138,7 @@
def test_0050_upload_filtering_txt_file( self ):
'''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 )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
self.upload_file( repository,
filename='filtering/filtering_0000.txt',
filepath=None,
@@ -155,7 +152,7 @@
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 )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
self.upload_file( repository,
filename='filtering/filtering_test_data.tar',
filepath=None,
@@ -174,7 +171,7 @@
def test_0060_upload_filtering_2_2_0( self ):
'''Upload filtering version 2.2.0'''
- repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
self.upload_file( repository,
filename='filtering/filtering_2.2.0.tar',
filepath=None,
@@ -187,8 +184,8 @@
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 )
- category = test_db_util.get_category_by_name( 'Test 0000 Basic Repository Features 1' )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ category = self.test_db_util.get_category_by_name( 'Test 0000 Basic Repository Features 1' )
tip = self.get_repository_tip( repository )
self.check_for_valid_tools( repository )
strings_displayed = [ 'Select a revision' ]
@@ -209,7 +206,7 @@
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 )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
self.upload_file( repository,
filename='readme.txt',
filepath=None,
@@ -228,26 +225,26 @@
def test_0075_delete_readme_txt_file( self ):
'''Delete the readme.txt file.'''
- repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
self.delete_files_from_repository( repository, filenames=[ 'readme.txt' ] )
self.check_count_of_metadata_revisions_associated_with_repository( repository, metadata_count=2 )
self.display_manage_repository_page( repository, strings_displayed=[ 'Readme file for filtering 1.1.0' ] )
def test_0080_search_for_valid_filter_tool( self ):
'''Search for the filtering tool by tool ID, name, and version.'''
- repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
tip_changeset = self.get_repository_tip( repository )
search_fields = dict( tool_id='Filter1', tool_name='filter', tool_version='2.2.0' )
self.search_for_valid_tools( search_fields=search_fields, strings_displayed=[ tip_changeset ], strings_not_displayed=[] )
def test_0085_verify_repository_metadata( self ):
'''Verify that resetting the metadata does not change it.'''
- repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
self.verify_unchanged_repository_metadata( repository )
def test_0090_verify_reserved_repository_name_handling( self ):
'''Check that reserved repository names are handled correctly.'''
- category = test_db_util.get_category_by_name( 'Test 0000 Basic Repository Features 1' )
+ category = self.test_db_util.get_category_by_name( 'Test 0000 Basic Repository Features 1' )
error_message = 'The term <b>repos</b> is a reserved word in the tool shed, so it cannot be used as a repository name.'
self.get_or_create_repository( name='repos',
description=repository_description,
@@ -260,7 +257,7 @@
'''Check that reserved usernames are handled correctly.'''
self.logout()
self.login( email='baduser(a)bx.psu.edu', username='repos' )
- test_user_1 = test_db_util.get_user( 'baduser(a)bx.psu.edu' )
+ test_user_1 = self.test_db_util.get_user( 'baduser(a)bx.psu.edu' )
assert test_user_1 is None, 'Creating user with public name "repos" succeeded.'
error_message = 'The term <b>repos</b> is a reserved word in the tool shed, so it cannot be used as a public user name.'
self.check_for_strings( strings_displayed=[ error_message ] )
@@ -275,7 +272,7 @@
'''
self.logout()
self.login( email=common.test_user_2_email, username=common.test_user_2_name )
- repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
message = 'This is a test message.'
strings_displayed = [ 'Contact the owner of the repository named', repository.name, 'streamline appropriate communication' ]
post_submit_strings_displayed = [ 'An error occurred sending your message by email' ]
@@ -286,25 +283,25 @@
def test_0110_delete_filtering_repository( self ):
'''Delete the filtering_0000 repository and verify that it no longer has any downloadable revisions.'''
- repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
self.logout()
self.login( email=common.admin_email, username=common.admin_username )
self.delete_repository( repository )
# Explicitly reload all metadata revisions from the database, to ensure that we have the current status of the downloadable flag.
for metadata_revision in repository.metadata_revisions:
- test_db_util.refresh( metadata_revision )
+ self.test_db_util.refresh( metadata_revision )
# Marking a repository as deleted should result in no metadata revisions being downloadable.
assert True not in [ metadata.downloadable for metadata in repository.metadata_revisions ]
def test_0115_undelete_filtering_repository( self ):
'''Undelete the filtering_0000 repository and verify that it now has two downloadable revisions.'''
- repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
self.logout()
self.login( email=common.admin_email, username=common.admin_username )
self.undelete_repository( repository )
# Explicitly reload all metadata revisions from the database, to ensure that we have the current status of the downloadable flag.
for metadata_revision in repository.metadata_revisions:
- test_db_util.refresh( metadata_revision )
+ self.test_db_util.refresh( metadata_revision )
# Marking a repository as undeleted should result in all previously downloadable metadata revisions being downloadable again.
# In this case, there should be two downloadable revisions, one for filtering 1.1.0 and one for filtering 2.2.0.
assert True in [ metadata.downloadable for metadata in repository.metadata_revisions ]
@@ -316,7 +313,7 @@
self.logout()
self.login( email=common.test_user_2_email, username=common.test_user_2_name )
# Get the repository, so we can pass the encoded repository id and browse_repositories method to the set_email_alerts method.
- repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
strings_displayed = [ 'Total alerts added: 1, total alerts removed: 0' ]
self.enable_email_alerts( repository, strings_displayed=strings_displayed )
@@ -324,7 +321,7 @@
'''Upload a new readme file to the filtering_0000 repository and verify that there is no error.'''
self.logout()
self.login( email=common.test_user_1_email, username=common.test_user_1_name )
- repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
# Upload readme.txt to the filtering_0000 repository and verify that it is now displayed.
self.upload_file( repository,
filename='filtering/readme.txt',
@@ -339,7 +336,7 @@
def test_0130_verify_handling_of_invalid_characters( self ):
'''Load the above changeset in the change log and confirm that there is no server error displayed.'''
- repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
changeset_revision = self.get_repository_tip( repository )
repository_id = self.security.encode_id( repository.id )
changelog_tuples = self.get_repository_changelog_tuples( repository )
diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 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
@@ -1,6 +1,4 @@
from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
-import tool_shed.base.test_db_util as test_db_util
-
repository_name = 'freebayes_0010'
repository_description = "Galaxy's freebayes tool"
repository_long_description = "Long description of Galaxy's freebayes tool"
@@ -15,7 +13,6 @@
7. Check for the appropriate strings on the manage repository page.
'''
-
class TestFreebayesRepository( ShedTwillTestCase ):
'''Testing freebayes with tool data table entries, .loc files, and tool dependencies.'''
@@ -23,14 +20,14 @@
"""Create necessary user accounts and login as an admin user."""
self.logout()
self.login( email=common.test_user_1_email, username=common.test_user_1_name )
- test_user_1 = test_db_util.get_user( common.test_user_1_email )
+ test_user_1 = self.test_db_util.get_user( common.test_user_1_email )
assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email
- test_user_1_private_role = test_db_util.get_private_role( test_user_1 )
+ test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 )
self.logout()
self.login( email=common.admin_email, username=common.admin_username )
- admin_user = test_db_util.get_user( common.admin_email )
+ admin_user = self.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 )
+ admin_user_private_role = self.test_db_util.get_private_role( admin_user )
def test_0005_create_category( self ):
"""Create a category for this test suite"""
@@ -45,7 +42,7 @@
'''
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 0010 Repository With Tool Dependencies' )
+ category = self.test_db_util.get_category_by_name( 'Test 0010 Repository With Tool Dependencies' )
repository = self.get_or_create_repository( name=repository_name,
description=repository_description,
long_description=repository_long_description,
@@ -72,7 +69,7 @@
We are at step 2 - Upload the tool_data_table_conf.xml.sample file.
Uploading the tool_data_table_conf.xml.sample alone should not make the tool valid, but the error message should change.
'''
- repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
self.upload_file( repository,
filename='freebayes/tool_data_table_conf.xml.sample',
filepath=None,
@@ -93,7 +90,7 @@
We are at step 3 - Upload the tool_data_table_conf.xml.sample file.
Uploading the tool_data_table_conf.xml.sample alone should not make the tool valid, but the error message should change.
'''
- repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
self.upload_file( repository,
filename='freebayes/sam_fa_indices.loc.sample',
filepath=None,
@@ -110,7 +107,7 @@
We are at step 4 - Upload a tool_dependencies.xml file that should not parse correctly.
Upload a tool_dependencies.xml file that contains <> in the text of the readme tag. This should show an error message about malformed xml.
'''
- repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
self.upload_file( repository,
filename=os.path.join( 'freebayes', 'malformed_tool_dependencies', 'tool_dependencies.xml' ),
filepath=None,
@@ -127,7 +124,7 @@
We are at step 5 - Upload a tool_dependencies.xml file that specifies a version that does not match the tool's requirements.
This should result in a message about the tool dependency configuration not matching the tool's requirements.
'''
- repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
self.upload_file( repository,
filename=os.path.join( 'freebayes', 'invalid_tool_dependencies', 'tool_dependencies.xml' ),
filepath=None,
@@ -144,7 +141,7 @@
We are at step 6 - Upload a valid tool_dependencies.xml file.
At this stage, there should be no errors on the upload page, as every missing or invalid file has been corrected.
'''
- repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
self.upload_file( repository,
filename=os.path.join( 'freebayes', 'tool_dependencies.xml' ),
filepath=None,
@@ -161,7 +158,7 @@
We are at step 7 - Check for the appropriate strings on the manage repository page.
Verify that the manage repository page now displays the valid tool dependencies, and that there are no invalid tools shown on the manage page.
'''
- repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
strings_displayed = [ 'freebayes', '0.9.4_9696d0ce8a9', 'samtools', '0.1.18', 'Valid tools', 'package' ]
strings_not_displayed = [ 'Invalid tools' ]
self.display_manage_repository_page( repository, strings_displayed=strings_displayed, strings_not_displayed=strings_not_displayed )
diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 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
@@ -1,6 +1,4 @@
from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
-import tool_shed.base.test_db_util as test_db_util
-
datatypes_repository_name = 'emboss_datatypes_0020'
datatypes_repository_description = "Galaxy applicable data formats used by Emboss tools."
datatypes_repository_long_description = "Galaxy applicable data formats used by Emboss tools. This repository contains no tools."
@@ -9,7 +7,6 @@
emboss_repository_description = 'Galaxy wrappers for Emboss version 5.0.0 tools for test 0020'
emboss_repository_long_description = 'Galaxy wrappers for Emboss version 5.0.0 tools for test 0020'
-
class TestBasicRepositoryDependencies( ShedTwillTestCase ):
'''Testing emboss 5 with repository dependencies.'''
@@ -17,14 +14,14 @@
"""Create necessary user accounts and login as an admin user."""
self.logout()
self.login( email=common.test_user_1_email, username=common.test_user_1_name )
- test_user_1 = test_db_util.get_user( common.test_user_1_email )
+ test_user_1 = self.test_db_util.get_user( common.test_user_1_email )
assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % common.test_user_1_email
- test_user_1_private_role = test_db_util.get_private_role( test_user_1 )
+ test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 )
self.logout()
self.login( email=common.admin_email, username=common.admin_username )
- admin_user = test_db_util.get_user( common.admin_email )
+ admin_user = self.test_db_util.get_user( common.admin_email )
assert admin_user is not None, 'Problem retrieving user with email %s from the database' % common.admin_email
- admin_user_private_role = test_db_util.get_private_role( admin_user )
+ admin_user_private_role = self.test_db_util.get_private_role( admin_user )
def test_0005_create_category( self ):
"""Create a category for this test suite"""
@@ -34,7 +31,7 @@
'''Create and populate the emboss_datatypes 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 0020 Basic Repository Dependencies' )
+ category = self.test_db_util.get_category_by_name( 'Test 0020 Basic Repository Dependencies' )
repository = self.get_or_create_repository( name=datatypes_repository_name,
description=datatypes_repository_description,
long_description=datatypes_repository_long_description,
@@ -53,12 +50,12 @@
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 )
+ repository = self.test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name )
self.display_manage_repository_page( repository, strings_displayed=[ 'Datatypes', 'equicktandem', 'hennig86', 'vectorstrip' ] )
def test_0020_create_emboss_5_repository_and_upload_files( self ):
'''Create and populate the emboss_5_0020 repository.'''
- category = test_db_util.get_category_by_name( 'Test 0020 Basic Repository Dependencies' )
+ category = self.test_db_util.get_category_by_name( 'Test 0020 Basic Repository Dependencies' )
repository = self.get_or_create_repository( name=emboss_repository_name,
description=emboss_repository_description,
long_description=emboss_repository_long_description,
@@ -77,16 +74,16 @@
def test_0025_generate_and_upload_repository_dependencies_xml( self ):
'''Generate and upload the repository_dependencies.xml file'''
- repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
- datatypes_repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
+ datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name )
repository_dependencies_path = self.generate_temp_path( 'test_0020', additional_paths=[ 'emboss', '5' ] )
repository_tuple = ( self.url, datatypes_repository.name, datatypes_repository.user.username, self.get_repository_tip( datatypes_repository ) )
self.create_repository_dependency( repository=repository, repository_tuples=[ repository_tuple ], filepath=repository_dependencies_path )
def test_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 )
- datatypes_repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
+ datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name )
changeset_revision = self.get_repository_tip( datatypes_repository )
strings_displayed = [ 'Tool dependencies',
'emboss',
@@ -100,7 +97,7 @@
def test_0040_verify_repository_metadata( self ):
'''Verify that resetting the metadata does not change it.'''
- emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
- datatypes_repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name )
+ emboss_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
+ datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name )
self.verify_unchanged_repository_metadata( emboss_repository )
self.verify_unchanged_repository_metadata( datatypes_repository )
diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 test/tool_shed/functional/test_0030_repository_dependency_revisions.py
--- a/test/tool_shed/functional/test_0030_repository_dependency_revisions.py
+++ b/test/tool_shed/functional/test_0030_repository_dependency_revisions.py
@@ -1,6 +1,4 @@
from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
-import tool_shed.base.test_db_util as test_db_util
-
datatypes_repository_name = 'emboss_datatypes_0030'
datatypes_repository_description = "Galaxy applicable data formats used by Emboss tools."
datatypes_repository_long_description = "Galaxy applicable data formats used by Emboss tools. This repository contains no tools."
@@ -11,7 +9,6 @@
emboss_repository_description = 'Galaxy wrappers for Emboss version 5.0.0 tools for test 0030'
emboss_repository_long_description = 'Galaxy wrappers for Emboss version 5.0.0 tools for test 0030'
-
class TestRepositoryDependencyRevisions( ShedTwillTestCase ):
'''Test dependencies on different revisions of a repository.'''
@@ -19,14 +16,14 @@
"""Create necessary user accounts."""
self.logout()
self.login( email=common.test_user_1_email, username=common.test_user_1_name )
- test_user_1 = test_db_util.get_user( common.test_user_1_email )
+ test_user_1 = self.test_db_util.get_user( common.test_user_1_email )
assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email
- test_user_1_private_role = test_db_util.get_private_role( test_user_1 )
+ test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 )
self.logout()
self.login( email=common.admin_email, username=common.admin_username )
- admin_user = test_db_util.get_user( common.admin_email )
+ admin_user = self.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 )
+ admin_user_private_role = self.test_db_util.get_private_role( admin_user )
def test_0005_create_category( self ):
"""Create a category for this test suite"""
@@ -36,7 +33,7 @@
'''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' )
+ category = self.test_db_util.get_category_by_name( 'Test 0030 Repository Dependency Revisions' )
repository = self.get_or_create_repository( name=emboss_5_repository_name,
description=emboss_repository_description,
long_description=emboss_repository_long_description,
@@ -56,7 +53,7 @@
'''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' )
+ category = self.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,
@@ -76,7 +73,7 @@
'''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' )
+ category = self.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,
@@ -96,7 +93,7 @@
'''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' )
+ category = self.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,
@@ -114,41 +111,41 @@
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 )
- emboss_5_repository = test_db_util.get_repository_by_name_and_owner( emboss_5_repository_name, common.test_user_1_name )
+ datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name )
+ emboss_5_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_5_repository_name, common.test_user_1_name )
repository_dependencies_path = self.generate_temp_path( 'test_0030', additional_paths=[ 'emboss5' ] )
datatypes_tuple = ( self.url, datatypes_repository.name, datatypes_repository.user.username, self.get_repository_tip( datatypes_repository ) )
self.create_repository_dependency( repository=emboss_5_repository, repository_tuples=[ datatypes_tuple ], filepath=repository_dependencies_path )
def test_0035_generate_repository_dependencies_for_emboss_6( self ):
'''Generate a repository_dependencies.xml file specifying emboss_datatypes and upload it to the emboss_6 repository.'''
- emboss_6_repository = test_db_util.get_repository_by_name_and_owner( emboss_6_repository_name, common.test_user_1_name )
- datatypes_repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name )
+ emboss_6_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_6_repository_name, common.test_user_1_name )
+ datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name )
repository_dependencies_path = self.generate_temp_path( 'test_0030', additional_paths=[ 'emboss6' ] )
datatypes_tuple = ( self.url, datatypes_repository.name, datatypes_repository.user.username, self.get_repository_tip( datatypes_repository ) )
self.create_repository_dependency( repository=emboss_6_repository, repository_tuples=[ datatypes_tuple ], filepath=repository_dependencies_path )
def test_0040_generate_repository_dependency_on_emboss_5( self ):
'''Create and upload repository_dependencies.xml for the emboss_5_0030 repository.'''
- emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
- emboss_5_repository = test_db_util.get_repository_by_name_and_owner( emboss_5_repository_name, common.test_user_1_name )
+ emboss_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
+ emboss_5_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_5_repository_name, common.test_user_1_name )
repository_dependencies_path = self.generate_temp_path( 'test_0030', additional_paths=[ 'emboss', '5' ] )
emboss_tuple = ( self.url, emboss_5_repository.name, emboss_5_repository.user.username, self.get_repository_tip( emboss_5_repository ) )
self.create_repository_dependency( repository=emboss_repository, repository_tuples=[ emboss_tuple ], filepath=repository_dependencies_path )
def test_0045_generate_repository_dependency_on_emboss_6( self ):
'''Create and upload repository_dependencies.xml for the emboss_6_0030 repository.'''
- emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
- emboss_6_repository = test_db_util.get_repository_by_name_and_owner( emboss_6_repository_name, common.test_user_1_name )
+ emboss_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
+ emboss_6_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_6_repository_name, common.test_user_1_name )
repository_dependencies_path = self.generate_temp_path( 'test_0030', additional_paths=[ 'emboss', '5' ] )
emboss_tuple = ( self.url, emboss_6_repository.name, emboss_6_repository.user.username, self.get_repository_tip( emboss_6_repository ) )
self.create_repository_dependency( repository=emboss_repository, repository_tuples=[ emboss_tuple ], filepath=repository_dependencies_path )
def test_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 = self.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 ) ]
- datatypes_repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name )
+ datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name )
datatypes_tip = self.get_repository_tip( datatypes_repository )
strings_displayed = []
# Iterate through all metadata revisions and check for repository dependencies.
@@ -161,9 +158,9 @@
strings_displayed=strings_displayed )
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 )
- emboss_6_repository = test_db_util.get_repository_by_name_and_owner( emboss_6_repository_name, common.test_user_1_name )
- datatypes_repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name )
+ emboss_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
+ emboss_5_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_5_repository_name, common.test_user_1_name )
+ emboss_6_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_6_repository_name, common.test_user_1_name )
+ datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name )
for repository in [ emboss_repository, emboss_5_repository, emboss_6_repository, datatypes_repository ]:
self.verify_unchanged_repository_metadata( repository )
diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 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
@@ -1,6 +1,4 @@
from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
-import tool_shed.base.test_db_util as test_db_util
-
freebayes_repository_name = 'freebayes_0040'
freebayes_repository_description = "Galaxy's freebayes tool for test 0040"
freebayes_repository_long_description = "Long description of Galaxy's freebayes tool for test 0040"
@@ -9,7 +7,6 @@
filtering_repository_description = "Galaxy's filtering tool for test 0040"
filtering_repository_long_description = "Long description of Galaxy's filtering tool for test 0040"
-
class TestRepositoryCircularDependencies( ShedTwillTestCase ):
'''Verify that the code correctly displays repositories with circular repository dependencies.'''
@@ -17,14 +14,14 @@
"""Create necessary user accounts."""
self.logout()
self.login( email=common.test_user_1_email, username=common.test_user_1_name )
- test_user_1 = test_db_util.get_user( common.test_user_1_email )
+ test_user_1 = self.test_db_util.get_user( common.test_user_1_email )
assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email
- test_user_1_private_role = test_db_util.get_private_role( test_user_1 )
+ test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 )
self.logout()
self.login( email=common.admin_email, username=common.admin_username )
- admin_user = test_db_util.get_user( common.admin_email )
+ admin_user = self.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 )
+ admin_user_private_role = self.test_db_util.get_private_role( admin_user )
def test_0005_create_category( self ):
"""Create a category for this test suite"""
@@ -76,8 +73,8 @@
# Filtering revision 0 -> freebayes revision 0.
# Freebayes revision 0 -> filtering revision 1.
# Filtering will have two revisions, one with just the filtering tool, and one with the filtering tool and a dependency on freebayes.
- repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name )
- filtering_repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name )
+ filtering_repository = self.test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name )
repository_dependencies_path = self.generate_temp_path( 'test_0040', additional_paths=[ 'filtering' ] )
repository_tuple = ( self.url, repository.name, repository.user.username, self.get_repository_tip( repository ) )
self.create_repository_dependency( repository=filtering_repository, repository_tuples=[ repository_tuple ], filepath=repository_dependencies_path )
@@ -88,16 +85,16 @@
# Filtering revision 0 -> freebayes revision 0.
# Freebayes revision 0 -> filtering revision 1.
# Filtering will have two revisions, one with just the filtering tool, and one with the filtering tool and a dependency on freebayes.
- repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name )
- freebayes_repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name )
+ freebayes_repository = self.test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name )
repository_dependencies_path = self.generate_temp_path( 'test_0040', additional_paths=[ 'freebayes' ] )
repository_tuple = ( self.url, repository.name, repository.user.username, self.get_repository_tip( repository ) )
self.create_repository_dependency( repository=freebayes_repository, repository_tuples=[ repository_tuple ], filepath=repository_dependencies_path )
def test_0030_verify_repository_dependencies( self ):
'''Verify that each repository can depend on the other without causing an infinite loop.'''
- filtering_repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name )
- freebayes_repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name )
+ filtering_repository = self.test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name )
+ freebayes_repository = self.test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name )
# The dependency structure should look like:
# Filtering revision 0 -> freebayes revision 0.
# Freebayes revision 0 -> filtering revision 1.
@@ -108,14 +105,14 @@
def test_0035_verify_repository_metadata( self ):
'''Verify that resetting the metadata does not change it.'''
- freebayes_repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name )
- filtering_repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name )
+ freebayes_repository = self.test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name )
+ filtering_repository = self.test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name )
for repository in [ freebayes_repository, filtering_repository ]:
self.verify_unchanged_repository_metadata( repository )
def test_0040_verify_tool_dependencies( self ):
'''Verify that freebayes displays tool dependencies.'''
- repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name )
self.display_manage_repository_page( repository,
strings_displayed=[ 'freebayes', '0.9.4_9696d0ce8a9', 'samtools', '0.1.18', 'Valid tools', 'package' ],
strings_not_displayed=[ 'Invalid tools' ] )
diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 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
@@ -1,6 +1,4 @@
from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
-import tool_shed.base.test_db_util as test_db_util
-
emboss_datatypes_repository_name = 'emboss_datatypes_0050'
emboss_datatypes_repository_description = "Datatypes for emboss"
emboss_datatypes_repository_long_description = "Long description of Emboss' datatypes"
@@ -32,7 +30,6 @@
category_name = 'Test 0050 Circular Dependencies 5 Levels'
category_description = 'Test circular dependency features'
-
class TestRepositoryCircularDependenciesToNLevels( ShedTwillTestCase ):
'''Verify that the code correctly handles circular dependencies down to n levels.'''
@@ -40,14 +37,14 @@
"""Create necessary user accounts."""
self.logout()
self.login( email=common.test_user_1_email, username=common.test_user_1_name )
- test_user_1 = test_db_util.get_user( common.test_user_1_email )
+ test_user_1 = self.test_db_util.get_user( common.test_user_1_email )
assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email
- test_user_1_private_role = test_db_util.get_private_role( test_user_1 )
+ test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 )
self.logout()
self.login( email=common.admin_email, username=common.admin_username )
- admin_user = test_db_util.get_user( common.admin_email )
+ admin_user = self.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 )
+ admin_user_private_role = self.test_db_util.get_private_role( admin_user )
def test_0005_create_convert_repository( self ):
'''Create and populate convert_chars_0050.'''
@@ -187,13 +184,13 @@
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 )
- datatypes_repository = test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name )
- emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
- filtering_repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name )
- freebayes_repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name )
- bismark_repository = test_db_util.get_repository_by_name_and_owner( bismark_repository_name, common.test_user_1_name )
+ column_repository = self.test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name )
+ convert_repository = self.test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name )
+ datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name )
+ emboss_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
+ filtering_repository = self.test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name )
+ freebayes_repository = self.test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name )
+ bismark_repository = self.test_db_util.get_repository_by_name_and_owner( bismark_repository_name, common.test_user_1_name )
dependency_xml_path = self.generate_temp_path( 'test_0050', additional_paths=[ 'freebayes' ] )
# convert_chars depends on column_maker
# column_maker depends on convert_chars
@@ -235,13 +232,13 @@
id: 7 key: http://toolshed.local:10001__ESEP__emboss_5__ESEP__test__ESEP__8de5fe0d7b04
['http://toolshed.local:10001', 'emboss_datatypes', 'test', 'dbd4f68bf507']
'''
- emboss_datatypes_repository = test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name )
- emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
- filtering_repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name )
- freebayes_repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name )
- column_repository = test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name )
- convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name )
- bismark_repository = test_db_util.get_repository_by_name_and_owner( bismark_repository_name, common.test_user_1_name )
+ emboss_datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name )
+ emboss_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
+ filtering_repository = self.test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name )
+ freebayes_repository = self.test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name )
+ column_repository = self.test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name )
+ convert_repository = self.test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name )
+ bismark_repository = self.test_db_util.get_repository_by_name_and_owner( bismark_repository_name, common.test_user_1_name )
self.check_repository_dependency( convert_repository, column_repository )
self.check_repository_dependency( column_repository, convert_repository )
self.check_repository_dependency( emboss_datatypes_repository, bismark_repository )
@@ -256,17 +253,17 @@
def test_0050_verify_tool_dependencies( self ):
'''Check that freebayes and emboss display tool dependencies.'''
- freebayes_repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name )
- emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
+ freebayes_repository = self.test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name )
+ emboss_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
self.display_manage_repository_page( freebayes_repository,
strings_displayed=[ 'freebayes', '0.9.4_9696d0ce8a9', 'samtools', '0.1.18', 'Tool dependencies', 'package' ] )
self.display_manage_repository_page( emboss_repository, strings_displayed=[ 'Tool dependencies', 'emboss', '5.0.0', 'package' ] )
def test_0055_verify_repository_metadata( self ):
'''Verify that resetting the metadata does not change it.'''
- emboss_datatypes_repository = test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name )
- emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
- filtering_repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name )
- freebayes_repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name )
+ emboss_datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name )
+ emboss_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
+ filtering_repository = self.test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name )
+ freebayes_repository = self.test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name )
for repository in [ emboss_datatypes_repository, emboss_repository, freebayes_repository, filtering_repository ]:
self.verify_unchanged_repository_metadata( repository )
diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 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
@@ -1,6 +1,4 @@
from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
-import tool_shed.base.test_db_util as test_db_util
-
repository_name = 'filtering_0060'
repository_description="Galaxy's filtering tool for test 0060"
repository_long_description="Long description of Galaxy's filtering tool for test 0060"
@@ -15,20 +13,21 @@
workflow_repository_description="Workflow referencing the filtering tool for test 0060"
workflow_repository_long_description="Long description of the workflow for test 0060"
+
class TestToolShedWorkflowFeatures( ShedTwillTestCase ):
'''Test valid and invalid workflows.'''
def test_0000_initiate_users( self ):
"""Create necessary user accounts and login as an admin user."""
self.logout()
self.login( email=common.test_user_1_email, username=common.test_user_1_name )
- test_user_1 = test_db_util.get_user( common.test_user_1_email )
+ test_user_1 = self.test_db_util.get_user( common.test_user_1_email )
assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email
- test_user_1_private_role = test_db_util.get_private_role( test_user_1 )
+ test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 )
self.logout()
self.login( email=common.admin_email, username=common.admin_username )
- admin_user = test_db_util.get_user( common.admin_email )
+ admin_user = self.test_db_util.get_user( common.admin_email )
assert admin_user is not None, 'Problem retrieving user with email %s from the database' % common.admin_email
- admin_user_private_role = test_db_util.get_private_role( admin_user )
+ admin_user_private_role = self.test_db_util.get_private_role( admin_user )
def test_0005_create_categories( self ):
"""Create categories for this test suite"""
self.create_category( name='Test 0060 Workflow Features', description='Test 0060 - Workflow Features' )
@@ -45,7 +44,7 @@
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.'''
- repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
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_0060', additional_paths=[ 'filtering_workflow' ] )
@@ -64,7 +63,7 @@
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 )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
self.upload_file( repository,
filename='filtering/filtering_2.2.0.tar',
filepath=None,
@@ -94,7 +93,7 @@
if not os.path.exists( workflow_filepath ):
os.makedirs( workflow_filepath )
file( os.path.join( workflow_filepath, workflow_filename ), 'w+' ).write( workflow )
- repository = test_db_util.get_repository_by_name_and_owner( workflow_repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( workflow_repository_name, common.test_user_1_name )
self.upload_file( repository,
filename=workflow_filename,
filepath=workflow_filepath,
@@ -107,11 +106,11 @@
self.load_workflow_image_in_tool_shed( repository, workflow_name, strings_displayed=[ '#EBBCB2' ] )
def test_0030_check_workflow_repository( self ):
"""Check for strings on the manage page for the filtering_workflow_0060 repository."""
- repository = test_db_util.get_repository_by_name_and_owner( workflow_repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( workflow_repository_name, common.test_user_1_name )
strings_displayed = [ 'Workflows', 'New workflow for 0060_filter', '0.1' ]
strings_not_displayed = [ 'Valid tools', 'Invalid tools' ]
self.display_manage_repository_page( repository, strings_displayed=strings_displayed, strings_not_displayed=strings_not_displayed )
def test_0035_verify_repository_metadata( self ):
'''Verify that resetting the metadata does not change it.'''
- repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
self.verify_unchanged_repository_metadata( repository )
diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 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
@@ -1,13 +1,10 @@
from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
-import tool_shed.base.test_db_util as test_db_util
-
repository_name = 'bismark_0070'
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.'''
@@ -15,14 +12,14 @@
"""Create necessary user accounts and login as an admin user."""
self.logout()
self.login( email=common.test_user_1_email, username=common.test_user_1_name )
- test_user_1 = test_db_util.get_user( common.test_user_1_email )
+ test_user_1 = self.test_db_util.get_user( common.test_user_1_email )
assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email
- test_user_1_private_role = test_db_util.get_private_role( test_user_1 )
+ test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 )
self.logout()
self.login( email=common.admin_email, username=common.admin_username )
- admin_user = test_db_util.get_user( common.admin_email )
+ admin_user = self.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 )
+ admin_user_private_role = self.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."""
@@ -56,7 +53,7 @@
strings_displayed=[],
strings_not_displayed=[] )
valid_revision = self.get_repository_tip( repository )
- test_db_util.refresh( repository )
+ self.test_db_util.refresh( repository )
tool_guid = '%s/repos/user1/bismark_0070/bismark_methylation_extractor/0.7.7.3' % self.url.replace( 'http://', '' ).rstrip( '/' )
tool_metadata_strings_displayed = [ tool_guid,
'0.7.7.3', # The tool version.
diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 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
@@ -1,6 +1,4 @@
from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
-import tool_shed.base.test_db_util as test_db_util
-
column_repository_name = 'column_maker_0080'
column_repository_description = "Add column"
column_repository_long_description = "Compute an expression on every row"
@@ -12,7 +10,6 @@
category_name = 'Test 0080 Advanced Circular Dependencies'
category_description = 'Test circular dependency features'
-
class TestRepositoryCircularDependencies( ShedTwillTestCase ):
'''Verify that the code correctly handles circular dependencies.'''
@@ -20,14 +17,14 @@
"""Create necessary user accounts."""
self.logout()
self.login( email=common.test_user_1_email, username=common.test_user_1_name )
- test_user_1 = test_db_util.get_user( common.test_user_1_email )
+ test_user_1 = self.test_db_util.get_user( common.test_user_1_email )
assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email
- test_user_1_private_role = test_db_util.get_private_role( test_user_1 )
+ test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 )
self.logout()
self.login( email=common.admin_email, username=common.admin_username )
- admin_user = test_db_util.get_user( common.admin_email )
+ admin_user = self.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 )
+ admin_user_private_role = self.test_db_util.get_private_role( admin_user )
def test_0005_create_column_repository( self ):
"""Create and populate the column_maker repository."""
@@ -75,30 +72,30 @@
def test_0020_create_repository_dependencies( self ):
'''Upload a repository_dependencies.xml file that specifies the current revision of convert_chars_0080 to the column_maker_0080 repository.'''
- convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name )
- column_repository = test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name )
+ convert_repository = self.test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name )
+ column_repository = self.test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name )
repository_dependencies_path = self.generate_temp_path( 'test_0080', additional_paths=[ 'convert' ] )
repository_tuple = ( self.url, convert_repository.name, convert_repository.user.username, self.get_repository_tip( convert_repository ) )
self.create_repository_dependency( repository=column_repository, repository_tuples=[ repository_tuple ], filepath=repository_dependencies_path )
def test_0025_create_dependency_on_filtering( self ):
'''Upload a repository_dependencies.xml file that specifies the current revision of filtering to the freebayes_0040 repository.'''
- convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name )
- column_repository = test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name )
+ convert_repository = self.test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name )
+ column_repository = self.test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name )
repository_dependencies_path = self.generate_temp_path( 'test_0080', additional_paths=[ 'convert' ] )
repository_tuple = ( self.url, column_repository.name, column_repository.user.username, self.get_repository_tip( column_repository ) )
self.create_repository_dependency( repository=convert_repository, repository_tuples=[ repository_tuple ], filepath=repository_dependencies_path )
def test_0030_verify_repository_dependencies( self ):
'''Verify that each repository can depend on the other without causing an infinite loop.'''
- convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name )
- column_repository = test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name )
+ convert_repository = self.test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name )
+ column_repository = self.test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name )
self.check_repository_dependency( convert_repository, column_repository, self.get_repository_tip( column_repository ) )
self.check_repository_dependency( column_repository, convert_repository, self.get_repository_tip( convert_repository ) )
def test_0035_verify_repository_metadata( self ):
'''Verify that resetting the metadata does not change it.'''
- column_repository = test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name )
- convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name )
+ column_repository = self.test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name )
+ convert_repository = self.test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name )
for repository in [ column_repository, convert_repository ]:
self.verify_unchanged_repository_metadata( repository )
diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 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
@@ -1,6 +1,4 @@
from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
-import tool_shed.base.test_db_util as test_db_util
-
emboss_datatypes_repository_name = 'emboss_datatypes_0090'
emboss_datatypes_repository_description = "Datatypes for emboss"
emboss_datatypes_repository_long_description = "Long description of Emboss' datatypes"
@@ -28,7 +26,6 @@
category_name = 'Test 0090 Tool Search And Installation'
category_description = 'Test 0090 Tool Search And Installation'
-
class TestRepositoryCircularDependenciesAgain( ShedTwillTestCase ):
'''Test more features related to repository dependencies.'''
@@ -36,14 +33,14 @@
"""Create necessary user accounts."""
self.logout()
self.login( email=common.test_user_1_email, username=common.test_user_1_name )
- test_user_1 = test_db_util.get_user( common.test_user_1_email )
+ test_user_1 = self.test_db_util.get_user( common.test_user_1_email )
assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email
- test_user_1_private_role = test_db_util.get_private_role( test_user_1 )
+ test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 )
self.logout()
self.login( email=common.admin_email, username=common.admin_username )
- admin_user = test_db_util.get_user( common.admin_email )
+ admin_user = self.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 )
+ admin_user_private_role = self.test_db_util.get_private_role( admin_user )
def test_0005_create_bwa_base_repository( self ):
'''Create and populate bwa_base_0090.'''
@@ -167,12 +164,12 @@
def test_0035_create_and_upload_dependency_definitions( self ):
'''Create and upload repository dependency definitions.'''
- bwa_color_repository = test_db_util.get_repository_by_name_and_owner( bwa_color_repository_name, common.test_user_1_name )
- bwa_base_repository = test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name )
- datatypes_repository = test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name )
- emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
- filtering_repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name )
- freebayes_repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name )
+ bwa_color_repository = self.test_db_util.get_repository_by_name_and_owner( bwa_color_repository_name, common.test_user_1_name )
+ bwa_base_repository = self.test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name )
+ datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name )
+ emboss_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
+ filtering_repository = self.test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name )
+ freebayes_repository = self.test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name )
dependency_xml_path = self.generate_temp_path( 'test_0090', additional_paths=[ 'freebayes' ] )
freebayes_tuple = ( self.url, freebayes_repository.name, freebayes_repository.user.username, self.get_repository_tip( freebayes_repository ) )
emboss_tuple = ( self.url, emboss_repository.name, emboss_repository.user.username, self.get_repository_tip( emboss_repository ) )
@@ -185,12 +182,12 @@
def test_0040_verify_repository_dependencies( self ):
'''Verify the generated dependency structure.'''
- bwa_color_repository = test_db_util.get_repository_by_name_and_owner( bwa_color_repository_name, common.test_user_1_name )
- bwa_base_repository = test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name )
- emboss_datatypes_repository = test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name )
- emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
- filtering_repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name )
- freebayes_repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name )
+ bwa_color_repository = self.test_db_util.get_repository_by_name_and_owner( bwa_color_repository_name, common.test_user_1_name )
+ bwa_base_repository = self.test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name )
+ emboss_datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name )
+ emboss_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
+ filtering_repository = self.test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name )
+ freebayes_repository = self.test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name )
self.check_repository_dependency( emboss_repository, emboss_datatypes_repository )
self.check_repository_dependency( filtering_repository, freebayes_repository )
self.check_repository_dependency( bwa_base_repository, emboss_repository )
diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 test/tool_shed/functional/test_0100_complex_repository_dependencies.py
--- a/test/tool_shed/functional/test_0100_complex_repository_dependencies.py
+++ b/test/tool_shed/functional/test_0100_complex_repository_dependencies.py
@@ -1,5 +1,4 @@
from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
-import tool_shed.base.test_db_util as test_db_util
import logging
log = logging.getLogger( __name__ )
@@ -15,7 +14,6 @@
category_name = 'Test 0100 Complex Repository Dependencies'
category_description = 'Test 0100 Complex Repository Dependencies'
-
class TestComplexRepositoryDependencies( ShedTwillTestCase ):
'''Test features related to complex repository dependencies.'''
@@ -23,14 +21,14 @@
"""Create necessary user accounts."""
self.logout()
self.login( email=common.test_user_1_email, username=common.test_user_1_name )
- test_user_1 = test_db_util.get_user( common.test_user_1_email )
+ test_user_1 = self.test_db_util.get_user( common.test_user_1_email )
assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email
- test_user_1_private_role = test_db_util.get_private_role( test_user_1 )
+ test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 )
self.logout()
self.login( email=common.admin_email, username=common.admin_username )
- admin_user = test_db_util.get_user( common.admin_email )
+ admin_user = self.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 )
+ admin_user_private_role = self.test_db_util.get_private_role( admin_user )
def test_0005_create_bwa_package_repository( self ):
'''Create and populate package_bwa_0_5_9_0100.'''
@@ -84,9 +82,9 @@
dependency_path = self.generate_temp_path( 'test_0100', additional_paths=[ 'complex', 'invalid' ] )
xml_filename = self.get_filename( 'tool_dependencies.xml', filepath=dependency_path )
# The repository named bwa_base_repository_0100 is the dependent repository.
- base_repository = test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name )
+ base_repository = self.test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name )
# The repository named package_bwa_0_5_9_0100 is the required repository.
- tool_repository = test_db_util.get_repository_by_name_and_owner( bwa_package_repository_name, common.test_user_1_name )
+ tool_repository = self.test_db_util.get_repository_by_name_and_owner( bwa_package_repository_name, common.test_user_1_name )
url = 'http://http://this is not an url!'
name = 'package_bwa_0_5_9_0100'
owner = 'user1'
@@ -107,9 +105,9 @@
dependency_path = self.generate_temp_path( 'test_0100', additional_paths=[ 'complex', 'invalid' ] )
xml_filename = self.get_filename( 'tool_dependencies.xml', filepath=dependency_path )
# The base_repository named bwa_base_repository_0100 is the dependent repository.
- base_repository = test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name )
+ base_repository = self.test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name )
# The repository named package_bwa_0_5_9_0100 is the required repository.
- tool_repository = test_db_util.get_repository_by_name_and_owner( bwa_package_repository_name, common.test_user_1_name )
+ tool_repository = self.test_db_util.get_repository_by_name_and_owner( bwa_package_repository_name, common.test_user_1_name )
url = self.url
name = 'invalid_repository!?'
owner = 'user1'
@@ -130,9 +128,9 @@
dependency_path = self.generate_temp_path( 'test_0100', additional_paths=[ 'complex', 'invalid' ] )
xml_filename = self.get_filename( 'tool_dependencies.xml', filepath=dependency_path )
# The base_repository named bwa_base_repository_0100 is the dependent repository.
- base_repository = test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name )
+ base_repository = self.test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name )
# The repository named package_bwa_0_5_9_0100 is the required repository.
- tool_repository = test_db_util.get_repository_by_name_and_owner( bwa_package_repository_name, common.test_user_1_name )
+ tool_repository = self.test_db_util.get_repository_by_name_and_owner( bwa_package_repository_name, common.test_user_1_name )
url = self.url
name = 'package_bwa_0_5_9_0100'
owner = 'invalid_owner!?'
@@ -152,9 +150,9 @@
dependency_path = self.generate_temp_path( 'test_0100', additional_paths=[ 'complex', 'invalid' ] )
xml_filename = self.get_filename( 'tool_dependencies.xml', filepath=dependency_path )
# The base_repository named bwa_base_repository_0100 is the dependent repository.
- base_repository = test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name )
+ base_repository = self.test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name )
# The repository named package_bwa_0_5_9_0100 is the required repository.
- tool_repository = test_db_util.get_repository_by_name_and_owner( bwa_package_repository_name, common.test_user_1_name )
+ tool_repository = self.test_db_util.get_repository_by_name_and_owner( bwa_package_repository_name, common.test_user_1_name )
url = self.url
name = 'package_bwa_0_5_9_0100'
owner = 'user1'
@@ -172,9 +170,9 @@
def test_0035_generate_complex_repository_dependency( self ):
'''Generate and upload a valid tool_dependencies.xml file that specifies package_bwa_0_5_9_0100.'''
# The base_repository named bwa_base_repository_0100 is the dependent repository.
- base_repository = test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name )
+ base_repository = self.test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name )
# The repository named package_bwa_0_5_9_0100 is the required repository.
- tool_repository = test_db_util.get_repository_by_name_and_owner( bwa_package_repository_name, common.test_user_1_name )
+ tool_repository = self.test_db_util.get_repository_by_name_and_owner( bwa_package_repository_name, common.test_user_1_name )
dependency_path = self.generate_temp_path( 'test_0100', additional_paths=[ 'complex' ] )
url = self.url
name = 'package_bwa_0_5_9_0100'
@@ -193,9 +191,9 @@
def test_0040_generate_tool_dependency( self ):
'''Generate and upload a new tool_dependencies.xml file that specifies an arbitrary file on the filesystem, and verify that bwa_base depends on the new changeset revision.'''
# The base_repository named bwa_base_repository_0100 is the dependent repository.
- base_repository = test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name )
+ base_repository = self.test_db_util.get_repository_by_name_and_owner( bwa_base_repository_name, common.test_user_1_name )
# The repository named package_bwa_0_5_9_0100 is the required repository.
- tool_repository = test_db_util.get_repository_by_name_and_owner( bwa_package_repository_name, common.test_user_1_name )
+ tool_repository = self.test_db_util.get_repository_by_name_and_owner( bwa_package_repository_name, common.test_user_1_name )
previous_changeset = self.get_repository_tip( tool_repository )
old_tool_dependency = self.get_filename( os.path.join( 'bwa', 'complex', 'readme', 'tool_dependencies.xml' ) )
new_tool_dependency_path = self.generate_temp_path( 'test_1100', additional_paths=[ 'tool_dependency' ] )
diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 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
@@ -1,6 +1,4 @@
from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
-import tool_shed.base.test_db_util as test_db_util
-
datatypes_repository_name = 'emboss_datatypes_0110'
datatypes_repository_description = "Galaxy applicable data formats used by Emboss tools."
datatypes_repository_long_description = "Galaxy applicable data formats used by Emboss tools. This repository contains no tools."
@@ -12,7 +10,6 @@
category_name = 'Test 0110 Invalid Repository Dependencies'
category_desc = 'Test 0110 Invalid Repository Dependencies'
-
class TestBasicRepositoryDependencies( ShedTwillTestCase ):
'''Testing emboss 5 with repository dependencies.'''
@@ -20,14 +17,14 @@
"""Create necessary user accounts and login as an admin user."""
self.logout()
self.login( email=common.test_user_1_email, username=common.test_user_1_name )
- test_user_1 = test_db_util.get_user( common.test_user_1_email )
+ test_user_1 = self.test_db_util.get_user( common.test_user_1_email )
assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % common.test_user_1_email
- test_user_1_private_role = test_db_util.get_private_role( test_user_1 )
+ test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 )
self.logout()
self.login( email=common.admin_email, username=common.admin_username )
- admin_user = test_db_util.get_user( common.admin_email )
+ admin_user = self.test_db_util.get_user( common.admin_email )
assert admin_user is not None, 'Problem retrieving user with email %s from the database' % common.admin_email
- admin_user_private_role = test_db_util.get_private_role( admin_user )
+ admin_user_private_role = self.test_db_util.get_private_role( admin_user )
def test_0005_create_category( self ):
"""Create a category for this test suite"""
@@ -37,7 +34,7 @@
'''Create and populate the emboss_datatypes 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( category_name )
+ category = self.test_db_util.get_category_by_name( category_name )
repository = self.get_or_create_repository( name=datatypes_repository_name,
description=datatypes_repository_description,
long_description=datatypes_repository_long_description,
@@ -56,12 +53,12 @@
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 )
+ repository = self.test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name )
self.display_manage_repository_page( repository, strings_displayed=[ 'Datatypes', 'equicktandem', 'hennig86', 'vectorstrip' ] )
def test_0020_create_emboss_5_repository_and_upload_files( self ):
'''Create and populate the emboss_5_0110 repository.'''
- category = test_db_util.get_category_by_name( category_name )
+ category = self.test_db_util.get_category_by_name( category_name )
repository = self.get_or_create_repository( name=emboss_repository_name,
description=emboss_repository_description,
long_description=emboss_repository_long_description,
@@ -82,8 +79,8 @@
'''Generate a repository dependency for emboss 5 with an invalid URL.'''
dependency_path = self.generate_temp_path( 'test_0110', additional_paths=[ 'simple' ] )
xml_filename = self.get_filename( 'repository_dependencies.xml', filepath=dependency_path )
- datatypes_repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name )
- emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
+ datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name )
+ emboss_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
url = 'http://http://this is not an url!'
name = datatypes_repository.name
owner = datatypes_repository.user.username
@@ -100,8 +97,8 @@
'''Generate a repository dependency for emboss 5 with an invalid name.'''
dependency_path = self.generate_temp_path( 'test_0110', additional_paths=[ 'simple' ] )
xml_filename = self.get_filename( 'repository_dependencies.xml', filepath=dependency_path )
- repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name )
- emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name )
+ emboss_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
url = self.url
name = '!?invalid?!'
owner = repository.user.username
@@ -118,8 +115,8 @@
'''Generate a repository dependency for emboss 5 with an invalid owner.'''
dependency_path = self.generate_temp_path( 'test_0110', additional_paths=[ 'simple' ] )
xml_filename = self.get_filename( 'repository_dependencies.xml', filepath=dependency_path )
- repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name )
- emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name )
+ emboss_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
url = self.url
name = repository.name
owner = '!?invalid?!'
@@ -136,8 +133,8 @@
'''Generate a repository dependency for emboss 5 with an invalid changeset revision.'''
dependency_path = self.generate_temp_path( 'test_0110', additional_paths=[ 'simple', 'invalid' ] )
xml_filename = self.get_filename( 'repository_dependencies.xml', filepath=dependency_path )
- repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name )
- emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_1_name )
+ emboss_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
url = self.url
name = repository.name
owner = repository.user.username
diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 test/tool_shed/functional/test_0120_simple_repository_dependency_multiple_owners.py
--- a/test/tool_shed/functional/test_0120_simple_repository_dependency_multiple_owners.py
+++ b/test/tool_shed/functional/test_0120_simple_repository_dependency_multiple_owners.py
@@ -1,6 +1,4 @@
from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
-import tool_shed.base.test_db_util as test_db_util
-
datatypes_repository_name = 'blast_datatypes_0120'
datatypes_repository_description = 'Galaxy applicable datatypes for BLAST'
datatypes_repository_long_description = 'Galaxy datatypes for the BLAST top hit descriptons tool'
@@ -23,7 +21,6 @@
base_datatypes_count = 0
repository_datatypes_count = 0
-
class TestRepositoryMultipleOwners( ShedTwillTestCase ):
def test_0000_initiate_users( self ):
@@ -34,19 +31,19 @@
"""
self.logout()
self.login( email=common.test_user_1_email, username=common.test_user_1_name )
- test_user_1 = test_db_util.get_user( common.test_user_1_email )
+ test_user_1 = self.test_db_util.get_user( common.test_user_1_email )
assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % common.test_user_1_email
- test_user_1_private_role = test_db_util.get_private_role( test_user_1 )
+ test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 )
self.logout()
self.login( email=common.test_user_2_email, username=common.test_user_2_name )
- test_user_2 = test_db_util.get_user( common.test_user_1_email )
+ test_user_2 = self.test_db_util.get_user( common.test_user_1_email )
assert test_user_2 is not None, 'Problem retrieving user with email %s from the database' % common.test_user_2_email
- test_user_2_private_role = test_db_util.get_private_role( test_user_2 )
+ test_user_2_private_role = self.test_db_util.get_private_role( test_user_2 )
self.logout()
self.login( email=common.admin_email, username=common.admin_username )
- admin_user = test_db_util.get_user( common.admin_email )
+ admin_user = self.test_db_util.get_user( common.admin_email )
assert admin_user is not None, 'Problem retrieving user with email %s from the database' % common.admin_email
- admin_user_private_role = test_db_util.get_private_role( admin_user )
+ admin_user_private_role = self.test_db_util.get_private_role( admin_user )
def test_0005_create_datatypes_repository( self ):
"""Create and populate the blast_datatypes_0120 repository"""
@@ -83,7 +80,7 @@
the datatypes that are defined in datatypes_conf.xml.
'''
global repository_datatypes_count
- repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_2_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_2_name )
strings_displayed = [ 'BlastXml', 'BlastNucDb', 'BlastProtDb', 'application/xml', 'text/html', 'blastxml', 'blastdbn', 'blastdbp']
self.display_manage_repository_page( repository, strings_displayed=strings_displayed )
repository_datatypes_count = int( self.get_repository_datatypes_count( repository ) )
@@ -121,7 +118,7 @@
We are at step 2a.
Check for appropriate strings, such as tool name, description, and version.
'''
- repository = test_db_util.get_repository_by_name_and_owner( tool_repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( tool_repository_name, common.test_user_1_name )
strings_displayed = [ 'blastxml_to_top_descr_0120', 'BLAST top hit descriptions', 'Make a table from BLAST XML' ]
strings_displayed.extend( [ '0.0.1', 'Valid tools'] )
self.display_manage_repository_page( repository, strings_displayed=strings_displayed )
@@ -132,8 +129,8 @@
We are at step 3.
Create a simple repository dependency for blastxml_to_top_descr_0120 that defines a dependency on blast_datatypes_0120.
'''
- datatypes_repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_2_name )
- tool_repository = test_db_util.get_repository_by_name_and_owner( tool_repository_name, common.test_user_1_name )
+ datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_2_name )
+ tool_repository = self.test_db_util.get_repository_by_name_and_owner( tool_repository_name, common.test_user_1_name )
dependency_xml_path = self.generate_temp_path( 'test_0120', additional_paths=[ 'dependencies' ] )
datatypes_tuple = ( self.url, datatypes_repository.name, datatypes_repository.user.username, self.get_repository_tip( datatypes_repository ) )
self.create_repository_dependency( repository=tool_repository, repository_tuples=[ datatypes_tuple ], filepath=dependency_xml_path )
@@ -144,6 +141,6 @@
We are at step 3a.
Check the newly created repository dependency to ensure that it was defined and displays correctly.
'''
- datatypes_repository = test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_2_name )
- tool_repository = test_db_util.get_repository_by_name_and_owner( tool_repository_name, common.test_user_1_name )
+ datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( datatypes_repository_name, common.test_user_2_name )
+ tool_repository = self.test_db_util.get_repository_by_name_and_owner( tool_repository_name, common.test_user_1_name )
self.check_repository_dependency( tool_repository, datatypes_repository )
diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 test/tool_shed/functional/test_0130_datatype_converters.py
--- a/test/tool_shed/functional/test_0130_datatype_converters.py
+++ b/test/tool_shed/functional/test_0130_datatype_converters.py
@@ -1,6 +1,4 @@
from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
-import tool_shed.base.test_db_util as test_db_util
-
repository_name = 'bed_to_gff_0130'
repository_description = "Converter: BED to GFF"
repository_long_description = "Convert bed to gff"
@@ -14,7 +12,6 @@
3) Visit the view tool metadata page and make sure that "Display in tool panel" is False
'''
-
class TestDatatypeConverters( ShedTwillTestCase ):
'''Test features related to datatype converters.'''
@@ -22,14 +19,14 @@
"""Create necessary user accounts."""
self.logout()
self.login( email=common.test_user_1_email, username=common.test_user_1_name )
- test_user_1 = test_db_util.get_user( common.test_user_1_email )
+ test_user_1 = self.test_db_util.get_user( common.test_user_1_email )
assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email
- test_user_1_private_role = test_db_util.get_private_role( test_user_1 )
+ test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 )
self.logout()
self.login( email=common.admin_email, username=common.admin_username )
- admin_user = test_db_util.get_user( common.admin_email )
+ admin_user = self.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 )
+ admin_user_private_role = self.test_db_util.get_private_role( admin_user )
def test_0005_create_bed_to_gff_repository( self ):
'''Create and populate bed_to_gff_0130.'''
@@ -64,7 +61,7 @@
We are at step 2 - Visit the manage repository page and make sure there is the appropriate valid tool and datatype.
There should be a 'Convert BED to GFF' tool and a 'galaxy.datatypes.interval:Bed' datatype with extension 'bed'
'''
- repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
strings_displayed = [ 'Convert BED to GFF', 'galaxy.datatypes.interval:Bed', 'bed', 'Valid tools', 'Datatypes' ]
strings_not_displayed = [ 'Invalid tools' ]
self.display_manage_repository_page( repository, strings_displayed=strings_displayed, strings_not_displayed=strings_not_displayed )
@@ -75,7 +72,7 @@
We are at step 3
Datatype converters that are associated with a datatype should have display in tool panel = False in the tool metadata.
'''
- repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
metadata = self.get_repository_metadata_by_changeset_revision( repository, self.get_repository_tip( repository ) )
tool_metadata_strings_displayed = '<label>Display in tool panel:</label>\n False'
self.check_repository_tools_for_changeset_revision( repository,
diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 test/tool_shed/functional/test_0140_tool_help_images.py
--- a/test/tool_shed/functional/test_0140_tool_help_images.py
+++ b/test/tool_shed/functional/test_0140_tool_help_images.py
@@ -1,5 +1,6 @@
from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
-import tool_shed.base.test_db_util as test_db_util
+
+
import logging
log = logging.getLogger(__name__)
@@ -20,7 +21,6 @@
'''
-
class TestToolHelpImages( ShedTwillTestCase ):
'''Test features related to tool help images.'''
@@ -28,14 +28,14 @@
"""Create necessary user accounts."""
self.logout()
self.login( email=common.test_user_1_email, username=common.test_user_1_name )
- test_user_1 = test_db_util.get_user( common.test_user_1_email )
+ test_user_1 = self.test_db_util.get_user( common.test_user_1_email )
assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email
- test_user_1_private_role = test_db_util.get_private_role( test_user_1 )
+ test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 )
self.logout()
self.login( email=common.admin_email, username=common.admin_username )
- admin_user = test_db_util.get_user( common.admin_email )
+ admin_user = self.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 )
+ admin_user_private_role = self.test_db_util.get_private_role( admin_user )
def test_0005_create_htseq_count_repository( self ):
'''Create and populate htseq_count_0140.'''
@@ -73,7 +73,7 @@
src="/repository/static/images/<id>/count_modes.png"
'''
- repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
# Get the repository tip.
changeset_revision = self.get_repository_tip( repository )
self.display_manage_repository_page( repository )
diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 test/tool_shed/functional/test_0150_prior_installation_required.py
--- a/test/tool_shed/functional/test_0150_prior_installation_required.py
+++ b/test/tool_shed/functional/test_0150_prior_installation_required.py
@@ -1,6 +1,4 @@
from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
-import tool_shed.base.test_db_util as test_db_util
-
column_repository_name = 'column_maker_0150'
column_repository_description = "Add column"
column_repository_long_description = "Compute an expression on every row"
@@ -26,7 +24,6 @@
Verify that convert_chars was installed first, contrary to the ordering that would be present without prior_installation_required.
'''
-
class TestSimplePriorInstallation( ShedTwillTestCase ):
'''Test features related to datatype converters.'''
@@ -34,14 +31,14 @@
"""Create necessary user accounts."""
self.logout()
self.login( email=common.test_user_1_email, username=common.test_user_1_name )
- test_user_1 = test_db_util.get_user( common.test_user_1_email )
+ test_user_1 = self.test_db_util.get_user( common.test_user_1_email )
assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email
- test_user_1_private_role = test_db_util.get_private_role( test_user_1 )
+ test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 )
self.logout()
self.login( email=common.admin_email, username=common.admin_username )
- admin_user = test_db_util.get_user( common.admin_email )
+ admin_user = self.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 )
+ admin_user_private_role = self.test_db_util.get_private_role( admin_user )
def test_0005_create_convert_repository( self ):
'''Create and populate convert_chars_0150.'''
@@ -89,8 +86,8 @@
Column maker repository dependency:
<repository toolshed="self.url" name="convert_chars" owner="test" changeset_revision="<tip>" prior_installation_required="True" />
'''
- column_repository = test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name )
- convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name )
+ column_repository = self.test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name )
+ convert_repository = self.test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name )
dependency_xml_path = self.generate_temp_path( 'test_0150', additional_paths=[ 'column' ] )
convert_tuple = ( self.url, convert_repository.name, convert_repository.user.username, self.get_repository_tip( convert_repository ) )
self.create_repository_dependency( repository=column_repository,
@@ -100,8 +97,8 @@
def test_0020_verify_repository_dependency( self ):
'''Verify that the previously generated repositiory dependency displays correctly.'''
- column_repository = test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name )
- convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name )
+ column_repository = self.test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name )
+ convert_repository = self.test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name )
self.check_repository_dependency( repository=column_repository,
depends_on_repository=convert_repository,
depends_on_changeset_revision=None,
diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 test/tool_shed/functional/test_0160_circular_prior_installation_required.py
--- a/test/tool_shed/functional/test_0160_circular_prior_installation_required.py
+++ b/test/tool_shed/functional/test_0160_circular_prior_installation_required.py
@@ -1,6 +1,4 @@
from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
-import tool_shed.base.test_db_util as test_db_util
-
filter_repository_name = 'filtering_0160'
filter_repository_description = "Galaxy's filtering tool for test 0160"
filter_repository_long_description = "Long description of Galaxy's filtering tool for test 0160"
@@ -25,7 +23,6 @@
Verify display.
'''
-
class TestSimplePriorInstallation( ShedTwillTestCase ):
'''Test features related to datatype converters.'''
@@ -33,14 +30,14 @@
"""Create necessary user accounts."""
self.logout()
self.login( email=common.test_user_1_email, username=common.test_user_1_name )
- test_user_1 = test_db_util.get_user( common.test_user_1_email )
+ test_user_1 = self.test_db_util.get_user( common.test_user_1_email )
assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email
- test_user_1_private_role = test_db_util.get_private_role( test_user_1 )
+ test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 )
self.logout()
self.login( email=common.admin_email, username=common.admin_username )
- admin_user = test_db_util.get_user( common.admin_email )
+ admin_user = self.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 )
+ admin_user_private_role = self.test_db_util.get_private_role( admin_user )
def test_0005_create_convert_repository( self ):
'''Create and populate convert_chars_0160.'''
@@ -106,9 +103,9 @@
'''
Each of the three repositories should depend on the other two, to make this as circular as possible.
'''
- filter_repository = test_db_util.get_repository_by_name_and_owner( filter_repository_name, common.test_user_1_name )
- column_repository = test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name )
- convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name )
+ filter_repository = self.test_db_util.get_repository_by_name_and_owner( filter_repository_name, common.test_user_1_name )
+ column_repository = self.test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name )
+ convert_repository = self.test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name )
dependency_xml_path = self.generate_temp_path( 'test_0160', additional_paths=[ 'column' ] )
filter_revision = self.get_repository_tip( filter_repository )
column_revision = self.get_repository_tip( column_repository )
@@ -131,9 +128,9 @@
def test_0025_verify_repository_dependency( self ):
'''Verify that the previously generated repositiory dependency displays correctly.'''
- filter_repository = test_db_util.get_repository_by_name_and_owner( filter_repository_name, common.test_user_1_name )
- column_repository = test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name )
- convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name )
+ filter_repository = self.test_db_util.get_repository_by_name_and_owner( filter_repository_name, common.test_user_1_name )
+ column_repository = self.test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name )
+ convert_repository = self.test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name )
self.check_repository_dependency( repository=column_repository,
depends_on_repository=convert_repository,
depends_on_changeset_revision=None,
diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 test/tool_shed/functional/test_0170_complex_prior_installation_required.py
--- a/test/tool_shed/functional/test_0170_complex_prior_installation_required.py
+++ b/test/tool_shed/functional/test_0170_complex_prior_installation_required.py
@@ -1,6 +1,4 @@
from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
-import tool_shed.base.test_db_util as test_db_util
-
matplotlib_repository_name = 'package_matplotlib_1_2_0170'
matplotlib_repository_description = "Contains a tool dependency definition that downloads and compiles version 1.2.x of the the python matplotlib package."
matplotlib_repository_long_description = "This repository is intended to be defined as a complex repository dependency within a separate repository."
@@ -18,7 +16,6 @@
3. Verify that package_matplotlib_1_2_0170 now depends on package_numpy_1_7_0170, and that the inherited tool dependency displays correctly.
'''
-
class TestComplexPriorInstallation( ShedTwillTestCase ):
'''Test features related to datatype converters.'''
@@ -26,14 +23,14 @@
"""Create necessary user accounts."""
self.logout()
self.login( email=common.test_user_1_email, username=common.test_user_1_name )
- test_user_1 = test_db_util.get_user( common.test_user_1_email )
+ test_user_1 = self.test_db_util.get_user( common.test_user_1_email )
assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email
- test_user_1_private_role = test_db_util.get_private_role( test_user_1 )
+ test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 )
self.logout()
self.login( email=common.admin_email, username=common.admin_username )
- admin_user = test_db_util.get_user( common.admin_email )
+ admin_user = self.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 )
+ admin_user_private_role = self.test_db_util.get_private_role( admin_user )
def test_0005_create_matplotlib_repository( self ):
'''Create and populate the package_matplotlib_1_2_0170 repository.'''
@@ -91,8 +88,8 @@
set to True. When matplotlib is selected for installation, the result should be that numpy is compiled
and installed first.
'''
- numpy_repository = test_db_util.get_repository_by_name_and_owner( numpy_repository_name, common.test_user_1_name )
- matplotlib_repository = test_db_util.get_repository_by_name_and_owner( matplotlib_repository_name, common.test_user_1_name )
+ numpy_repository = self.test_db_util.get_repository_by_name_and_owner( numpy_repository_name, common.test_user_1_name )
+ matplotlib_repository = self.test_db_util.get_repository_by_name_and_owner( matplotlib_repository_name, common.test_user_1_name )
# Generate the new dependency XML. Normally, the create_repository_dependency method would be used for this, but
# it replaces any existing tool or repository dependency XML file with the generated contents. This is undesirable
# in this case, because matplotlib already has an additional tool dependency definition that we don't want to
@@ -128,8 +125,8 @@
'Inhherited' in this case means that matplotlib should show a package tool dependency on numpy version 1.7, and a repository
dependency on the latest revision of package_numpy_1_7_0170.
'''
- numpy_repository = test_db_util.get_repository_by_name_and_owner( numpy_repository_name, common.test_user_1_name )
- matplotlib_repository = test_db_util.get_repository_by_name_and_owner( matplotlib_repository_name, common.test_user_1_name )
+ numpy_repository = self.test_db_util.get_repository_by_name_and_owner( numpy_repository_name, common.test_user_1_name )
+ matplotlib_repository = self.test_db_util.get_repository_by_name_and_owner( matplotlib_repository_name, common.test_user_1_name )
changeset_revision = self.get_repository_tip( numpy_repository )
self.check_repository_dependency( matplotlib_repository, depends_on_repository=numpy_repository )
self.display_manage_repository_page( matplotlib_repository, strings_displayed=[ 'numpy', '1.7', 'package', changeset_revision ] )
diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 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
@@ -1,6 +1,4 @@
from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
-import tool_shed.base.test_db_util as test_db_util
-
datatypes_repository_name = 'emboss_datatypes_0020'
datatypes_repository_description = "Galaxy applicable data formats used by Emboss tools."
datatypes_repository_long_description = "Galaxy applicable data formats used by Emboss tools. This repository contains no tools."
@@ -41,6 +39,7 @@
running_standalone = False
+
class TestResetAllRepositoryMetadata( ShedTwillTestCase ):
'''Verify that the "Reset selected metadata" feature works.'''
@@ -48,14 +47,14 @@
"""Create necessary user accounts."""
self.logout()
self.login( email=common.test_user_1_email, username=common.test_user_1_name )
- test_user_1 = test_db_util.get_user( common.test_user_1_email )
+ test_user_1 = self.test_db_util.get_user( common.test_user_1_email )
assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email
- test_user_1_private_role = test_db_util.get_private_role( test_user_1 )
+ test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 )
self.logout()
self.login( email=common.admin_email, username=common.admin_username )
- admin_user = test_db_util.get_user( common.admin_email )
+ admin_user = self.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 )
+ admin_user_private_role = self.test_db_util.get_private_role( admin_user )
def test_0005_create_filtering_repository( self ):
'''Create and populate the filtering_0000 repository.'''
@@ -298,10 +297,10 @@
'''Create the dependency structure for test 0030.'''
global running_standalone
if running_standalone:
- datatypes_repository = test_db_util.get_repository_by_name_and_owner( 'emboss_datatypes_0030', common.test_user_1_name )
- emboss_repository = test_db_util.get_repository_by_name_and_owner( 'emboss_0030', common.test_user_1_name )
- emboss_5_repository = test_db_util.get_repository_by_name_and_owner( 'emboss_5_0030', common.test_user_1_name )
- emboss_6_repository = test_db_util.get_repository_by_name_and_owner( 'emboss_6_0030', common.test_user_1_name )
+ datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( 'emboss_datatypes_0030', common.test_user_1_name )
+ emboss_repository = self.test_db_util.get_repository_by_name_and_owner( 'emboss_0030', common.test_user_1_name )
+ emboss_5_repository = self.test_db_util.get_repository_by_name_and_owner( 'emboss_5_0030', common.test_user_1_name )
+ emboss_6_repository = self.test_db_util.get_repository_by_name_and_owner( 'emboss_6_0030', common.test_user_1_name )
repository_dependencies_path = self.generate_temp_path( 'test_0330', additional_paths=[ 'emboss' ] )
datatypes_tuple = ( self.url, datatypes_repository.name, datatypes_repository.user.username, self.get_repository_tip( datatypes_repository ) )
emboss_5_tuple = ( self.url, emboss_5_repository.name, emboss_5_repository.user.username, self.get_repository_tip( emboss_5_repository ) )
@@ -365,8 +364,8 @@
'''Create the dependency structure for test 0040.'''
global running_standalone
if running_standalone:
- freebayes_repository = test_db_util.get_repository_by_name_and_owner( 'freebayes_0040', common.test_user_1_name )
- filtering_repository = test_db_util.get_repository_by_name_and_owner( 'filtering_0040', common.test_user_1_name )
+ freebayes_repository = self.test_db_util.get_repository_by_name_and_owner( 'freebayes_0040', common.test_user_1_name )
+ filtering_repository = self.test_db_util.get_repository_by_name_and_owner( 'filtering_0040', common.test_user_1_name )
repository_dependencies_path = self.generate_temp_path( 'test_0340', additional_paths=[ 'dependencies' ] )
freebayes_tuple = ( self.url, freebayes_repository.name, freebayes_repository.user.username, self.get_repository_tip( freebayes_repository ) )
filtering_tuple = ( self.url, filtering_repository.name, filtering_repository.user.username, self.get_repository_tip( filtering_repository ) )
@@ -554,13 +553,13 @@
if running_standalone:
self.logout()
self.login( email=common.test_user_1_email, username=common.test_user_1_name )
- column_repository = test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name )
- convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name )
- datatypes_repository = test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name )
- emboss_repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
- filtering_repository = test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name )
- freebayes_repository = test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name )
- bismark_repository = test_db_util.get_repository_by_name_and_owner( bismark_repository_name, common.test_user_1_name )
+ column_repository = self.test_db_util.get_repository_by_name_and_owner( column_repository_name, common.test_user_1_name )
+ convert_repository = self.test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name )
+ datatypes_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_datatypes_repository_name, common.test_user_1_name )
+ emboss_repository = self.test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
+ filtering_repository = self.test_db_util.get_repository_by_name_and_owner( filtering_repository_name, common.test_user_1_name )
+ freebayes_repository = self.test_db_util.get_repository_by_name_and_owner( freebayes_repository_name, common.test_user_1_name )
+ bismark_repository = self.test_db_util.get_repository_by_name_and_owner( bismark_repository_name, common.test_user_1_name )
dependency_xml_path = self.generate_temp_path( 'test_0050', additional_paths=[ 'freebayes' ] )
# convert_chars depends on column_maker
# column_maker depends on convert_chars
@@ -629,7 +628,7 @@
self.login( email=common.admin_email, username=common.admin_username )
old_metadata = dict()
new_metadata = dict()
- repositories = test_db_util.get_all_repositories()
+ repositories = self.test_db_util.get_all_repositories()
for repository in repositories:
old_metadata[ self.security.encode_id( repository.id ) ] = dict()
for metadata in self.get_repository_metadata( repository ):
diff -r d0c56b58064bd73bd6ca408796453abb0f5404c2 -r c2511b37db9bfbc6ec07aba5ebc5795b2c8206a3 test/tool_shed/functional/test_0310_hg_push_from_api.py
--- a/test/tool_shed/functional/test_0310_hg_push_from_api.py
+++ b/test/tool_shed/functional/test_0310_hg_push_from_api.py
@@ -1,5 +1,6 @@
from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
-import tool_shed.base.test_db_util as test_db_util
+
+
import logging
log = logging.getLogger( __name__ )
@@ -22,7 +23,6 @@
5. Verify that the changesets have been applied.
'''
-
class TestHgWebFeatures( ShedTwillTestCase ):
'''Test http mercurial interface.'''
@@ -30,19 +30,19 @@
"""Create necessary user accounts and login as an admin user."""
self.logout()
self.login( email=common.test_user_1_email, username=common.test_user_1_name )
- test_user_1 = test_db_util.get_user( common.test_user_1_email )
+ test_user_1 = self.test_db_util.get_user( common.test_user_1_email )
assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email
- test_user_1_private_role = test_db_util.get_private_role( test_user_1 )
+ test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 )
self.logout()
self.login( email=common.test_user_2_email, username=common.test_user_2_name )
- test_user_2 = test_db_util.get_user( common.test_user_2_email )
+ test_user_2 = self.test_db_util.get_user( common.test_user_2_email )
assert test_user_2 is not None, 'Problem retrieving user with email %s from the database' % common.test_user_2_email
- test_user_2_private_role = test_db_util.get_private_role( test_user_2 )
+ test_user_2_private_role = self.test_db_util.get_private_role( test_user_2 )
self.logout()
self.login( email=common.admin_email, username=common.admin_username )
- admin_user = test_db_util.get_user( common.admin_email )
+ admin_user = self.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 )
+ admin_user_private_role = self.test_db_util.get_private_role( admin_user )
def test_0005_create_filtering_repository( self ):
'''Create and populate the filtering_0310 repository.'''
@@ -98,7 +98,7 @@
We will be prepending a comment to filtering.py.
'''
- repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
clone_path = self.generate_temp_path( 'test_0310', additional_paths=[ 'filtering_0310', 'user2' ] )
self.clone_repository( repository, clone_path )
hgrepo = self.get_hg_repo( clone_path )
@@ -133,7 +133,7 @@
We will be prepending a second comment to filtering.py.
'''
- repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
clone_path = self.generate_temp_path( 'test_0310', additional_paths=[ 'filtering_0310', 'user1' ] )
self.clone_repository( repository, clone_path )
hgrepo = self.get_hg_repo( clone_path )
@@ -161,7 +161,7 @@
The commit from test_user_2 should not be present in the changelog, since the repositories were cloned to separate locations.
'''
- repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
strings_displayed = [ 'Uploaded filtering 1.1.0.', 'Uploaded filtering test data.',
'Added another line to filtering.py.' ]
strings_not_displayed = [ 'Added a line to filtering.py' ]
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.
1
0
commit/galaxy-central: jmchilton: Use null object pattern to simplify logic related to no dependency manager being set.
by commits-noreply@bitbucket.org 13 Dec '13
by commits-noreply@bitbucket.org 13 Dec '13
13 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/d0c56b58064b/
Changeset: d0c56b58064b
User: jmchilton
Date: 2013-12-13 22:43:26
Summary: Use null object pattern to simplify logic related to no dependency manager being set.
Fixes bug introduced in 4241eff related to dependency_manager being None if tool_dependency_dir is not set.
Affected #: 4 files
diff -r 97f810044c531393a56cb84898ab5e7b759ee3e2 -r d0c56b58064bd73bd6ca408796453abb0f5404c2 lib/galaxy/jobs/__init__.py
--- a/lib/galaxy/jobs/__init__.py
+++ b/lib/galaxy/jobs/__init__.py
@@ -688,10 +688,7 @@
if self.command_line and self.command_line.startswith( 'python' ):
self.galaxy_lib_dir = os.path.abspath( "lib" ) # cwd = galaxy root
# Shell fragment to inject dependencies
- if self.app.config.use_tool_dependencies:
- self.dependency_shell_commands = self.tool.build_dependency_shell_commands()
- else:
- self.dependency_shell_commands = None
+ self.dependency_shell_commands = self.tool.build_dependency_shell_commands()
# We need command_line persisted to the db in order for Galaxy to re-queue the job
# if the server was stopped and restarted before the job finished
job.command_line = self.command_line
@@ -1435,10 +1432,7 @@
if self.command_line and self.command_line.startswith( 'python' ):
self.galaxy_lib_dir = os.path.abspath( "lib" ) # cwd = galaxy root
# Shell fragment to inject dependencies
- if self.app.config.use_tool_dependencies:
- self.dependency_shell_commands = self.tool.build_dependency_shell_commands()
- else:
- self.dependency_shell_commands = None
+ self.dependency_shell_commands = self.tool.build_dependency_shell_commands()
# We need command_line persisted to the db in order for Galaxy to re-queue the job
# if the server was stopped and restarted before the job finished
task.command_line = self.command_line
diff -r 97f810044c531393a56cb84898ab5e7b759ee3e2 -r d0c56b58064bd73bd6ca408796453abb0f5404c2 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -40,7 +40,7 @@
from galaxy.tools.actions import DefaultToolAction
from galaxy.tools.actions.data_source import DataSourceToolAction
from galaxy.tools.actions.data_manager import DataManagerToolAction
-from galaxy.tools.deps import DependencyManager, INDETERMINATE_DEPENDENCY
+from galaxy.tools.deps import build_dependency_manager
from galaxy.tools.deps.requirements import parse_requirements_from_xml
from galaxy.tools.parameters import check_param, params_from_strings, params_to_strings
from galaxy.tools.parameters.basic import (BaseURLToolParameter,
@@ -700,14 +700,7 @@
return stored.latest_workflow
def init_dependency_manager( self ):
- if self.app.config.use_tool_dependencies:
- dependency_manager_kwds = {
- 'default_base_path': self.app.config.tool_dependency_dir,
- 'conf_file': self.app.config.dependency_resolvers_config_file,
- }
- self.dependency_manager = DependencyManager( **dependency_manager_kwds )
- else:
- self.dependency_manager = None
+ self.dependency_manager = build_dependency_manager( self.app.config )
@property
def sa_session( self ):
diff -r 97f810044c531393a56cb84898ab5e7b759ee3e2 -r d0c56b58064bd73bd6ca408796453abb0f5404c2 lib/galaxy/tools/deps/__init__.py
--- a/lib/galaxy/tools/deps/__init__.py
+++ b/lib/galaxy/tools/deps/__init__.py
@@ -15,6 +15,31 @@
from galaxy.util.submodules import submodules
+def build_dependency_manager( config ):
+ if config.use_tool_dependencies:
+ dependency_manager_kwds = {
+ 'default_base_path': config.tool_dependency_dir,
+ 'conf_file': config.dependency_resolvers_config_file,
+ }
+ dependency_manager = DependencyManager( **dependency_manager_kwds )
+ else:
+ dependency_manager = NullDependencyManager()
+
+ return dependency_manager
+
+
+class NullDependencyManager( object ):
+
+ def uses_tool_shed_dependencies(self):
+ return False
+
+ def dependency_shell_commands( self, requirements, **kwds ):
+ return []
+
+ def find_dep( self, name, version=None, type='package', **kwds ):
+ return INDETERMINATE_DEPENDENCY
+
+
class DependencyManager( object ):
"""
A DependencyManager attempts to resolve named and versioned dependencies by
diff -r 97f810044c531393a56cb84898ab5e7b759ee3e2 -r d0c56b58064bd73bd6ca408796453abb0f5404c2 lib/tool_shed/util/common_install_util.py
--- a/lib/tool_shed/util/common_install_util.py
+++ b/lib/tool_shed/util/common_install_util.py
@@ -462,7 +462,7 @@
if tool_dependency.can_install:
# The database record is currently in a state that allows us to install the package on the file system.
try:
- dependencies_ignored = app.toolbox.dependency_manager and not app.toolbox.dependency_manager.uses_tool_shed_dependencies()
+ dependencies_ignored = not app.toolbox.dependency_manager.uses_tool_shed_dependencies()
if dependencies_ignored:
log.debug( "Skipping package %s because tool shed dependency resolver not enabled." % str( package_name ) )
# Tool dependency resolves have been configured and they do not include the tool shed. Do not install package.
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.
1
0
commit/galaxy-central: guerler: Masthead: Prevent navbar collapse
by commits-noreply@bitbucket.org 13 Dec '13
by commits-noreply@bitbucket.org 13 Dec '13
13 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/97f810044c53/
Changeset: 97f810044c53
User: guerler
Date: 2013-12-13 22:10:21
Summary: Masthead: Prevent navbar collapse
Affected #: 2 files
diff -r a32dcf32dffc6dd7175092f4fda7476258fe061e -r 97f810044c531393a56cb84898ab5e7b759ee3e2 static/style/blue/base.css
--- a/static/style/blue/base.css
+++ b/static/style/blue/base.css
@@ -80,7 +80,7 @@
dt,dd{line-height:1.428571429}
dt{font-weight:bold}
dd{margin-left:0}
-@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap} .dl-horizontal dd{margin-left:180px}.dl-horizontal dd:before,.dl-horizontal dd:after{content:" ";display:table;} .dl-horizontal dd:after{clear:both} .dl-horizontal dd:before,.dl-horizontal dd:after{content:" ";display:table;} .dl-horizontal dd:after{clear:both}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #999}
+@media (min-width:0){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap} .dl-horizontal dd{margin-left:180px}.dl-horizontal dd:before,.dl-horizontal dd:after{content:" ";display:table;} .dl-horizontal dd:after{clear:both} .dl-horizontal dd:before,.dl-horizontal dd:after{content:" ";display:table;} .dl-horizontal dd:after{clear:both}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #999}
abbr.initialism{font-size:90%;text-transform:uppercase}
blockquote{padding:8.5px 17px;margin:0 0 17px;border-left:5px solid #eee}blockquote p{font-size:15px;font-weight:300;line-height:1.25}
blockquote p:last-child{margin-bottom:0}
@@ -433,7 +433,7 @@
.pull-right>.dropdown-menu{right:0;left:auto}
.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0 dotted;border-bottom:4px solid #000;content:""}
.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}
-@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}}.btn-default .caret{border-top-color:#333}
+@media (min-width:0){.navbar-right .dropdown-menu{right:0;left:auto}}.btn-default .caret{border-top-color:#333}
.btn-primary .caret,.btn-success .caret,.btn-warning .caret,.btn-danger .caret,.btn-info .caret{border-top-color:#fff}
.dropup .btn-default .caret{border-bottom-color:#333}
.dropup .btn-primary .caret,.dropup .btn-success .caret,.dropup .btn-warning .caret,.dropup .btn-danger .caret,.dropup .btn-info .caret{border-bottom-color:#fff}
@@ -533,37 +533,37 @@
.navbar:after{clear:both}
.navbar:before,.navbar:after{content:" ";display:table;}
.navbar:after{clear:both}
-@media (min-width:768px){.navbar{border-radius:3px}}
+@media (min-width:0){.navbar{border-radius:3px}}
.navbar-header:before,.navbar-header:after{content:" ";display:table;}
.navbar-header:after{clear:both}
.navbar-header:before,.navbar-header:after{content:" ";display:table;}
.navbar-header:after{clear:both}
-@media (min-width:768px){.navbar-header{float:left}}
+@media (min-width:0){.navbar-header{float:left}}
.navbar-collapse{max-height:340px;overflow-x:visible;padding-right:15px;padding-left:15px;border-top:1px solid transparent;box-shadow:inset 0 1px 0 rgba(255,255,255,0.1);-webkit-overflow-scrolling:touch}.navbar-collapse:before,.navbar-collapse:after{content:" ";display:table;}
.navbar-collapse:after{clear:both}
.navbar-collapse:before,.navbar-collapse:after{content:" ";display:table;}
.navbar-collapse:after{clear:both}
.navbar-collapse.in{overflow-y:auto}
-@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;box-shadow:none}.navbar-collapse.collapse{display:block !important;height:auto !important;padding-bottom:0;overflow:visible !important} .navbar-collapse.in{overflow-y:visible} .navbar-collapse .navbar-nav.navbar-left:first-child{margin-left:-15px} .navbar-collapse .navbar-nav.navbar-right:last-child{margin-right:-15px} .navbar-collapse .navbar-text:last-child{margin-right:0}}
-.container>.navbar-header,.container>.navbar-collapse{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container>.navbar-header,.container>.navbar-collapse{margin-right:0;margin-left:0}}
-.navbar-static-top{border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}
-.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;border-width:0 0 1px}@media (min-width:768px){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}}
+@media (min-width:0){.navbar-collapse{width:auto;border-top:0;box-shadow:none}.navbar-collapse.collapse{display:block !important;height:auto !important;padding-bottom:0;overflow:visible !important} .navbar-collapse.in{overflow-y:visible} .navbar-collapse .navbar-nav.navbar-left:first-child{margin-left:-15px} .navbar-collapse .navbar-nav.navbar-right:last-child{margin-right:-15px} .navbar-collapse .navbar-text:last-child{margin-right:0}}
+.container>.navbar-header,.container>.navbar-collapse{margin-right:-15px;margin-left:-15px}@media (min-width:0){.container>.navbar-header,.container>.navbar-collapse{margin-right:0;margin-left:0}}
+.navbar-static-top{border-width:0 0 1px}@media (min-width:0){.navbar-static-top{border-radius:0}}
+.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;border-width:0 0 1px}@media (min-width:0){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}}
.navbar-fixed-top{z-index:1030;top:0}
.navbar-fixed-bottom{bottom:0;margin-bottom:0}
.navbar-brand{float:left;padding:8px 15px;font-size:15px;line-height:17px}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}
-@media (min-width:768px){.navbar>.container .navbar-brand{margin-left:-15px}}
+@media (min-width:0){.navbar>.container .navbar-brand{margin-left:-15px}}
.navbar-toggle{position:relative;float:right;margin-right:15px;padding:9px 10px;margin-top:-0.5px;margin-bottom:-0.5px;background-color:transparent;border:1px solid transparent;border-radius:3px}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}
.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}
-@media (min-width:768px){.navbar-toggle{display:none}}
+@media (min-width:0){.navbar-toggle{display:none}}
.navbar-nav{margin:4px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:17px}
-@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;box-shadow:none}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px} .navbar-nav .open .dropdown-menu>li>a{line-height:17px}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:8px;padding-bottom:8px}}
-@media (min-width:768px){.navbar-left{float:left !important;float:left} .navbar-right{float:right !important;float:right}}.navbar-form{margin-left:-15px;margin-right:-15px;padding:10px 15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);margin-top:3px;margin-bottom:3px}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle} .navbar-form .form-control{display:inline-block} .navbar-form .radio,.navbar-form .checkbox{display:inline-block;margin-top:0;margin-bottom:0;padding-left:0} .navbar-form .radio input[type="radio"],.navbar-form .checkbox input[type="checkbox"]{float:none;margin-left:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}}
-@media (min-width:768px){.navbar-form{width:auto;border:0;margin-left:0;margin-right:0;padding-top:0;padding-bottom:0;-webkit-box-shadow:none;box-shadow:none}}
+@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;box-shadow:none}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px} .navbar-nav .open .dropdown-menu>li>a{line-height:17px}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none}}@media (min-width:0){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:8px;padding-bottom:8px}}
+@media (min-width:0){.navbar-left{float:left !important;float:left} .navbar-right{float:right !important;float:right}}.navbar-form{margin-left:-15px;margin-right:-15px;padding:10px 15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);margin-top:3px;margin-bottom:3px}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle} .navbar-form .form-control{display:inline-block} .navbar-form .radio,.navbar-form .checkbox{display:inline-block;margin-top:0;margin-bottom:0;padding-left:0} .navbar-form .radio input[type="radio"],.navbar-form .checkbox input[type="checkbox"]{float:none;margin-left:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}}
+@media (min-width:0){.navbar-form{width:auto;border:0;margin-left:0;margin-right:0;padding-top:0;padding-bottom:0;-webkit-box-shadow:none;box-shadow:none}}
.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-right-radius:0;border-top-left-radius:0}
.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{border-bottom-right-radius:0;border-bottom-left-radius:0}
.navbar-nav.pull-right>li>.dropdown-menu,.navbar-nav>li>.dropdown-menu.pull-right{left:auto;right:0}
.navbar-btn{margin-top:3px;margin-bottom:3px}
-.navbar-text{float:left;margin-top:8px;margin-bottom:8px}@media (min-width:768px){.navbar-text{margin-left:15px;margin-right:15px}}
+.navbar-text{float:left;margin-top:8px;margin-bottom:8px}@media (min-width:0){.navbar-text{margin-left:15px;margin-right:15px}}
.navbar-default{background-color:#eee;border-color:#888}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#5e5e5e;background-color:transparent}
.navbar-default .navbar-text{color:#777}
.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#333;background-color:transparent}
diff -r a32dcf32dffc6dd7175092f4fda7476258fe061e -r 97f810044c531393a56cb84898ab5e7b759ee3e2 static/style/src/less/galaxy_bootstrap/variables.less
--- a/static/style/src/less/galaxy_bootstrap/variables.less
+++ b/static/style/src/less/galaxy_bootstrap/variables.less
@@ -295,7 +295,7 @@
// Padding, to be divided by two and applied to the left and right of all columns
@grid-gutter-width: 30px;
// Point at which the navbar stops collapsing
-@grid-float-breakpoint: @screen-sm;
+@grid-float-breakpoint: 0px;
// Navbar
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.
1
0