galaxy-dev
Threads by month
- ----- 2026 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 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
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- 10009 discussions
09 Jun '09
details: http://www.bx.psu.edu/hg/galaxy/rev/1a24a530a3ae
changeset: 2431:1a24a530a3ae
user: Greg Von Kuster <greg(a)bx.psu.edu>
date: Mon Jun 08 10:31:59 2009 -0400
description:
Temporarily eliminate access to templates until new forms are finished, and more fixes for functional tests.
7 file(s) affected in this change:
lib/galaxy/web/controllers/admin.py
templates/admin/library/browse_library.mako
templates/library/browse_library.mako
test/base/twilltestcase.py
test/functional/test_DNAse_flanked_genes.py
test/functional/test_metadata_editing.py
test/functional/test_security_and_libraries.py
diffs (1339 lines):
diff -r 373962edbe90 -r 1a24a530a3ae lib/galaxy/web/controllers/admin.py
--- a/lib/galaxy/web/controllers/admin.py Fri Jun 05 16:48:03 2009 -0400
+++ b/lib/galaxy/web/controllers/admin.py Mon Jun 08 10:31:59 2009 -0400
@@ -553,9 +553,7 @@
# with the user's private role in case we want the ability to unpurge the user
# some time in the future.
# Purging a deleted User deletes all of the following:
- # - DefaultUserPermissions where user_id == User.id EXCEPT FOR THE PRIVATE ROLE
# - History where user_id = User.id
- # - DefaultHistoryPermissions where history_id == History.id EXCEPT FOR THE PRIVATE ROLE
# - HistoryDatasetAssociation where history_id = History.id
# - Dataset where HistoryDatasetAssociation.dataset_id = Dataset.id
# - UserGroupAssociation where user_id == User.id
@@ -568,19 +566,9 @@
msg = "User '%s' has not been deleted, so it cannot be purged." % user.email
trans.response.send_redirect( web.url_for( action='users', msg=util.sanitize_text( msg ), messagetype='error' ) )
private_role = trans.app.security_agent.get_private_user_role( user )
- # Delete DefaultUserPermissions EXCEPT FOR THE PRIVATE ROLE
- for dup in user.default_permissions:
- if dup.role_id != private_role.id:
- dup.delete()
- dup.flush()
# Delete History
for h in user.active_histories:
h.refresh()
- # Delete DefaultHistoryPermissions EXCEPT FOR THE PRIVATE ROLE
- for dp in h.default_permissions:
- if dp.role_id != private_role.id:
- dp.delete()
- dp.flush()
for hda in h.active_datasets:
# Delete HistoryDatasetAssociation
d = trans.app.model.Dataset.get( hda.dataset_id )
diff -r 373962edbe90 -r 1a24a530a3ae templates/admin/library/browse_library.mako
--- a/templates/admin/library/browse_library.mako Fri Jun 05 16:48:03 2009 -0400
+++ b/templates/admin/library/browse_library.mako Mon Jun 08 10:31:59 2009 -0400
@@ -112,13 +112,14 @@
<a class="action-button" href="${h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library_id, folder_id=folder.id )}">Add datasets to this folder</a>
<a class="action-button" href="${h.url_for( controller='admin', action='folder', new=True, id=folder.id, library_id=library_id )}">Create a new sub-folder in this folder</a>
<a class="action-button" href="${h.url_for( controller='admin', action='folder', information=True, id=folder.id, library_id=library_id )}">Edit this folder's information</a>
- %if folder.library_folder_info_template_associations:
- <% template = folder.get_library_item_info_templates( template_list=[], restrict=True )[0] %>
- <a class="action-button" href="${h.url_for( controller='admin', action='info_template', library_id=library_id, id=template.id, edit_template=True )}">Edit this folder's information template</a>
- %elif not folder.library_folder_info_associations:
- ## Only allow adding a new template to the folder if a previously inherited template has not already been used
- <a class="action-button" href="${h.url_for( controller='admin', action='info_template', library_id=library_id, folder_id=folder.id, new_template=True )}">Add an information template to this folder</a>
- %endif
+ ## TODO: temporarily eliminating templates until we have the new forms features done
+ ##%if folder.library_folder_info_template_associations:
+ ## <% template = folder.get_library_item_info_templates( template_list=[], restrict=True )[0] %>
+ ## <a class="action-button" href="${h.url_for( controller='admin', action='info_template', library_id=library_id, id=template.id, edit_template=True )}">Edit this folder's information template</a>
+ ##%elif not folder.library_folder_info_associations:
+ ## ## Only allow adding a new template to the folder if a previously inherited template has not already been used
+ ## <a class="action-button" href="${h.url_for( controller='admin', action='info_template', library_id=library_id, folder_id=folder.id, new_template=True )}">Add an information template to this folder</a>
+ ##%endif
<a class="action-button" href="${h.url_for( controller='admin', action='folder', permissions=True, id=folder.id, library_id=library_id )}">Edit this folder's permissions</a>
<a class="action-button" confirm="Click OK to delete the folder '${folder.name}.'" href="${h.url_for( controller='admin', action='delete_library_item', library_id=library_id, library_item_id=folder.id, library_item_type='folder' )}">Delete this folder and its contents</a>
</div>
@@ -199,21 +200,21 @@
library_item_ids = {}
library_item_ids[ 'library' ] = library.id
%>
-
- <a class="action-button" href="${h.url_for( controller='admin', action='library', id=library.id, information=True )}">Edit this library's information</a>
- %if library.library_info_template_associations:
- <% template = library.get_library_item_info_templates( template_list=[], restrict=False )[0] %>
- <a class="action-button" href="${h.url_for( controller='admin', action='info_template', library_id=library.id, id=template.id, edit_template=True )}">Edit this library's information template</a>
- %else:
- <a class="action-button" href="${h.url_for( controller='admin', action='info_template', library_id=library.id, new_template=True )}">Add an information template to this library</a>
- %endif
- <a class="action-button" href="${h.url_for( controller='admin', action='library', id=library.id, permissions=True )}">Edit this library's permissions</a>
- <a class="action-button" confirm="Click OK to delete the library named '${library.name}'." href="${h.url_for( controller='admin', action='delete_library_item', library_id=library.id, library_item_id=library.id, library_item_type='library' )}">Delete this library and its contents</a>
- %if show_deleted:
- <a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library.id, show_deleted=False )}">Hide deleted library items</a>
- %else:
- <a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library.id, show_deleted=True )}">Show deleted library items</a>
- %endif
+ ## TODO: temporarily eliminating templates until we have the new forms features done
+ ##<a class="action-button" href="${h.url_for( controller='admin', action='library', id=library.id, information=True )}">Edit this library's information</a>
+ ##%if library.library_info_template_associations:
+ ## <% template = library.get_library_item_info_templates( template_list=[], restrict=False )[0] %>
+ ## <a class="action-button" href="${h.url_for( controller='admin', action='info_template', library_id=library.id, id=template.id, edit_template=True )}">Edit this library's information template</a>
+ ##%else:
+ ## <a class="action-button" href="${h.url_for( controller='admin', action='info_template', library_id=library.id, new_template=True )}">Add an information template to this library</a>
+ ##%endif
+ <a class="action-button" href="${h.url_for( controller='admin', action='library', id=library.id, permissions=True )}">Edit this library's permissions</a>
+ <a class="action-button" confirm="Click OK to delete the library named '${library.name}'." href="${h.url_for( controller='admin', action='delete_library_item', library_id=library.id, library_item_id=library.id, library_item_type='library' )}">Delete this library and its contents</a>
+ %if show_deleted:
+ <a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library.id, show_deleted=False )}">Hide deleted library items</a>
+ %else:
+ <a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library.id, show_deleted=True )}">Show deleted library items</a>
+ %endif
%elif not library.purged:
<a class="action-button" href="${h.url_for( controller='admin', action='undelete_library_item', library_id=library.id, library_item_id=library.id, library_item_type='library' )}">Undelete this library</a>
%endif
diff -r 373962edbe90 -r 1a24a530a3ae templates/library/browse_library.mako
--- a/templates/library/browse_library.mako Fri Jun 05 16:48:03 2009 -0400
+++ b/templates/library/browse_library.mako Mon Jun 08 10:31:59 2009 -0400
@@ -150,17 +150,18 @@
%else:
<a class="action-button" href="${h.url_for( controller='library', action='folder', information=True, id=folder.id, library_id=library_id )}">View this folder's information</a>
%endif
- %if folder.library_folder_info_template_associations:
- %if trans.app.security_agent.allow_action( trans.user, trans.app.security_agent.permitted_actions.LIBRARY_MODIFY, library_item=folder ):
- <% template = folder.get_library_item_info_templates( template_list=[], restrict=True )[0] %>
- <a class="action-button" href="${h.url_for( controller='library', action='info_template', library_id=library.id, id=template.id, edit_template=True )}">Edit this folder's information template</a>
- %endif
- %elif not folder.library_folder_info_associations:
- ## Only allow adding a new template to the folder if a previously inherited template has not already been used
- %if trans.app.security_agent.allow_action( trans.user, trans.app.security_agent.permitted_actions.LIBRARY_ADD, library_item=folder ):
- <a class="action-button" href="${h.url_for( controller='library', action='info_template', library_id=library.id, folder_id=folder.id, new_template=True )}">Add an information template to this folder</a>
- %endif
- %endif
+ ## TODO: temporarily eliminating templates until we have the new forms features done
+ ##%if folder.library_folder_info_template_associations:
+ ## %if trans.app.security_agent.allow_action( trans.user, trans.app.security_agent.permitted_actions.LIBRARY_MODIFY, library_item=folder ):
+ ## <% template = folder.get_library_item_info_templates( template_list=[], restrict=True )[0] %>
+ ## <a class="action-button" href="${h.url_for( controller='library', action='info_template', library_id=library.id, id=template.id, edit_template=True )}">Edit this folder's information template</a>
+ ## %endif
+ ##%elif not folder.library_folder_info_associations:
+ ## ## Only allow adding a new template to the folder if a previously inherited template has not already been used
+ ## %if trans.app.security_agent.allow_action( trans.user, trans.app.security_agent.permitted_actions.LIBRARY_ADD, library_item=folder ):
+ ## <a class="action-button" href="${h.url_for( controller='library', action='info_template', library_id=library.id, folder_id=folder.id, new_template=True )}">Add an information template to this folder</a>
+ ## %endif
+ ##%endif
%if trans.app.security_agent.allow_action( trans.user, trans.app.security_agent.permitted_actions.LIBRARY_MANAGE, library_item=folder ):
<a class="action-button" href="${h.url_for( controller='library', action='folder', permissions=True, id=folder.id, library_id=library_id )}">Edit this folder's permissions</a>
%endif
@@ -229,17 +230,17 @@
%else:
<a class="action-button" href="${h.url_for( controller='library', action='library', information=True, id=library.id )}">View this library's information</a>
%endif
-
- %if library.library_info_template_associations:
- <% template = library.get_library_item_info_templates( template_list=[], restrict=False )[0] %>
- %if trans.app.security_agent.allow_action( trans.user, trans.app.security_agent.permitted_actions.LIBRARY_MODIFY, library_item=template ):
- <a class="action-button" href="${h.url_for( controller='library', action='info_template', library_id=library.id, id=template.id, edit_template=True )}">Edit this library's information template</a>
- %endif
- %else:
- %if trans.app.security_agent.allow_action( trans.user, trans.app.security_agent.permitted_actions.LIBRARY_ADD, library_item=library ):
- <a class="action-button" href="${h.url_for( controller='library', action='info_template', library_id=library.id, new_template=True )}">Add an information template to this library</a>
- %endif
- %endif
+ ## TODO: temporarily eliminating templates until we have the new forms features done
+ ##%if library.library_info_template_associations:
+ ## <% template = library.get_library_item_info_templates( template_list=[], restrict=False )[0] %>
+ ## %if trans.app.security_agent.allow_action( trans.user, trans.app.security_agent.permitted_actions.LIBRARY_MODIFY, library_item=template ):
+ ## <a class="action-button" href="${h.url_for( controller='library', action='info_template', library_id=library.id, id=template.id, edit_template=True )}">Edit this library's information template</a>
+ ## %endif
+ ##%else:
+ ## %if trans.app.security_agent.allow_action( trans.user, trans.app.security_agent.permitted_actions.LIBRARY_ADD, library_item=library ):
+ ## <a class="action-button" href="${h.url_for( controller='library', action='info_template', library_id=library.id, new_template=True )}">Add an information template to this library</a>
+ ## %endif
+ ##%endif
%if trans.app.security_agent.allow_action( trans.user, trans.app.security_agent.permitted_actions.LIBRARY_MANAGE, library_item=library ):
<a class="action-button" href="${h.url_for( controller='library', action='library', permissions=True, id=library.id )}">Edit this library's permissions</a>
%endif
diff -r 373962edbe90 -r 1a24a530a3ae test/base/twilltestcase.py
--- a/test/base/twilltestcase.py Fri Jun 05 16:48:03 2009 -0400
+++ b/test/base/twilltestcase.py Mon Jun 08 10:31:59 2009 -0400
@@ -304,30 +304,49 @@
if check_str:
self.check_page_for_string( check_str )
self.home()
- def edit_metadata( self, hid=None, form_no=0, **kwd ):
- """Edits the metadata associated with a history item."""
- # There are currently 4 forms on the edit page:
- # 0. name="edit_attributes"
- # 1. name="auto_detect"
- # 2. name="convert_data"
- # 3. name="change_datatype"
- data_list = self.get_history()
- self.assertTrue( data_list )
- if hid is None: # take last hid
- elem = data_list[-1]
- hid = int( elem.get('hid') )
- self.assertTrue( hid )
- self.visit_page( 'edit?hid=%d' % hid )
- if form_no == 0:
- button = "save" #Edit Attributes form
- elif form_no == 1:
- button = "detect" #Auto-detect Metadata Attributes
- elif form_no == 2:
- button = "convert_data" #Convert to new format form
- elif form_no == 3:
- button = "change" #Change data type form
- if kwd:
- self.submit_form( form_no=form_no, button=button, **kwd)
+ def edit_hda_attribute_info( self, hda_id, new_name='', new_info='', new_dbkey='', new_startcol='' ):
+ """Edit history_dataset_association attribute information"""
+ self.home()
+ self.visit_url( "%s/root/edit?id=%s" % ( self.url, hda_id ) )
+ self.check_page_for_string( 'Edit Attributes' )
+ if new_name:
+ tc.fv( 'edit_attributes', 'name', new_name )
+ if new_info:
+ tc.fv( 'edit_attributes', 'info', new_info )
+ if new_dbkey:
+ tc.fv( 'edit_attributes', 'dbkey', new_dbkey )
+ if new_startcol:
+ tc.fv( 'edit_attributes', 'startCol', new_startcol )
+ tc.submit( 'save' )
+ self.check_page_for_string( 'Attributes updated' )
+ self.home()
+ def auto_detect_metadata( self, hda_id ):
+ """Auto-detect history_dataset_association metadata"""
+ self.home()
+ self.visit_url( "%s/root/edit?id=%s" % ( self.url, hda_id ) )
+ self.check_page_for_string( 'This will inspect the dataset and attempt' )
+ tc.fv( 'auto_detect', 'id', hda_id )
+ tc.submit( 'detect' )
+ self.check_page_for_string( 'Attributes updated' )
+ self.home()
+ def convert_format( self, hda_id, target_type ):
+ """Auto-detect history_dataset_association metadata"""
+ self.home()
+ self.visit_url( "%s/root/edit?id=%s" % ( self.url, hda_id ) )
+ self.check_page_for_string( 'This will inspect the dataset and attempt' )
+ tc.fv( 'convert_data', 'target_type', target_type )
+ tc.submit( 'convert_data' )
+ self.check_page_for_string( 'The file conversion of Convert BED to GFF on data' )
+ self.home()
+ def change_datatype( self, hda_id, datatype ):
+ """Auto-detect history_dataset_association metadata"""
+ self.home()
+ self.visit_url( "%s/root/edit?id=%s" % ( self.url, hda_id ) )
+ self.check_page_for_string( 'This will change the datatype of the existing dataset but' )
+ tc.fv( 'change_datatype', 'datatype', datatype )
+ tc.submit( 'change' )
+ self.check_page_for_string( 'Edit Attributes' )
+ self.home()
def get_dataset_ids_in_history( self ):
"""Returns the ids of datasets in a history"""
data_list = self.get_history()
diff -r 373962edbe90 -r 1a24a530a3ae test/functional/test_DNAse_flanked_genes.py
--- a/test/functional/test_DNAse_flanked_genes.py Fri Jun 05 16:48:03 2009 -0400
+++ b/test/functional/test_DNAse_flanked_genes.py Mon Jun 08 10:31:59 2009 -0400
@@ -1,16 +1,16 @@
+import galaxy.model
+from galaxy.model.orm import *
from base.twilltestcase import TwillTestCase
""" A sample analysis"""
-
-
class AnalysisDNAseHSSFlankedGenes( TwillTestCase ):
-
def test_get_DNAseHSS_flanked_genes( self ):
self.login()
-
self.new_history()
-
+ global history1
+ history1 = galaxy.model.History.query() \
+ .order_by( desc( galaxy.model.History.table.c.create_time ) ).first()
track_params = dict(
db="hg17",
hgta_group="regulation",
@@ -24,14 +24,21 @@
output_params = dict(
fbQual="whole",
)
-
+ # Test 1
self.run_ucsc_main( track_params, output_params )
self.wait()
self.verify_dataset_correctness('DNAseHSS.dat')
-
- self.edit_metadata( name="DNAse HS" )
+ latest_hda = galaxy.model.HistoryDatasetAssociation.query() \
+ .order_by( desc( galaxy.model.HistoryDatasetAssociation.table.c.create_time ) ).first()
+ # Due to twill not being able to handle the permissions forms, we'll eliminate
+ # DefaultHistoryPermissions prior to uploading a dataset so that the permission
+ # form will not be displayed on ted edit attributes page.
+ for dp in latest_hda.dataset.actions:
+ dp.delete()
+ dp.flush()
+ latest_hda.dataset.refresh()
+ self.edit_hda_attribute_info( str( latest_hda.id ), new_name="DNAse HS" )
self.check_metadata_for_string( "DNAse HS" )
-
track_params = dict(
db="hg17",
hgta_group="genes",
@@ -45,35 +52,38 @@
output_params = dict(
fbQual="whole",
)
-
+ # Test 2
self.run_ucsc_main( track_params, output_params )
self.wait()
self.verify_dataset_correctness('hg17chr22KnownGenes.dat')
-
- self.edit_metadata( name="Genes" )
+ latest_hda = galaxy.model.HistoryDatasetAssociation.query() \
+ .order_by( desc( galaxy.model.HistoryDatasetAssociation.table.c.create_time ) ).first()
+ for dp in latest_hda.dataset.actions:
+ dp.delete()
+ dp.flush()
+ latest_hda.dataset.refresh()
+ self.edit_hda_attribute_info( str( latest_hda.id ), new_name="Genes" )
self.check_metadata_for_string( "Genes" )
-
-
+ # Test 3
self.run_tool( 'get_flanks1', input="2", region="whole", direction="Upstream", offset="0", size="500" )
self.wait()
self.verify_dataset_correctness( 'knownGeneUpstream500Flanks.dat' )
-
- self.edit_metadata( name="Flanks" )
+ latest_hda = galaxy.model.HistoryDatasetAssociation.query() \
+ .order_by( desc( galaxy.model.HistoryDatasetAssociation.table.c.create_time ) ).first()
+ for dp in latest_hda.dataset.actions:
+ dp.delete()
+ dp.flush()
+ latest_hda.dataset.refresh()
+ self.edit_hda_attribute_info( str( latest_hda.id ), new_name="Flanks" )
self.check_metadata_for_string( "Flanks" )
-
-
+ # Test 4
self.run_tool( 'gops_join_1', input1="3", input2="1", min="1", fill="none" )
self.wait()
- #self.verify_dataset_correctness( 'joinFlanksDNAse.dat' ) #we cannot verify this dataset, because this tool spits out data in a non-deterministic order
-
-
+ # We cannot verify this dataset, because this tool spits out data in a non-deterministic order
+ #self.verify_dataset_correctness( 'joinFlanksDNAse.dat' )
+ # Test 5
self.run_tool( 'Filter1', input="4", cond="c17==1000" )
self.wait()
self.verify_dataset_correctness( 'filteredJoinedFlanksDNAse.dat' )
-
-
self.delete_history()
self.logout()
-
-
-
diff -r 373962edbe90 -r 1a24a530a3ae test/functional/test_metadata_editing.py
--- a/test/functional/test_metadata_editing.py Fri Jun 05 16:48:03 2009 -0400
+++ b/test/functional/test_metadata_editing.py Mon Jun 08 10:31:59 2009 -0400
@@ -1,27 +1,45 @@
+import galaxy.model
+from galaxy.model.orm import *
from base.twilltestcase import TwillTestCase
class TestMetadataEdit( TwillTestCase ):
- def test_00_metadata_edit(self):
+ def test_00_metadata_edit( self ):
"""test_metadata_edit: Testing metadata editing"""
- self.login()
- self.upload_file('1.bed')
- self.check_history_for_string('\? bed')
- self.check_metadata_for_string('1.bed uploaded file unspecified (\?) chromCol value="1" selected endCol value="3" is_strandCol value="true" checked', hid=1)
+ self.logout()
+ self.login( email='test(a)bx.psu.edu' )
+ self.new_history( name='Test Metadata Edit' )
+ global history1
+ history1 = galaxy.model.History.query() \
+ .order_by( desc( galaxy.model.History.table.c.create_time ) ).first()
+ self.upload_file( '1.bed' )
+ latest_hda = galaxy.model.HistoryDatasetAssociation.query() \
+ .order_by( desc( galaxy.model.HistoryDatasetAssociation.table.c.create_time ) ).first()
+ self.home()
+ # Due to twill not being able to handle the permissions forms, we'll eliminate
+ # DefaultHistoryPermissions prior to uploading a dataset so that the permission
+ # form will not be displayed on ted edit attributes page.
+ for dp in latest_hda.dataset.actions:
+ dp.delete()
+ dp.flush()
+ latest_hda.dataset.refresh()
+ self.check_history_for_string( '1.bed' )
+ self.check_metadata_for_string( '1.bed uploaded file unspecified (\?) chromCol value="1" selected endCol value="3" is_strandCol value="true" checked', hid=1 )
"""test editing attributes"""
- self.edit_metadata(hid=1, form_no=0, name='Testdata', info="Uploaded my file", dbkey='hg16', startCol='6')
- self.check_metadata_for_string('Testdata bed Uploaded my file hg16 "bed" selected="yes" "startCol" value="6" selected', hid=1)
+ self.edit_hda_attribute_info( hda_id=str( latest_hda.id ),
+ new_name='Testdata',
+ new_info="Uploaded my file",
+ new_dbkey='hg16',
+ new_startcol='6' )
+ self.check_metadata_for_string( 'Testdata bed Uploaded my file hg16 "bed" selected="yes" "startCol" value="6" selected', hid=1 )
"""test Auto-detecting attributes"""
- self.edit_metadata(hid=1, form_no=1)
- self.check_metadata_for_string('Testdata bed Uploaded my file hg16 "bed" selected="yes" "startCol" value="2" selected', hid=1)
+ self.auto_detect_metadata( hda_id=str( latest_hda.id ) )
+ self.check_metadata_for_string('Testdata bed Uploaded my file hg16 "bed" selected="yes" "startCol" value="2" selected', hid=1 )
"""test converting formats"""
- self.edit_metadata(hid=1, form_no=2, target_type='gff')
- self.check_history_for_string('hg16 Testdata Convert BED to GFF')
- self.check_metadata_for_string('"gff" selected="yes"', hid=1)
+ self.convert_format( hda_id=str( latest_hda.id ), target_type='gff' )
+ self.check_metadata_for_string( '"gff" selected="yes"', hid=1 )
"""test changing data type"""
- self.edit_metadata(hid=1, form_no=3, datatype='gff3')
- self.check_history_for_string('hg16 Testdata Convert BED to GFF format: gff3')
- self.delete_history_item( 1 )
- def test_9999_clean_up( self ):
- self.delete_history()
+ self.change_datatype( hda_id=str( latest_hda.id ), datatype='gff3' )
+ self.check_metadata_for_string( 'gff3', hid=1 )
+ self.delete_history( id=str( history1.id ) )
self.logout()
diff -r 373962edbe90 -r 1a24a530a3ae test/functional/test_security_and_libraries.py
--- a/test/functional/test_security_and_libraries.py Fri Jun 05 16:48:03 2009 -0400
+++ b/test/functional/test_security_and_libraries.py Mon Jun 08 10:31:59 2009 -0400
@@ -51,7 +51,7 @@
raise AssertionError( "Private role not found for user '%s'" % admin_user.email )
# Make sure DefaultUserPermissions are correct
if len( admin_user.default_permissions ) > 1:
- raise AssertionError( '%d DefaultUserPermissions were created for %s when their account was created ( should have been 1 )' \
+ raise AssertionError( '%d DefaultUserPermissions associated with user %s ( should be 1 )' \
% ( len( admin_user.default_permissions ), admin_user.email ) )
dup = galaxy.model.DefaultUserPermissions.filter( galaxy.model.DefaultUserPermissions.table.c.user_id==admin_user.id ).first()
if not dup.action == galaxy.model.Dataset.permitted_actions.DATASET_MANAGE_PERMISSIONS.action:
@@ -72,6 +72,8 @@
self.logout()
def test_010_login_as_regular_user1( self ):
"""Testing logging in as regular user test1(a)bx.psu.edu - tests private role creation, changing DefaultHistoryPermissions for new histories, and sharing histories with another user"""
+ # Some of the history related tests here are similar to some tests in the
+ # test_history_functions.py script, so we could potentially eliminate 1 or 2 of them.
self.login( email='test1(a)bx.psu.edu' ) # test1(a)bx.psu.edu is not an admin user
global regular_user1
regular_user1 = galaxy.model.User.filter( galaxy.model.User.table.c.email=='test1(a)bx.psu.edu' ).first()
@@ -93,7 +95,7 @@
latest_dataset = galaxy.model.Dataset.query().order_by( desc( galaxy.model.Dataset.table.c.create_time ) ).first()
# Make sure DatasetPermissions is correct - default is 'manage permissions'
if len( latest_dataset.actions ) > 1:
- raise AssertionError( '%d DatasetPermissionss were created for dataset id %d when it was created ( should have been 1 )' \
+ raise AssertionError( '%d DatasetPermissions were created for dataset id %d when it was created ( should have been 1 )' \
% ( len( latest_dataset.actions ), latest_dataset.id ) )
dp = galaxy.model.DatasetPermissions.filter( galaxy.model.DatasetPermissions.table.c.dataset_id==latest_dataset.id ).first()
if not dp.action == galaxy.model.Dataset.permitted_actions.DATASET_MANAGE_PERMISSIONS.action:
@@ -494,97 +496,100 @@
library_one.refresh()
self.rename_library( str( library_one.id ), library_one.name, name=name, description=description )
library_one.refresh()
- def test_075_library_template_features( self ):
- """Testing adding a template to a library, along with template features on the admin side"""
- actions = [ v.action for k, v in galaxy.model.Library.permitted_actions.items() ]
- actions.sort()
- # Add a new information template to the library
- template_name = 'Library Template 1'
- ele_name_0 = 'Foo'
- ele_name_1 = 'Doh'
- self.add_library_info_template( library_one.id, library_one.name, name=template_name, num_fields='2', ele_name_0=ele_name_0, ele_name_1=ele_name_1 )
- self.home()
- self.visit_url( '%s/admin/library?id=%s&information=True' % ( self.url, str( library_one.id ) ) )
- self.check_page_for_string( ele_name_0 )
- self.check_page_for_string( ele_name_1 )
- self.home()
- # Get the template for later testing
- global library_one_template
- library_one_template = galaxy.model.LibraryItemInfoTemplate.query().order_by( desc( galaxy.model.LibraryItemInfoTemplate.table.c.id ) ).first()
- assert library_one_template is not None, 'Problem retrieving LibraryItemInfoTemplate for library named "%s" from the database' % str( library_one.name )
- # Make sure the library permissions were inherited by the template
- template_permissions = galaxy.model.LibraryItemInfoTemplatePermissions \
- .query() \
- .filter( galaxy.model.LibraryItemInfoTemplatePermissions.table.c.library_item_info_template_id == library_one_template.id ) \
- .order_by( desc( galaxy.model.LibraryItemInfoTemplatePermissions.table.c.id ) ) \
- .limit( 3 ) \
- .all()
- template_permissions = [ litp_obj.action for litp_obj in template_permissions ]
- template_permissions.sort()
- assert actions == template_permissions, "Template permissions for template %s not correctly inherited from library %s" \
- % ( library_one_template.name, library_one.name )
- # Make sure that the library permissions were inherited by each of the template elements
- for library_item_info in library_one_template.library_item_infos:
- info_permissions = galaxy.model.LibraryItemInfoPermissions \
- .filter( galaxy.model.LibraryItemInfoPermissions.table.c.library_item_info_id == library_item_info.id ) \
+ """
+ ## TODO: temporarily eliminating templates until we have the new forms features done
+ def test_075_library_template_features( self ):
+ Testing adding a template to a library, along with template features on the admin side
+ actions = [ v.action for k, v in galaxy.model.Library.permitted_actions.items() ]
+ actions.sort()
+ # Add a new information template to the library
+ template_name = 'Library Template 1'
+ ele_name_0 = 'Foo'
+ ele_name_1 = 'Doh'
+ self.add_library_info_template( library_one.id, library_one.name, name=template_name, num_fields='2', ele_name_0=ele_name_0, ele_name_1=ele_name_1 )
+ self.home()
+ self.visit_url( '%s/admin/library?id=%s&information=True' % ( self.url, str( library_one.id ) ) )
+ self.check_page_for_string( ele_name_0 )
+ self.check_page_for_string( ele_name_1 )
+ self.home()
+ # Get the template for later testing
+ global library_one_template
+ library_one_template = galaxy.model.LibraryItemInfoTemplate.query().order_by( desc( galaxy.model.LibraryItemInfoTemplate.table.c.id ) ).first()
+ assert library_one_template is not None, 'Problem retrieving LibraryItemInfoTemplate for library named "%s" from the database' % str( library_one.name )
+ # Make sure the library permissions were inherited by the template
+ template_permissions = galaxy.model.LibraryItemInfoTemplatePermissions \
+ .query() \
+ .filter( galaxy.model.LibraryItemInfoTemplatePermissions.table.c.library_item_info_template_id == library_one_template.id ) \
+ .order_by( desc( galaxy.model.LibraryItemInfoTemplatePermissions.table.c.id ) ) \
+ .limit( 3 ) \
.all()
- info_permissions = [ liip_obj.action for liip_obj in info_permissions ]
- info_permissions.sort()
- assert actions == info_permissions, "Permissions for library_item_info id %s not correctly inherited from library %s" \
- % ( library_item_info.id, library_one.name )
- element_ids = []
- if library_one.library_info_associations:
- # We have a set of LibraryItemInfoElements
- last_library_item_info_element = galaxy.model.LibraryItemInfoElement.query() \
- .order_by( desc( galaxy.model.LibraryItemInfoElement.table.c.id ) ).first()
- if not last_library_item_info_element:
- element_ids.append( 0 )
- element_ids.append( 1 )
+ template_permissions = [ litp_obj.action for litp_obj in template_permissions ]
+ template_permissions.sort()
+ assert actions == template_permissions, "Template permissions for template %s not correctly inherited from library %s" \
+ % ( library_one_template.name, library_one.name )
+ # Make sure that the library permissions were inherited by each of the template elements
+ for library_item_info in library_one_template.library_item_infos:
+ info_permissions = galaxy.model.LibraryItemInfoPermissions \
+ .filter( galaxy.model.LibraryItemInfoPermissions.table.c.library_item_info_id == library_item_info.id ) \
+ .all()
+ info_permissions = [ liip_obj.action for liip_obj in info_permissions ]
+ info_permissions.sort()
+ assert actions == info_permissions, "Permissions for library_item_info id %s not correctly inherited from library %s" \
+ % ( library_item_info.id, library_one.name )
+ element_ids = []
+ if library_one.library_info_associations:
+ # We have a set of LibraryItemInfoElements
+ last_library_item_info_element = galaxy.model.LibraryItemInfoElement.query() \
+ .order_by( desc( galaxy.model.LibraryItemInfoElement.table.c.id ) ).first()
+ if not last_library_item_info_element:
+ element_ids.append( 0 )
+ element_ids.append( 1 )
+ else:
+ element_ids.append( last_library_item_info_element.id + 1 )
+ element_ids.append( last_library_item_info_element.id + 2 )
else:
- element_ids.append( last_library_item_info_element.id + 1 )
- element_ids.append( last_library_item_info_element.id + 2 )
- else:
- # We only have a set of LibraryItemInfoTemplateElements
- for ele in library_one_template.elements:
- element_ids.append( ele.id )
- element_ids.sort()
- # Add information to the library using the template
- ele_1_field_name = "info_element_%s_%s" % ( str( library_one_template.id ), str( element_ids[0] ) )
- ele_1_contents = 'hello'
- ele_2_field_name = "info_element_%s_%s" % ( str( library_one_template.id ), str( element_ids[1] ) )
- ele_2_contents = 'world'
- self.edit_library_info( str( library_one.id ), library_one.name,
- ele_1_field_name, ele_1_contents,
- ele_2_field_name, ele_2_contents )
- self.home()
- self.visit_url( '%s/admin/library?id=%s&information=True' % ( self.url, str( library_one.id ) ) )
- self.check_page_for_string( ele_1_contents )
- self.check_page_for_string( ele_2_contents )
- self.home()
- self.visit_url( '%s/admin/library?id=%s&information=True' % ( self.url, str( library_one.id ) ) )
- self.check_page_for_string( ele_1_contents )
- self.check_page_for_string( ele_2_contents )
- # Edit the template
- new_name = 'Library Template 1 renamed'
- new_ele_name_1_field = "element_name_%s" % element_ids[0]
- new_ele_name_1 = 'wind'
- new_ele_desc_1_field = "element_description_%s" % element_ids[0]
- ele_desc_1 = 'This is the wind component'
- new_ele_name_2_field = "element_name_%s" % element_ids[1]
- new_ele_name_2 = 'bag'
- new_ele_desc_2_field = "element_description_%s" % element_ids[1]
- ele_desc_2 = 'This is the bag component'
- self.edit_library_info_template( str( library_one.id ), library_one_template.id, new_name,
- new_ele_name_1_field, new_ele_name_1, new_ele_desc_1_field, ele_desc_1,
- new_ele_name_2_field, new_ele_name_2, new_ele_desc_2_field, ele_desc_2 )
- self.home()
- self.visit_url( '%s/admin/library?id=%s&information=True' % ( self.url, str( library_one.id ) ) )
- self.check_page_for_string( new_ele_name_1 )
- self.check_page_for_string( ele_desc_1 )
- self.check_page_for_string( ele_1_contents )
- self.check_page_for_string( new_ele_name_2 )
- self.check_page_for_string( ele_desc_2 )
- self.check_page_for_string( ele_2_contents )
+ # We only have a set of LibraryItemInfoTemplateElements
+ for ele in library_one_template.elements:
+ element_ids.append( ele.id )
+ element_ids.sort()
+ # Add information to the library using the template
+ ele_1_field_name = "info_element_%s_%s" % ( str( library_one_template.id ), str( element_ids[0] ) )
+ ele_1_contents = 'hello'
+ ele_2_field_name = "info_element_%s_%s" % ( str( library_one_template.id ), str( element_ids[1] ) )
+ ele_2_contents = 'world'
+ self.edit_library_info( str( library_one.id ), library_one.name,
+ ele_1_field_name, ele_1_contents,
+ ele_2_field_name, ele_2_contents )
+ self.home()
+ self.visit_url( '%s/admin/library?id=%s&information=True' % ( self.url, str( library_one.id ) ) )
+ self.check_page_for_string( ele_1_contents )
+ self.check_page_for_string( ele_2_contents )
+ self.home()
+ self.visit_url( '%s/admin/library?id=%s&information=True' % ( self.url, str( library_one.id ) ) )
+ self.check_page_for_string( ele_1_contents )
+ self.check_page_for_string( ele_2_contents )
+ # Edit the template
+ new_name = 'Library Template 1 renamed'
+ new_ele_name_1_field = "element_name_%s" % element_ids[0]
+ new_ele_name_1 = 'wind'
+ new_ele_desc_1_field = "element_description_%s" % element_ids[0]
+ ele_desc_1 = 'This is the wind component'
+ new_ele_name_2_field = "element_name_%s" % element_ids[1]
+ new_ele_name_2 = 'bag'
+ new_ele_desc_2_field = "element_description_%s" % element_ids[1]
+ ele_desc_2 = 'This is the bag component'
+ self.edit_library_info_template( str( library_one.id ), library_one_template.id, new_name,
+ new_ele_name_1_field, new_ele_name_1, new_ele_desc_1_field, ele_desc_1,
+ new_ele_name_2_field, new_ele_name_2, new_ele_desc_2_field, ele_desc_2 )
+ self.home()
+ self.visit_url( '%s/admin/library?id=%s&information=True' % ( self.url, str( library_one.id ) ) )
+ self.check_page_for_string( new_ele_name_1 )
+ self.check_page_for_string( ele_desc_1 )
+ self.check_page_for_string( ele_1_contents )
+ self.check_page_for_string( new_ele_name_2 )
+ self.check_page_for_string( ele_desc_2 )
+ self.check_page_for_string( ele_2_contents )
+ """
def test_080_add_public_dataset_to_root_folder( self ):
"""Testing adding a public dataset to the root folder"""
actions = [ v.action for k, v in galaxy.model.Library.permitted_actions.items() ]
@@ -623,7 +628,9 @@
if not dp.action == galaxy.model.Dataset.permitted_actions.DATASET_MANAGE_PERMISSIONS.action:
raise AssertionError( 'The DatasetPermissions.action for dataset id %d is "%s", but it should be "manage permissions"' \
% ( ldda_one.dataset.id, dp.action ) )
+ ## TODO: temporarily eliminating templates until we have the new forms features done
# Make sure the library template was inherited by the ldda
+ """
self.home()
self.visit_url( "%s/admin/library_dataset_dataset_association?edit_info=True&library_id=%s&folder_id=%s&id=%s" % \
( self.url, str( library_one.id ), str( library_one.root_folder.id ), str( ldda_one.id ) ) )
@@ -631,6 +638,7 @@
self.check_page_for_string( 'This is the wind component' )
self.check_page_for_string( 'bag' )
self.check_page_for_string( 'This is the bag component' )
+ """
# Make sure other users can access the dataset from the Libraries view
self.logout()
self.login( email=regular_user2.email )
@@ -640,20 +648,23 @@
self.logout()
self.login( email=admin_user.email )
self.home()
- def test_085_editing_dataset_information( self ):
- """Testing editing dataset template element information"""
- # Need the current library_item_info_element.id
- last_library_item_info_element = galaxy.model.LibraryItemInfoElement.query() \
- .order_by( desc( galaxy.model.LibraryItemInfoElement.table.c.id ) ).first()
- global ldda_one_ele_2_field_name
- ldda_one_ele_2_field_name = "info_element_%s" % str( last_library_item_info_element.id )
- ele_2_contents = 'pipe'
- global ldda_one_ele_1_field_name
- ldda_one_ele_1_field_name = "info_element_%s" % ( str( last_library_item_info_element.id - 1 ) )
- ele_1_contents = 'blown'
- self.edit_ldda_template_element_info( str( library_one.id ), str( library_one.root_folder.id ), str( ldda_one.id ),
- ldda_one.name, ldda_one_ele_1_field_name, ele_1_contents, ldda_one_ele_2_field_name, ele_2_contents )
- self.home()
+ """
+ ## TODO: temporarily eliminating templates until we have the new forms features done
+ def test_085_editing_dataset_information( self ):
+ Testing editing dataset template element information
+ # Need the current library_item_info_element.id
+ last_library_item_info_element = galaxy.model.LibraryItemInfoElement.query() \
+ .order_by( desc( galaxy.model.LibraryItemInfoElement.table.c.id ) ).first()
+ global ldda_one_ele_2_field_name
+ ldda_one_ele_2_field_name = "info_element_%s" % str( last_library_item_info_element.id )
+ ele_2_contents = 'pipe'
+ global ldda_one_ele_1_field_name
+ ldda_one_ele_1_field_name = "info_element_%s" % ( str( last_library_item_info_element.id - 1 ) )
+ ele_1_contents = 'blown'
+ self.edit_ldda_template_element_info( str( library_one.id ), str( library_one.root_folder.id ), str( ldda_one.id ),
+ ldda_one.name, ldda_one_ele_1_field_name, ele_1_contents, ldda_one_ele_2_field_name, ele_2_contents )
+ self.home()
+ """
def test_090_add_new_folder_to_root_folder( self ):
"""Testing adding a folder to a library root folder"""
root_folder = library_one.root_folder
@@ -669,35 +680,41 @@
self.visit_url( '%s/admin/browse_library?id=%s' % ( self.url, str( library_one.id ) ) )
self.check_page_for_string( name )
self.check_page_for_string( description )
+ ## TODO: temporarily eliminating templates until we have the new forms features done
# Make sure the library template is inherited
+ """
self.home()
self.visit_url( '%s/admin/folder?id=%s&library_id=%s&information=True' % ( self.url, str( folder_one.id ), str( library_one.id ) ) )
self.check_page_for_string( 'wind' )
self.check_page_for_string( 'This is the wind component' )
self.check_page_for_string( 'bag' )
self.check_page_for_string( 'This is the bag component' )
+ """
self.home()
- def test_095_add_folder_template( self ):
- """Testing adding a new folder template to a folder"""
- # Add a new information template to the folder
- template_name = 'Folder Template 1'
- ele_name_0 = 'Fu'
- ele_help_0 = 'This is the Fu component'.replace( ' ', '+' )
- ele_name_1 = 'Bar'
- ele_help_1 = 'This is the Bar component'.replace( ' ', '+' )
- self.home()
- self.add_folder_info_template( str( library_one.id ), library_one.name, str( folder_one.id ), folder_one.name,
- name=template_name, num_fields='2', ele_name_0=ele_name_0, ele_help_0=ele_help_0,
- ele_name_1=ele_name_1, ele_help_1=ele_help_1 )
- self.home()
- self.visit_url( '%s/admin/folder?id=%s&library_id=%s&information=True' % ( self.url, str( folder_one.id ), str( library_one.id ) ) )
- self.check_page_for_string( ele_name_0 )
- check_str = ele_help_0.replace( '+', ' ' )
- self.check_page_for_string( check_str )
- self.check_page_for_string( ele_name_1 )
- check_str = ele_help_1.replace( '+', ' ' )
- self.check_page_for_string( check_str )
- self.home()
+ """
+ ## TODO: temporarily eliminating templates until we have the new forms features done
+ def test_095_add_folder_template( self ):
+ Testing adding a new folder template to a folder
+ # Add a new information template to the folder
+ template_name = 'Folder Template 1'
+ ele_name_0 = 'Fu'
+ ele_help_0 = 'This is the Fu component'.replace( ' ', '+' )
+ ele_name_1 = 'Bar'
+ ele_help_1 = 'This is the Bar component'.replace( ' ', '+' )
+ self.home()
+ self.add_folder_info_template( str( library_one.id ), library_one.name, str( folder_one.id ), folder_one.name,
+ name=template_name, num_fields='2', ele_name_0=ele_name_0, ele_help_0=ele_help_0,
+ ele_name_1=ele_name_1, ele_help_1=ele_help_1 )
+ self.home()
+ self.visit_url( '%s/admin/folder?id=%s&library_id=%s&information=True' % ( self.url, str( folder_one.id ), str( library_one.id ) ) )
+ self.check_page_for_string( ele_name_0 )
+ check_str = ele_help_0.replace( '+', ' ' )
+ self.check_page_for_string( check_str )
+ self.check_page_for_string( ele_name_1 )
+ check_str = ele_help_1.replace( '+', ' ' )
+ self.check_page_for_string( check_str )
+ self.home()
+ """
def test_100_add_subfolder_to_folder( self ):
"""Testing adding a folder to a library folder"""
name = "Folder One's Subfolder"
@@ -712,8 +729,10 @@
self.visit_url( '%s/admin/browse_library?id=%s' % ( self.url, str( library_one.id ) ) )
self.check_page_for_string( name )
self.check_page_for_string( description )
+ ## TODO: temporarily eliminating templates until we have the new forms features done
# Make sure the parent folder's template is inherited
self.home()
+ """
self.visit_url( '%s/admin/folder?id=%s&library_id=%s&information=True' % ( self.url, str( folder_one.id ), str( library_one.id ) ) )
self.check_page_for_string( 'Fu' )
self.check_page_for_string( 'This is the Fu component' )
@@ -726,81 +745,84 @@
except:
pass
self.home()
- def test_105_add_template_element( self ):
- """Testing adding a new element to an existing library template"""
- library_one_template.refresh()
- element_ids = []
- for ele in library_one_template.elements:
- element_ids.append( ele.id )
- element_ids.sort()
-
- name = 'Library Template 1 renamed'
- ele_field_name_1 = "element_name_%s" % element_ids[0]
- ele_name_1 = 'wind'
- ele_field_desc_1 = "element_description_%s" % element_ids[0]
- ele_desc_1 = 'This is the wind component'
- ele_field_name_2 = "element_name_%s" % element_ids[1]
- ele_name_2 = 'bag'
- ele_field_desc_2 = "element_description_%s" % element_ids[1]
- ele_desc_2 = 'This is the bag component'
- new_ele_name = 'Fubar'
- new_ele_desc = 'This is the Fubar component'
-
- self.add_library_info_template_element( str( library_one.id ),
- str( library_one_template.id ),
- library_one_template.name,
- ele_field_name_1,
- ele_name_1,
- ele_field_desc_1,
- ele_desc_1,
- ele_field_name_2,
- ele_name_2,
- ele_field_desc_2,
- ele_desc_2,
- new_ele_name=new_ele_name,
- new_ele_desc=new_ele_desc )
- # Make sure the new template element shows up on the existing library info page
- self.home()
- self.visit_url( '%s/admin/library?id=%s&information=True' % ( self.url, str( library_one.id ) ) )
- self.check_page_for_string( library_one.name )
- self.check_page_for_string( library_one.description )
- self.check_page_for_string( 'wind' )
- self.check_page_for_string( 'hello' )
- self.check_page_for_string( 'This is the wind component' )
- self.check_page_for_string( 'bag' )
- self.check_page_for_string( 'world' )
- self.check_page_for_string( 'This is the bag component' )
- self.check_page_for_string( 'Fubar' )
- self.check_page_for_string( 'This is the Fubar component' )
- # Make sure the new template element does not show up on existing info pages for folder_one since it has its own template
- self.home()
- self.visit_url( '%s/admin/folder?id=%s&library_id=%s&information=True' % ( self.url, str( folder_one.id ), str( library_one.id ) ) )
- self.check_page_for_string( 'Fu' )
- self.check_page_for_string( 'This is the Fu component' )
- self.check_page_for_string( 'Bar' )
- self.check_page_for_string( 'This is the Bar component' )
- try:
+ """
+ ## TODO: temporarily eliminating templates until we have the new forms features done
+ """
+ def test_105_add_template_element( self ):
+ Testing adding a new element to an existing library template
+ library_one_template.refresh()
+ element_ids = []
+ for ele in library_one_template.elements:
+ element_ids.append( ele.id )
+ element_ids.sort()
+
+ name = 'Library Template 1 renamed'
+ ele_field_name_1 = "element_name_%s" % element_ids[0]
+ ele_name_1 = 'wind'
+ ele_field_desc_1 = "element_description_%s" % element_ids[0]
+ ele_desc_1 = 'This is the wind component'
+ ele_field_name_2 = "element_name_%s" % element_ids[1]
+ ele_name_2 = 'bag'
+ ele_field_desc_2 = "element_description_%s" % element_ids[1]
+ ele_desc_2 = 'This is the bag component'
+ new_ele_name = 'Fubar'
+ new_ele_desc = 'This is the Fubar component'
+ self.add_library_info_template_element( str( library_one.id ),
+ str( library_one_template.id ),
+ library_one_template.name,
+ ele_field_name_1,
+ ele_name_1,
+ ele_field_desc_1,
+ ele_desc_1,
+ ele_field_name_2,
+ ele_name_2,
+ ele_field_desc_2,
+ ele_desc_2,
+ new_ele_name=new_ele_name,
+ new_ele_desc=new_ele_desc )
+ # Make sure the new template element shows up on the existing library info page
+ self.home()
+ self.visit_url( '%s/admin/library?id=%s&information=True' % ( self.url, str( library_one.id ) ) )
+ self.check_page_for_string( library_one.name )
+ self.check_page_for_string( library_one.description )
+ self.check_page_for_string( 'wind' )
+ self.check_page_for_string( 'hello' )
+ self.check_page_for_string( 'This is the wind component' )
+ self.check_page_for_string( 'bag' )
+ self.check_page_for_string( 'world' )
+ self.check_page_for_string( 'This is the bag component' )
self.check_page_for_string( 'Fubar' )
- raise AssertionError( 'Changed library template inherited by folder "%s" when folder had an associated template of its own' )
- except:
- pass
- # Make sure the new template element shows up on existing info pages for ldda_one since it is contained in the root folder
- self.home()
- self.visit_url( "%s/admin/library_dataset_dataset_association?edit_info=True&library_id=%s&folder_id=%s&id=%s" % \
- ( self.url, str( library_one.id ), str( folder_one.id ), str( ldda_one.id ) ) )
- # Visiting the above page will have resulted in the creation of a new LibraryItemInfoElement, so we'll retrieve it
- # for later use
- last_library_item_info_element = galaxy.model.LibraryItemInfoElement.query() \
- .order_by( desc( galaxy.model.LibraryItemInfoElement.table.c.id ) ).first()
- global ldda_one_ele_3_field_name
- ldda_one_ele_3_field_name = "info_element_%s" % str( last_library_item_info_element.id )
- self.check_page_for_string( 'wind' )
- self.check_page_for_string( 'This is the wind component' )
- self.check_page_for_string( 'bag' )
- self.check_page_for_string( 'This is the bag component' )
- self.check_page_for_string( 'Fubar' )
- self.check_page_for_string( 'This is the Fubar component' )
- self.home()
+ self.check_page_for_string( 'This is the Fubar component' )
+ # Make sure the new template element does not show up on existing info pages for folder_one since it has its own template
+ self.home()
+ self.visit_url( '%s/admin/folder?id=%s&library_id=%s&information=True' % ( self.url, str( folder_one.id ), str( library_one.id ) ) )
+ self.check_page_for_string( 'Fu' )
+ self.check_page_for_string( 'This is the Fu component' )
+ self.check_page_for_string( 'Bar' )
+ self.check_page_for_string( 'This is the Bar component' )
+ try:
+ self.check_page_for_string( 'Fubar' )
+ raise AssertionError( 'Changed library template inherited by folder "%s" when folder had an associated template of its own' )
+ except:
+ pass
+ # Make sure the new template element shows up on existing info pages for ldda_one since it is contained in the root folder
+ self.home()
+ self.visit_url( "%s/admin/library_dataset_dataset_association?edit_info=True&library_id=%s&folder_id=%s&id=%s" % \
+ ( self.url, str( library_one.id ), str( folder_one.id ), str( ldda_one.id ) ) )
+ # Visiting the above page will have resulted in the creation of a new LibraryItemInfoElement, so we'll retrieve it
+ # for later use
+ last_library_item_info_element = galaxy.model.LibraryItemInfoElement.query() \
+ .order_by( desc( galaxy.model.LibraryItemInfoElement.table.c.id ) ).first()
+ global ldda_one_ele_3_field_name
+ ldda_one_ele_3_field_name = "info_element_%s" % str( last_library_item_info_element.id )
+ self.check_page_for_string( 'wind' )
+ self.check_page_for_string( 'This is the wind component' )
+ self.check_page_for_string( 'bag' )
+ self.check_page_for_string( 'This is the bag component' )
+ self.check_page_for_string( 'Fubar' )
+ self.check_page_for_string( 'This is the Fubar component' )
+ self.home()
+ """
def test_110_add_2nd_new_folder_to_root_folder( self ):
"""Testing adding a 2nd folder to a library root folder"""
root_folder = library_one.root_folder
@@ -816,7 +838,9 @@
self.visit_url( '%s/admin/browse_library?id=%s' % ( self.url, str( library_one.id ) ) )
self.check_page_for_string( name )
self.check_page_for_string( description )
+ ## TODO: temporarily eliminating templates until we have the new forms features done
# Make sure the changed library template is inherited to the new folder
+ """
self.home()
self.visit_url( '%s/admin/folder?id=%s&library_id=%s&information=True' % ( self.url, str( folder_two.id ), str( library_one.id ) ) )
self.check_page_for_string( 'wind' )
@@ -825,6 +849,7 @@
self.check_page_for_string( 'This is the bag component' )
self.check_page_for_string( 'Fubar' )
self.check_page_for_string( 'This is the Fubar component' )
+ """
self.home()
def test_115_add_public_dataset_to_root_folders_2nd_subfolder( self ):
"""Testing adding a public dataset to the root folder's 2nd sub-folder"""
@@ -848,56 +873,59 @@
self.check_page_for_string( "2.bed" )
self.check_page_for_string( message )
self.check_page_for_string( admin_user.email )
- def test_120_add_template_to_root_folders_2nd_subfolder( self ):
- """Testing adding a template to the root folder's 2nd sub-folder"""
- # Before adding the folder template, the inherited library template should be displayed
- self.home()
- self.visit_url( "%s/admin/library_dataset_dataset_association?edit_info=True&library_id=%s&folder_id=%s&id=%s" % \
- ( self.url, str( library_one.id ), str( folder_two.id ), str( ldda_two.id ) ) )
- self.check_page_for_string( 'wind' )
- self.check_page_for_string( 'This is the wind component' )
- self.check_page_for_string( 'bag' )
- self.check_page_for_string( 'This is the bag component' )
- self.check_page_for_string( 'Fubar' )
- self.check_page_for_string( 'This is the Fubar component' )
- self.home()
- # Add a new folde template
- template_name = 'Folder 2 Template'
- ele_name_0 = 'kill'
- ele_help_0 = 'This is the kill component'.replace( ' ', '+' )
- ele_name_1 = 'bill'
- ele_help_1 = 'This is the bill component'.replace( ' ', '+' )
- self.home()
- self.add_folder_info_template( str( library_one.id ), library_one.name, str( folder_two.id ), folder_two.name,
- name=template_name, num_fields='2', ele_name_0=ele_name_0, ele_help_0=ele_help_0,
- ele_name_1=ele_name_1, ele_help_1=ele_help_1 )
- # Make sure the new template id displayed on the folder information page
- self.home()
- self.visit_url( '%s/admin/folder?id=%s&library_id=%s&information=True' % ( self.url, str( folder_two.id ), str( library_one.id ) ) )
- self.check_page_for_string( ele_name_0 )
- check_str = ele_help_0.replace( '+', ' ' )
- self.check_page_for_string( check_str )
- self.check_page_for_string( ele_name_1 )
- check_str = ele_help_1.replace( '+', ' ' )
- self.check_page_for_string( check_str )
- # The library dataset ldda_two had previously inherited the library template prior to the new folder template
- # being introduced, so the library template should still be displayed on the ldda information page
- self.home()
- self.visit_url( "%s/admin/library_dataset_dataset_association?edit_info=True&library_id=%s&folder_id=%s&id=%s" % \
- ( self.url, str( library_one.id ), str( folder_two.id ), str( ldda_two.id ) ) )
- self.check_page_for_string( 'wind' )
- self.check_page_for_string( 'This is the wind component' )
- self.check_page_for_string( 'bag' )
- self.check_page_for_string( 'This is the bag component' )
- self.check_page_for_string( 'Fubar' )
- self.check_page_for_string( 'This is the Fubar component' )
- # Make sure the new folder template is not displayed
- try:
- self.check_page_for_string( 'kill' )
- raise AssertionError( 'New folder template elements incorrectly included in information page for ldda "%s"' % ldda_two.name )
- except:
- pass
- self.home()
+ ## TODO: temporarily eliminating templates until we have the new forms features done
+ """
+ def test_120_add_template_to_root_folders_2nd_subfolder( self ):
+ Testing adding a template to the root folder's 2nd sub-folder
+ # Before adding the folder template, the inherited library template should be displayed
+ self.home()
+ self.visit_url( "%s/admin/library_dataset_dataset_association?edit_info=True&library_id=%s&folder_id=%s&id=%s" % \
+ ( self.url, str( library_one.id ), str( folder_two.id ), str( ldda_two.id ) ) )
+ self.check_page_for_string( 'wind' )
+ self.check_page_for_string( 'This is the wind component' )
+ self.check_page_for_string( 'bag' )
+ self.check_page_for_string( 'This is the bag component' )
+ self.check_page_for_string( 'Fubar' )
+ self.check_page_for_string( 'This is the Fubar component' )
+ self.home()
+ # Add a new folde template
+ template_name = 'Folder 2 Template'
+ ele_name_0 = 'kill'
+ ele_help_0 = 'This is the kill component'.replace( ' ', '+' )
+ ele_name_1 = 'bill'
+ ele_help_1 = 'This is the bill component'.replace( ' ', '+' )
+ self.home()
+ self.add_folder_info_template( str( library_one.id ), library_one.name, str( folder_two.id ), folder_two.name,
+ name=template_name, num_fields='2', ele_name_0=ele_name_0, ele_help_0=ele_help_0,
+ ele_name_1=ele_name_1, ele_help_1=ele_help_1 )
+ # Make sure the new template id displayed on the folder information page
+ self.home()
+ self.visit_url( '%s/admin/folder?id=%s&library_id=%s&information=True' % ( self.url, str( folder_two.id ), str( library_one.id ) ) )
+ self.check_page_for_string( ele_name_0 )
+ check_str = ele_help_0.replace( '+', ' ' )
+ self.check_page_for_string( check_str )
+ self.check_page_for_string( ele_name_1 )
+ check_str = ele_help_1.replace( '+', ' ' )
+ self.check_page_for_string( check_str )
+ # The library dataset ldda_two had previously inherited the library template prior to the new folder template
+ # being introduced, so the library template should still be displayed on the ldda information page
+ self.home()
+ self.visit_url( "%s/admin/library_dataset_dataset_association?edit_info=True&library_id=%s&folder_id=%s&id=%s" % \
+ ( self.url, str( library_one.id ), str( folder_two.id ), str( ldda_two.id ) ) )
+ self.check_page_for_string( 'wind' )
+ self.check_page_for_string( 'This is the wind component' )
+ self.check_page_for_string( 'bag' )
+ self.check_page_for_string( 'This is the bag component' )
+ self.check_page_for_string( 'Fubar' )
+ self.check_page_for_string( 'This is the Fubar component' )
+ # Make sure the new folder template is not displayed
+ try:
+ self.check_page_for_string( 'kill' )
+ raise AssertionError( 'New folder template elements incorrectly included in information page for ldda "%s"' % ldda_two.name )
+ except:
+ pass
+ self.home()
+ """
def test_125_add_2nd_public_dataset_to_root_folders_2nd_subfolder( self ):
"""Testing adding a 2nd public dataset to the root folder's 2nd sub-folder"""
actions = [ v.action for k, v in galaxy.model.Library.permitted_actions.items() ]
@@ -920,22 +948,25 @@
self.check_page_for_string( "3.bed" )
self.check_page_for_string( message )
self.check_page_for_string( admin_user.email )
- def test_130_editing_dataset_information_with_new_folder_template( self ):
- """Testing editing dataset template element information with new inherited folder template"""
- # Need the current library_item_info_element.id
- last_library_item_info_element = galaxy.model.LibraryItemInfoElement.query() \
- .order_by( desc( galaxy.model.LibraryItemInfoElement.table.c.id ) ).first()
- # Make sure the changed inherited template is included in the ldda information
- ele_2_field_name = "info_element_%s" % str( last_library_item_info_element.id )
- ele_2_contents = 'II'
- ele_2_help = 'This is the bill component'
- ele_1_field_name = "info_element_%s" % ( str( last_library_item_info_element.id - 1 ) )
- ele_1_contents = 'Volume'
- ele_1_help = 'This is the kill component'
- self.edit_ldda_template_element_info( str( library_one.id ), str( folder_two.id ), str( ldda_three.id ),
- ldda_three.name, ele_1_field_name, ele_1_contents, ele_2_field_name, ele_2_contents,
- ele_1_help=ele_1_help, ele_2_help=ele_2_help )
- self.home()
+ ## TODO: temporarily eliminating templates until we have the new forms features done
+ """
+ def test_130_editing_dataset_information_with_new_folder_template( self ):
+ Testing editing dataset template element information with new inherited folder template
+ # Need the current library_item_info_element.id
+ last_library_item_info_element = galaxy.model.LibraryItemInfoElement.query() \
+ .order_by( desc( galaxy.model.LibraryItemInfoElement.table.c.id ) ).first()
+ # Make sure the changed inherited template is included in the ldda information
+ ele_2_field_name = "info_element_%s" % str( last_library_item_info_element.id )
+ ele_2_contents = 'II'
+ ele_2_help = 'This is the bill component'
+ ele_1_field_name = "info_element_%s" % ( str( last_library_item_info_element.id - 1 ) )
+ ele_1_contents = 'Volume'
+ ele_1_help = 'This is the kill component'
+ self.edit_ldda_template_element_info( str( library_one.id ), str( folder_two.id ), str( ldda_three.id ),
+ ldda_three.name, ele_1_field_name, ele_1_contents, ele_2_field_name, ele_2_contents,
+ ele_1_help=ele_1_help, ele_2_help=ele_2_help )
+ self.home()
+ """
def test_135_add_dataset_with_private_role_restriction_to_folder( self ):
"""Testing adding a dataset with a private role restriction to a folder"""
# Add a dataset restricted by the following:
@@ -954,6 +985,8 @@
message ='This is a test of the fourth dataset uploaded'
ele_name_0 = 'Fu'
ele_name_1 = 'Bar'
+ ## TODO: temporarily eliminating templates until we have the new forms features done
+ """
self.add_library_dataset( '4.bed',
str( library_one.id ),
str( folder_one.id ),
@@ -965,6 +998,16 @@
root=False,
check_template_str1=ele_name_0,
check_template_str2=ele_name_1 )
+ """
+ self.add_library_dataset( '4.bed',
+ str( library_one.id ),
+ str( folder_one.id ),
+ folder_one.name,
+ file_format='bed',
+ dbkey='hg18',
+ roles=[ str( regular_user1_private_role.id ) ],
+ message=message.replace( ' ', '+' ),
+ root=False )
global ldda_four
ldda_four = galaxy.model.LibraryDatasetDatasetAssociation.query() \
.order_by( desc( galaxy.model.LibraryDatasetDatasetAssociation.table.c.create_time ) ).first()
@@ -1047,27 +1090,30 @@
self.visit_url( '%s/library/browse_library?id=%s' % ( self.url, str( library_one.id ) ) )
self.check_page_for_string( ldda_four.name )
self.home()
- def test_150_editing_restricted_datasets_information( self ):
- """Testing editing a restricted library dataset's template element information"""
- ele_1_contents = ''
- ele_2_contents = ''
- ele_3_contents = 'Adding Fubar text'
- self.edit_ldda_template_element_info( str( library_one.id ), str( library_one.root_folder.id ), str( ldda_one.id ),
- ldda_one.name, ldda_one_ele_1_field_name, ele_1_contents, ldda_one_ele_2_field_name, ele_2_contents,
- ele_1_help='This is the wind component'.replace( ' ', '+' ),
- ele_2_help='This is the bag component'.replace( ' ', '+' ),
- ele_3_field_name=ldda_one_ele_3_field_name, ele_3_contents=ele_3_contents.replace( ' ', '+' ) )
- # Check the updated information from the libraries view
- self.home()
- self.visit_url( '%s/library/library_dataset_dataset_association?info=True&library_id=%s&folder_id=%s&id=%s' \
- % ( self.url, str( library_one.id ), str( library_one.root_folder.id ), str( ldda_one.id ) ) )
- self.check_page_for_string( ele_3_contents )
- try:
- self.check_page_for_string( 'blown' )
- raise AssertionError( 'Element contents were not correctly eliminated when the information was edited for ldda %s' % ldda_one.name)
- except:
- pass
- self.home()
+ ## TODO: temporarily eliminating templates until we have the new forms features done
+ """
+ def test_150_editing_restricted_datasets_information( self ):
+ Testing editing a restricted library dataset's template element information
+ ele_1_contents = ''
+ ele_2_contents = ''
+ ele_3_contents = 'Adding Fubar text'
+ self.edit_ldda_template_element_info( str( library_one.id ), str( library_one.root_folder.id ), str( ldda_one.id ),
+ ldda_one.name, ldda_one_ele_1_field_name, ele_1_contents, ldda_one_ele_2_field_name, ele_2_contents,
+ ele_1_help='This is the wind component'.replace( ' ', '+' ),
+ ele_2_help='This is the bag component'.replace( ' ', '+' ),
+ ele_3_field_name=ldda_one_ele_3_field_name, ele_3_contents=ele_3_contents.replace( ' ', '+' ) )
+ # Check the updated information from the libraries view
+ self.home()
+ self.visit_url( '%s/library/library_dataset_dataset_association?info=True&library_id=%s&folder_id=%s&id=%s' \
+ % ( self.url, str( library_one.id ), str( library_one.root_folder.id ), str( ldda_one.id ) ) )
+ self.check_page_for_string( ele_3_contents )
+ try:
+ self.check_page_for_string( 'blown' )
+ raise AssertionError( 'Element contents were not correctly eliminated when the information was edited for ldda %s' % ldda_one.name)
+ except:
+ pass
+ self.home()
+ """
def test_155_add_dataset_with_role_associated_with_group_and_users( self ):
"""Testing adding a dataset with a role that is associated with a group and users"""
self.login( email='test(a)bx.psu.edu' )
@@ -1077,6 +1123,8 @@
message = 'Testing adding a dataset with a role that is associated with a group and users'
ele_name_0 = 'Fu'
ele_name_1 = 'Bar'
+ ## TODO: temporarily eliminating templates until we have the new forms features done
+ """
self.add_library_dataset( '5.bed',
str( library_one.id ),
str( folder_one.id ),
@@ -1088,6 +1136,16 @@
root=False,
check_template_str1=ele_name_0,
check_template_str2=ele_name_1 )
+ """
+ self.add_library_dataset( '5.bed',
+ str( library_one.id ),
+ str( folder_one.id ),
+ folder_one.name,
+ file_format='bed',
+ dbkey='hg17',
+ roles=[ str( role_two.id ) ],
+ message=message.replace( ' ', '+' ),
+ root=False )
global ldda_five
ldda_five = galaxy.model.LibraryDatasetDatasetAssociation.query() \
.order_by( desc( galaxy.model.LibraryDatasetDatasetAssociation.table.c.create_time ) ).first()
@@ -1194,13 +1252,16 @@
.order_by( desc( galaxy.model.LibraryDatasetDatasetAssociation.table.c.create_time ) ).first()
assert ldda_six is not None, 'Problem retrieving LibraryDatasetDatasetAssociation ldda_six from the database'
# Make sure the correct template was inherited
+ ## TODO: temporarily eliminating templates until we have the new forms features done
self.home()
+ """
self.visit_url( "%s/admin/library_dataset_dataset_association?edit_info=True&library_id=%s&folder_id=%s&id=%s" % \
( self.url, str( library_one.id ), str( subfolder_one.id ), str( ldda_six.id ) ) )
self.check_page_for_string( 'Fu' )
self.check_page_for_string( 'This is the Fu component' )
self.check_page_for_string( 'Bar' )
self.check_page_for_string( 'This is the Bar component' )
+ """
def test_170_editing_dataset_attribute_info( self ):
"""Testing editing a datasets attribute information"""
new_ldda_name = '6.bed ( version 1 )'
@@ -1213,6 +1274,8 @@
def test_175_uploading_new_dataset_version( self ):
"""Testing uploading a new version of a dataset"""
message = 'Testing uploading a new version of a dataset'
+ ## TODO: temporarily eliminating templates until we have the new forms features done
+ """
self.upload_new_dataset_version( '6.bed',
str( library_one.id ),
str( subfolder_one.id ),
@@ -1224,6 +1287,16 @@
message=message.replace( ' ', '+' ),
check_template_str1='Fu',
check_template_str2='Bar' )
+ """
+ self.upload_new_dataset_version( '6.bed',
+ str( library_one.id ),
+ str( subfolder_one.id ),
+ str( subfolder_one.name ),
+ str( ldda_six.library_dataset.id ),
+ ldda_six.name,
+ file_format='auto',
+ dbkey='hg18',
+ message=message.replace( ' ', '+' ) )
global ldda_six_version_two
ldda_six_version_two = galaxy.model.LibraryDatasetDatasetAssociation.query() \
.order_by( desc( galaxy.model.LibraryDatasetDatasetAssociation.table.c.create_time ) ).first()
@@ -1233,6 +1306,8 @@
( self.url, str( library_one.id ), str( subfolder_one.id ), str( ldda_six_version_two.id ) ) )
self.check_page_for_string( 'This is the latest version of this library dataset' )
# Make sure the correct template was inherited
+ ## TODO: temporarily eliminating templates until we have the new forms features done
+ """
self.check_page_for_string( 'Fu' )
self.check_page_for_string( 'This is the Fu component' )
self.check_page_for_string( 'Bar' )
@@ -1240,6 +1315,7 @@
check_str = 'Expired versions of %s' % ldda_six_version_two.name
self.check_page_for_string( check_str )
self.check_page_for_string( ldda_six.name )
+ """
self.home()
# Make sure th permissions are the same
ldda_six.refresh()
@@ -1262,6 +1338,8 @@
"""Testing uploading new versions of a dataset using a directory of files"""
message = 'Testing uploading new versions of a dataset using a directory of files'
ldda_six_version_two.refresh()
+ ## TODO: temporarily eliminating templates until we have the new forms features done
+ """
self.upload_new_dataset_versions( str( library_one.id ),
str( subfolder_one.id ),
str( subfolder_one.name ),
@@ -1272,6 +1350,15 @@
message=message.replace( ' ', '+' ),
check_template_str1='Fu',
check_template_str2='Bar' )
+ """
+ self.upload_new_dataset_versions( str( library_one.id ),
+ str( subfolder_one.id ),
+ str( subfolder_one.name ),
+ str( ldda_six_version_two.library_dataset.id ),
+ ldda_six_version_two.name,
+ file_format='auto',
+ dbkey='hg18',
+ message=message.replace( ' ', '+' ) )
global ldda_six_version_five
ldda_six_version_five = galaxy.model.LibraryDatasetDatasetAssociation.query() \
.order_by( desc( galaxy.model.LibraryDatasetDatasetAssociation.table.c.create_time ) ).first()
@@ -1281,10 +1368,13 @@
( self.url, str( library_one.id ), str( subfolder_one.id ), str( ldda_six_version_five.id ) ) )
self.check_page_for_string( 'This is the latest version of this library dataset' )
# Make sure the correct template was inherited
+ ## TODO: temporarily eliminating templates until we have the new forms features done
+ """
self.check_page_for_string( 'Fu' )
self.check_page_for_string( 'This is the Fu component' )
self.check_page_for_string( 'Bar' )
self.check_page_for_string( 'This is the Bar component' )
+ """
check_str = 'Expired versions of %s' % ldda_six_version_five.name
self.check_page_for_string( check_str )
self.check_page_for_string( ldda_six.name )
@@ -1309,7 +1399,9 @@
def test_185_upload_datasets_from_library_dir( self ):
"""Testing uploading 3 datasets from a library directory to a root folder"""
message = 'This is a test for uploading a directory of files'
- roles_tuple = [ ( str( role_one.id ), role_one.name ) ]
+ roles_tuple = [ ( str( role_one.id ), role_one.name ) ]
+ ## TODO: temporarily eliminating templates until we have the new forms features done
+ """
self.add_datasets_from_library_dir( str( library_one.id ),
str( library_one.root_folder.id ),
library_one.root_folder.name,
@@ -1319,6 +1411,13 @@
check_template_str1='wind',
check_template_str2='bag',
check_template_str3='Fubar' )
+ """
+ self.add_datasets_from_library_dir( str( library_one.id ),
+ str( library_one.root_folder.id ),
+ library_one.root_folder.name,
+ roles_tuple=roles_tuple,
+ message=message.replace( '+', ' ' ),
+ root=True )
self.home()
self.visit_page( 'admin/browse_library?id=%s' % ( str( library_one.id ) ) )
self.check_page_for_string( admin_user.email )
@@ -1552,6 +1651,7 @@
def test_245_purge_user( self ):
"""Testing purging a user account"""
self.mark_user_deleted( user_id=regular_user3.id, email=regular_user3.email )
+ regular_user3.refresh()
self.purge_user( str( regular_user3.id ), regular_user3.email )
regular_user3.refresh()
if not regular_user3.purged:
@@ -1565,15 +1665,9 @@
raise AssertionError( 'DefaultUserPermissions for user %s are not related with the private role.' % regular_user3.email )
# Make sure History deleted
for history in regular_user3.histories:
+ history.refresh()
if not history.deleted:
raise AssertionError( 'User %s has active history id %d after their account was marked as purged.' % ( regular_user3.email, hda.id ) )
- # Make sure DefaultHistoryPermissions deleted EXCEPT FOR THE PRIVATE ROLE
- if len( history.default_permissions ) != 1:
- raise AssertionError( 'DefaultHistoryPermissions for history id %d were not deleted.' % history.id )
- for dhp in history.default_permissions:
- role = galaxy.model.Role.get( dhp.role_id )
- if role.type != 'private':
- raise AssertionError( 'DefaultHistoryPermissions for history id %d are not related with the private role.' % history.id )
# Make sure HistoryDatasetAssociation deleted
for hda in history.datasets:
hda.refresh()
1
0
sh run.sh seems to work okay until hitting this block of report...
Any ideas what this socket business is about? It looks to me like
possibly something python-specific.
Starting server in PID 11963.
Traceback (most recent call last):
File "./scripts/paster.py", line 27, in ?
command.run()
File "/root/src/galaxy-f7336991d0ee/eggs/py2.4-noplatform/
PasteScript-1.3.6-py2.4.egg/paste/script/command.py", line 78, in run
File "/root/src/galaxy-f7336991d0ee/eggs/py2.4-noplatform/
PasteScript-1.3.6-py2.4.egg/paste/script/command.py", line 117, in
invoke
File "/root/src/galaxy-f7336991d0ee/eggs/py2.4-noplatform/
PasteScript-1.3.6-py2.4.egg/paste/script/command.py", line 212, in run
File "/root/src/galaxy-f7336991d0ee/eggs/py2.4-noplatform/
PasteScript-1.3.6-py2.4.egg/paste/script/serve.py", line 232, in command
File "/root/src/galaxy-f7336991d0ee/eggs/py2.4-noplatform/
PasteDeploy-1.3.1-py2.4.egg/paste/deploy/loadwsgi.py", line 139, in
server_wrapper
File "/root/src/galaxy-f7336991d0ee/eggs/py2.4-noplatform/
PasteDeploy-1.3.1-py2.4.egg/paste/deploy/util/fixtypeerror.py", line
57, in fix_call
File "/root/src/galaxy-f7336991d0ee/eggs/py2.4-noplatform/
Paste-1.5.1-py2.4.egg/paste/httpserver.py", line 1307, in server_runner
File "/root/src/galaxy-f7336991d0ee/eggs/py2.4-noplatform/
Paste-1.5.1-py2.4.egg/paste/httpserver.py", line 1257, in serve
File "/root/src/galaxy-f7336991d0ee/eggs/py2.4-noplatform/
Paste-1.5.1-py2.4.egg/paste/httpserver.py", line 1107, in __init__
File "/root/src/galaxy-f7336991d0ee/eggs/py2.4-noplatform/
Paste-1.5.1-py2.4.egg/paste/httpserver.py", line 1087, in __init__
File "/root/src/galaxy-f7336991d0ee/eggs/py2.4-noplatform/
Paste-1.5.1-py2.4.egg/paste/httpserver.py", line 328, in __init__
File "/usr/lib64/python2.4/SocketServer.py", line 330, in __init__
self.server_bind()
File "/usr/lib64/python2.4/BaseHTTPServer.py", line 101, in
server_bind
SocketServer.TCPServer.server_bind(self)
File "/usr/lib64/python2.4/SocketServer.py", line 341, in server_bind
self.socket.bind(self.server_address)
File "<string>", line 1, in bind
socket.error: (98, 'Address already in use')
galaxy.jobs INFO 2009-06-05 02:15:43,692 sending stop signal to worker
thread
galaxy.jobs INFO 2009-06-05 02:15:43,692 job queue stopped
galaxy.jobs.runners.local INFO 2009-06-05 02:15:43,693 sending stop
signal to worker threads
galaxy.jobs.runners.local INFO 2009-06-05 02:15:43,694 local job
runner stopped
galaxy.jobs INFO 2009-06-05 02:15:43,694 sending stop signal to worker
thread
galaxy.jobs INFO 2009-06-05 02:15:43,695 job stopper stopped
2
7
Hi,
Regarding the install instructions at:
* http://g2.trac.bx.psu.edu/wiki/HowToInstall
We're wondering about the step:
* hg clone http://www.bx.psu.edu/hg/galaxy galaxy_dist
Previously we had been using svn to access the sources (some months
ago now). At this point I believe we got sources corresponding to the
development version of galaxy(http://test.g2.bx.psu.edu/). Since we
are doing module development we think it may be more appropriate to
use a release version (http://main.g2.bx.psu.edu/) It would be nice
to confirm that this is what galaxy_dist from the above step actually
corresponds to. If not then it would be good to know this too so we
can adjust our approach to updates accordingly.
Thanks for your attention.
Stewart
--
Stewart Stevens
Software Developer - Integrated Genomics
University of Otago
Department of Biochemistry
Tel: +64(0)3 479 7863
Fax: +64(0)3 479 7866
2
1
01 Jun '09
details: http://www.bx.psu.edu/hg/galaxy/rev/0fc19c283f78
changeset: 2424:0fc19c283f78
user: guru
date: Fri May 29 11:07:18 2009 -0400
description:
Bug fixes for histogram liftover and grouping tools.
6 file(s) affected in this change:
tools/extract/liftOver_wrapper.py
tools/extract/liftOver_wrapper.xml
tools/plotting/histogram.py
tools/plotting/histogram2.xml
tools/stats/grouping.py
tools/stats/grouping.xml
diffs (102 lines):
diff -r 7a6f75bf4be5 -r 0fc19c283f78 tools/extract/liftOver_wrapper.py
--- a/tools/extract/liftOver_wrapper.py Thu May 28 15:18:49 2009 -0400
+++ b/tools/extract/liftOver_wrapper.py Fri May 29 11:07:18 2009 -0400
@@ -29,7 +29,7 @@
if in_dbkey == "?":
stop_err( "Input dataset genome build unspecified, click the pencil icon in the history item to specify it." )
-cmd_line = "liftOver -minMatch=" + minMatch + " " + infile + " " + mapfilepath + " " + outfile1 + " " + outfile2 + " > /dev/null 2>&1"
+cmd_line = "liftOver -minMatch=" + str(minMatch) + " " + infile + " " + mapfilepath + " " + outfile1 + " " + outfile2 + " > /dev/null 2>&1"
if not os.path.isfile( mapfilepath ):
stop_err( "%s mapping is not currently available." % ( mapfilepath.split('/')[-1].split('.')[0] ) )
diff -r 7a6f75bf4be5 -r 0fc19c283f78 tools/extract/liftOver_wrapper.xml
--- a/tools/extract/liftOver_wrapper.xml Thu May 28 15:18:49 2009 -0400
+++ b/tools/extract/liftOver_wrapper.xml Fri May 29 11:07:18 2009 -0400
@@ -1,4 +1,4 @@
-<tool id="liftOver1" name="Convert genome coordinates">
+<tool id="liftOver1" name="Convert genome coordinates" version="1.0.1">
<description> between assemblies and genomes</description>
<command interpreter="python">liftOver_wrapper.py $input "$out_file1" "$out_file2" $dbkey $to_dbkey $minMatch</command>
<inputs>
diff -r 7a6f75bf4be5 -r 0fc19c283f78 tools/plotting/histogram.py
--- a/tools/plotting/histogram.py Thu May 28 15:18:49 2009 -0400
+++ b/tools/plotting/histogram.py Fri May 29 11:07:18 2009 -0400
@@ -32,7 +32,7 @@
skipped_lines = 0
first_invalid_line = 0
invalid_value = ''
-
+ i = 0
for i, line in enumerate( file( in_fname ) ):
valid = True
line = line.rstrip('\r\n')
@@ -79,7 +79,10 @@
except Exception, exc:
stop_err( "%s" %str( exc ) )
else:
- stop_err( "All values in column %s are non-numeric." %sys.argv[3] )
+ if i == 0:
+ stop_err("Input dataset is empty.")
+ else:
+ stop_err( "All values in column %s are non-numeric." %sys.argv[3] )
print "Histogram of column %s. " %sys.argv[3]
if skipped_lines > 0:
diff -r 7a6f75bf4be5 -r 0fc19c283f78 tools/plotting/histogram2.xml
--- a/tools/plotting/histogram2.xml Thu May 28 15:18:49 2009 -0400
+++ b/tools/plotting/histogram2.xml Fri May 29 11:07:18 2009 -0400
@@ -1,4 +1,4 @@
-<tool id="histogram_rpy" name="Histogram">
+<tool id="histogram_rpy" name="Histogram" version="1.0.1">
<description>of a numeric column</description>
<command interpreter="python">histogram.py $input $out_file1 $numerical_column "$title" "$xlab" $breaks $density</command>
<inputs>
diff -r 7a6f75bf4be5 -r 0fc19c283f78 tools/stats/grouping.py
--- a/tools/stats/grouping.py Thu May 28 15:18:49 2009 -0400
+++ b/tools/stats/grouping.py Fri May 29 11:07:18 2009 -0400
@@ -149,9 +149,15 @@
rout = eval( rfunc )( rout )
if op in ['c', 'cuniq']:
if op == 'c':
- out_str += "\t" + ','.join(rout)
+ if type(rout) == type([]):
+ out_str += "\t" + ','.join(rout)
+ else:
+ out_str += "\t" + str(rout)
else:
- out_str += "\t" + ','.join(list(set(rout)))
+ if type(rout) == type([]):
+ out_str += "\t" + ','.join(list(set(rout)))
+ else:
+ out_str += "\t" + str(rout)
else:
out_str += "\t" + str(rout)
@@ -211,9 +217,15 @@
rout = eval( rfunc )( rout )
if op in ['c','cuniq']:
if op == 'c':
- out_str += "\t" + ','.join(rout)
+ if type(rout) == type([]):
+ out_str += "\t" + ','.join(rout)
+ else:
+ out_str += "\t" + str(rout)
else:
- out_str += "\t" + ','.join(list(set(rout)))
+ if type(rout) == type([]):
+ out_str += "\t" + ','.join(list(set(rout)))
+ else:
+ out_str += "\t" + str(rout)
else:
out_str += "\t" + str( rout )
except:
diff -r 7a6f75bf4be5 -r 0fc19c283f78 tools/stats/grouping.xml
--- a/tools/stats/grouping.xml Thu May 28 15:18:49 2009 -0400
+++ b/tools/stats/grouping.xml Fri May 29 11:07:18 2009 -0400
@@ -1,4 +1,4 @@
-<tool id="Grouping1" name="Group" version="1.6.0">
+<tool id="Grouping1" name="Group" version="1.7.0">
<description>data by a column and perform aggregate operation on other columns.</description>
<command interpreter="python">
grouping.py
1
0
01 Jun '09
details: http://www.bx.psu.edu/hg/galaxy/rev/c8a4a4ea0f2c
changeset: 2425:c8a4a4ea0f2c
user: Nate Coraor <nate(a)bx.psu.edu>
date: Fri May 29 13:19:42 2009 -0400
description:
Allow the configuration of a job walltime (currently only supported in PBS)
4 file(s) affected in this change:
lib/galaxy/config.py
lib/galaxy/jobs/runners/pbs.py
lib/galaxy/util/bunch.py
universe_wsgi.ini.sample
diffs (223 lines):
diff -r 0fc19c283f78 -r c8a4a4ea0f2c lib/galaxy/config.py
--- a/lib/galaxy/config.py Fri May 29 11:07:18 2009 -0400
+++ b/lib/galaxy/config.py Fri May 29 13:19:42 2009 -0400
@@ -55,6 +55,7 @@
self.job_working_directory = resolve_path( kwargs.get( "job_working_directory", "database/job_working_directory" ), self.root )
self.outputs_to_working_directory = string_as_bool( kwargs.get( 'outputs_to_working_directory', False ) )
self.output_size_limit = int( kwargs.get( 'output_size_limit', 0 ) )
+ self.job_walltime = kwargs.get( 'job_walltime', None )
self.admin_users = kwargs.get( "admin_users", "" )
self.sendmail_path = kwargs.get('sendmail_path',"/usr/sbin/sendmail")
self.mailing_join_addr = kwargs.get('mailing_join_addr',"galaxy-user-join(a)bx.psu.edu")
@@ -123,7 +124,7 @@
"""
admin_users = self.get( "admin_users", "" ).split( "," )
return ( user is not None and user.email in admin_users )
-
+
def get_database_engine_options( kwargs ):
"""
Allow options for the SQLAlchemy database engine to be passed by using
diff -r 0fc19c283f78 -r c8a4a4ea0f2c lib/galaxy/jobs/runners/pbs.py
--- a/lib/galaxy/jobs/runners/pbs.py Fri May 29 11:07:18 2009 -0400
+++ b/lib/galaxy/jobs/runners/pbs.py Fri May 29 13:19:42 2009 -0400
@@ -1,8 +1,10 @@
import os, logging, threading, time
+from datetime import timedelta
from Queue import Queue, Empty
from galaxy import model
from galaxy.datatypes.data import nice_size
+from galaxy.util.bunch import Bunch
from paste.deploy.converters import asbool
@@ -88,6 +90,10 @@
# set the default server during startup
self.default_pbs_server = None
self.determine_pbs_server( 'pbs:///' )
+ self.job_walltime = None
+ if self.app.config.job_walltime is not None:
+ h, m, s = [ int( v ) for v in self.app.config.job_walltime.split( ':' ) ]
+ self.job_walltime = timedelta( 0, s, 0, 0, m, h )
self.monitor_thread = threading.Thread( target=self.monitor )
self.monitor_thread.start()
self.work_queue = Queue()
@@ -138,8 +144,8 @@
self.queue_job( obj )
elif op == 'finish':
self.finish_job( obj )
- elif op == 'fail_oversize_job':
- self.fail_oversize_job( obj )
+ elif op == 'fail':
+ self.fail_job( obj )
except:
log.exception( "Uncaught exception %sing job" % op )
@@ -297,7 +303,7 @@
"""
new_watched = []
# reduce pbs load by batching status queries
- ( failures, states ) = self.check_all_jobs()
+ ( failures, statuses ) = self.check_all_jobs()
for pbs_job_state in self.watched:
job_id = pbs_job_state.job_id
galaxy_job_id = pbs_job_state.job_wrapper.job_id
@@ -307,28 +313,43 @@
log.debug( "(%s/%s) Skipping state check because PBS server connection failed" % ( galaxy_job_id, job_id ) )
new_watched.append( pbs_job_state )
continue
- if states.has_key( job_id ):
- state = states[job_id]
- if state != old_state:
- log.debug("(%s/%s) job state changed from %s to %s" % ( galaxy_job_id, job_id, old_state, state ) )
- if state == "R" and not pbs_job_state.running:
+ if statuses.has_key( job_id ):
+ status = statuses[job_id]
+ if status.job_state != old_state:
+ log.debug("(%s/%s) job state changed from %s to %s" % ( galaxy_job_id, job_id, old_state, status.job_state ) )
+ if status.job_state == "R" and not pbs_job_state.running:
pbs_job_state.running = True
pbs_job_state.job_wrapper.change_state( model.Job.states.RUNNING )
- if self.app.config.output_size_limit > 0 and state == "R" and (pbs_job_state.check_count % 10) == 0:
- # Every 10th time a job is checked, check the size of its outputs.
- fail = False
- for outfile, size in pbs_job_state.job_wrapper.check_output_sizes():
- if size > self.app.config.output_size_limit:
- pbs_job_state.fail_message = 'Job output grew too large (greater than %s), please try different job parameters or' \
- % nice_size( self.app.config.output_size_limit )
- log.warning( '(%s/%s) Dequeueing job due to output %s growing larger than %s limit' \
- % ( galaxy_job_id, job_id, os.path.basename( outfile ), nice_size( self.app.config.output_size_limit ) ) )
- self.work_queue.put( ( 'fail_oversize_job', pbs_job_state ) )
- fail = True
- break
- if fail:
- continue
- pbs_job_state.old_state = state
+ if status.job_state == "R" and ( pbs_job_state.check_count % 20 ) == 0:
+ # Every 20th time the job status is checked, do limit checks (if configured)
+ if self.app.config.output_size_limit > 0:
+ # Check the size of the job outputs
+ fail = False
+ for outfile, size in pbs_job_state.job_wrapper.check_output_sizes():
+ if size > self.app.config.output_size_limit:
+ pbs_job_state.fail_message = 'Job output grew too large (greater than %s), please try different job parameters or' \
+ % nice_size( self.app.config.output_size_limit )
+ log.warning( '(%s/%s) Dequeueing job due to output %s growing larger than %s limit' \
+ % ( galaxy_job_id, job_id, os.path.basename( outfile ), nice_size( self.app.config.output_size_limit ) ) )
+ self.work_queue.put( ( 'fail', pbs_job_state ) )
+ fail = True
+ break
+ if fail:
+ continue
+ if self.job_walltime is not None:
+ # Check the job's execution time
+ if status.get( 'resources_used', False ):
+ # resources_used may not be in the status for new jobs
+ h, m, s = [ int( i ) for i in status.resources_used.walltime.split( ':' ) ]
+ time_executing = timedelta( 0, s, 0, 0, m, h )
+ if time_executing > self.job_walltime:
+ pbs_job_state.fail_message = 'Job ran longer than maximum allowed execution time (%s), please try different job parameters or' \
+ % self.app.config.job_walltime
+ log.warning( '(%s/%s) Dequeueing job since walltime has been reached' \
+ % ( galaxy_job_id, job_id ) )
+ self.work_queue.put( ( 'fail', pbs_job_state ) )
+ continue
+ pbs_job_state.old_state = status.job_state
new_watched.append( pbs_job_state )
else:
try:
@@ -350,11 +371,12 @@
def check_all_jobs( self ):
"""
Returns a list of servers that failed to be contacted and a dict
- of "job_id : state" pairs.
+ of "job_id : status" pairs (where status is a bunchified version
+ of the API's structure.
"""
servers = []
failures = []
- states = {}
+ statuses = {}
for pbs_job_state in self.watched:
pbs_server_name = self.determine_pbs_server( pbs_job_state.runner_url )
if pbs_server_name not in servers:
@@ -366,13 +388,27 @@
log.debug("connection to PBS server %s for state check failed" % pbs_server_name )
failures.append( pbs_server_name )
continue
- stat_attrl = pbs.new_attrl(1)
- stat_attrl[0].name = 'job_state'
+ stat_attrl = pbs.new_attrl(2)
+ stat_attrl[0].name = pbs.ATTR_state
+ stat_attrl[1].name = pbs.ATTR_used
jobs = pbs.pbs_statjob( c, None, stat_attrl, None )
pbs.pbs_disconnect( c )
- for job in jobs:
- states[job.name] = job.attribs[0].value
- return( ( failures, states ) )
+ statuses.update( self.convert_statjob_to_bunches( jobs ) )
+ return( ( failures, statuses ) )
+
+ def convert_statjob_to_bunches( self, statjob_out ):
+ statuses = {}
+ for job in statjob_out:
+ status = {}
+ for attrib in job.attribs:
+ if attrib.resource is None:
+ status[ attrib.name ] = attrib.value
+ else:
+ if attrib.name not in status:
+ status[ attrib.name ] = Bunch()
+ status[ attrib.name ][ attrib.resource ] = attrib.value
+ statuses[ job.name ] = Bunch( **status )
+ return statuses
def check_single_job( self, pbs_server_name, job_id ):
"""
@@ -384,7 +420,7 @@
log.debug("connection to PBS server %s for state check failed" % pbs_server_name )
return None
stat_attrl = pbs.new_attrl(1)
- stat_attrl[0].name = 'job_state'
+ stat_attrl[0].name = pbs.ATTR_state
jobs = pbs.pbs_statjob( c, job_id, stat_attrl, None )
pbs.pbs_disconnect( c )
return jobs[0].attribs[0].value
@@ -417,7 +453,7 @@
# clean up the pbs files
self.cleanup( ( ofile, efile, job_file ) )
- def fail_oversize_job( self, pbs_job_state ):
+ def fail_job( self, pbs_job_state ):
"""
Seperated out so we can use the worker threads for it.
"""
diff -r 0fc19c283f78 -r c8a4a4ea0f2c lib/galaxy/util/bunch.py
--- a/lib/galaxy/util/bunch.py Fri May 29 11:07:18 2009 -0400
+++ b/lib/galaxy/util/bunch.py Fri May 29 13:19:42 2009 -0400
@@ -21,4 +21,7 @@
return '%s' % self.__dict__
def __nonzero__(self):
- return bool(self.__dict__)
\ No newline at end of file
+ return bool(self.__dict__)
+
+ def __setitem__(self, k, v):
+ self.__dict__.__setitem__(k, v)
diff -r 0fc19c283f78 -r c8a4a4ea0f2c universe_wsgi.ini.sample
--- a/universe_wsgi.ini.sample Fri May 29 11:07:18 2009 -0400
+++ b/universe_wsgi.ini.sample Fri May 29 13:19:42 2009 -0400
@@ -171,6 +171,11 @@
# Job queue cleanup interval in minutes. Currently only used by RoundRobin
job_queue_cleanup_interval = 30
+# Jobs can be killed after a certain amount of execution time. Format is in
+# hh:mm:ss. Currently only implemented for PBS. Leave commented for
+# unlimited.
+#job_walltime = 10:00:00
+
# Clustering Galaxy is not a straightforward process and requires a lot of
# pre-configuration. See the ClusteringGalaxy Wiki before attempting to set
# any of these options:
1
0
01 Jun '09
details: http://www.bx.psu.edu/hg/galaxy/rev/e50551db6e60
changeset: 2426:e50551db6e60
user: Greg Von Kuster <greg(a)bx.psu.edu>
date: Fri May 29 16:36:43 2009 -0400
description:
Add missing functional tests for history features.
4 file(s) affected in this change:
lib/galaxy/web/controllers/root.py
templates/root/history_as_xml.mako
test/base/twilltestcase.py
test/functional/test_history_functions.py
diffs (264 lines):
diff -r c8a4a4ea0f2c -r e50551db6e60 lib/galaxy/web/controllers/root.py
--- a/lib/galaxy/web/controllers/root.py Fri May 29 13:19:42 2009 -0400
+++ b/lib/galaxy/web/controllers/root.py Fri May 29 16:36:43 2009 -0400
@@ -59,7 +59,7 @@
return trans.fill_template( '/no_access.mako', message = 'Please log in to access Galaxy histories.' )
if as_xml:
trans.response.set_content_type('text/xml')
- return trans.fill_template_mako( "root/history_as_xml.mako", history=history )
+ return trans.fill_template_mako( "root/history_as_xml.mako", history=history, show_deleted=util.string_as_bool( show_deleted ) )
else:
template = "root/history.mako"
return trans.fill_template( "root/history.mako", history = history, show_deleted = util.string_as_bool( show_deleted ) )
diff -r c8a4a4ea0f2c -r e50551db6e60 templates/root/history_as_xml.mako
--- a/templates/root/history_as_xml.mako Fri May 29 13:19:42 2009 -0400
+++ b/templates/root/history_as_xml.mako Fri May 29 16:36:43 2009 -0400
@@ -1,8 +1,16 @@
<?xml version="1.0"?>
<history>
- %for data in history.active_datasets:
- <data id="${data.id}" hid="${data.hid}" name="${data.name}" state="${data.state}" dbkey="${data.dbkey}">
- ${_(data.blurb)}
- </data>
- %endfor
+ %if show_deleted:
+ %for data in history.activatable_datasets:
+ <data id="${data.id}" hid="${data.hid}" name="${data.name}" state="${data.state}" dbkey="${data.dbkey}">
+ ${_(data.blurb)}
+ </data>
+ %endfor
+ %else:
+ %for data in history.active_datasets:
+ <data id="${data.id}" hid="${data.hid}" name="${data.name}" state="${data.state}" dbkey="${data.dbkey}">
+ ${_(data.blurb)}
+ </data>
+ %endfor
+ %endif
</history>
diff -r c8a4a4ea0f2c -r e50551db6e60 test/base/twilltestcase.py
--- a/test/base/twilltestcase.py Fri May 29 13:19:42 2009 -0400
+++ b/test/base/twilltestcase.py Fri May 29 16:36:43 2009 -0400
@@ -98,6 +98,7 @@
# Functions associated with histories
def check_history_for_errors( self ):
"""Raises an exception if there are errors in a history"""
+ self.home()
self.visit_page( "history" )
page = self.last_page()
if page.find( 'error' ) > -1:
@@ -105,6 +106,7 @@
def check_history_for_string( self, patt ):
"""Looks for 'string' in history page"""
+ self.home()
self.visit_page( "history" )
for subpatt in patt.split():
tc.find(subpatt)
@@ -130,16 +132,16 @@
data_list = [ elem for elem in tree.findall("data") ]
return data_list
- def get_history( self ):
+ def get_history( self, show_deleted=False ):
"""Returns a history"""
- tree = self.history_as_xml_tree()
+ tree = self.history_as_xml_tree( show_deleted=show_deleted )
data_list = [ elem for elem in tree.findall("data") ]
return data_list
- def history_as_xml_tree( self ):
+ def history_as_xml_tree( self, show_deleted=False ):
"""Returns a parsed xml object of a history"""
self.home()
- self.visit_page( 'history?as_xml=True' )
+ self.visit_page( 'history?as_xml=True&show_deleted=%s' % show_deleted )
xml = self.last_page()
tree = ElementTree.fromstring(xml)
return tree
@@ -201,6 +203,7 @@
name = elem.get( 'name' )
self.assertTrue( name )
self.visit_url( "%s/history/share?id=%s&email=%s&history_share_btn=Submit" % ( self.url, id, email ) )
+ self.check_page_for_string( 'History (%s) has been shared with: %s' % ( name, email ) )
return id, name, email
def share_history_containing_private_datasets( self, history_id, email='test(a)bx.psu.edu' ):
"""Attempt to share a history containing private datasets with a different user"""
@@ -237,8 +240,10 @@
self.assertEqual(len(elems), 1)
self.visit_page( "history/list?operation=switch&id=%s" % elems[0].get('id') )
- def view_stored_histories( self ):
+ def view_stored_histories( self, check_str='' ):
self.visit_page( "history/list" )
+ if check_str:
+ self.check_page_for_string( check_str )
# Functions associated with datasets (history items) and meta data
def get_job_stderr( self, id ):
@@ -264,16 +269,36 @@
self.visit_page( "edit?hid=%d" % hid )
for subpatt in patt.split():
tc.find(subpatt)
-
- def delete_history_item( self, hid ):
+ def delete_history_item( self, hid, check_str='' ):
"""Deletes an item from a history"""
+ try:
+ hid = int( hid )
+ except:
+ raise AssertionError, "Invalid hid '%s' - must be int" % hid
hid = str(hid)
data_list = self.get_history()
self.assertTrue( data_list )
- elems = [ elem for elem in data_list if elem.get('hid') == hid ]
- self.assertEqual(len(elems), 1)
- self.visit_page( "delete?id=%s" % elems[0].get('id') )
-
+ elems = [ elem for elem in data_list if elem.get( 'hid' ) == hid ]
+ self.assertEqual( len( elems ), 1 )
+ self.home()
+ self.visit_page( "delete?id=%s" % elems[0].get( 'id' ) )
+ if check_str:
+ self.check_page_for_string( check_str )
+ def undelete_history_item( self, hid, show_deleted=False, check_str='' ):
+ """Un-deletes a deleted item in a history"""
+ try:
+ hid = int( hid )
+ except:
+ raise AssertionError, "Invalid hid '%s' - must be int" % hid
+ hid = str( hid )
+ data_list = self.get_history( show_deleted=show_deleted )
+ self.assertTrue( data_list )
+ elems = [ elem for elem in data_list if elem.get( 'hid' ) == hid ]
+ self.assertEqual( len( elems ), 1 )
+ self.home()
+ self.visit_url( "%s/dataset/undelete?id=%s" % ( self.url, elems[0].get( 'id' ) ) )
+ if check_str:
+ self.check_page_for_string( check_str )
def edit_metadata( self, hid=None, form_no=0, **kwd ):
"""
Edits the metadata associated with a history item."""
diff -r c8a4a4ea0f2c -r e50551db6e60 test/functional/test_history_functions.py
--- a/test/functional/test_history_functions.py Fri May 29 13:19:42 2009 -0400
+++ b/test/functional/test_history_functions.py Fri May 29 16:36:43 2009 -0400
@@ -1,4 +1,6 @@
-from base.twilltestcase import TwillTestCase
+import galaxy.model
+from galaxy.model.orm import *
+from base.twilltestcase import *
class TestHistory( TwillTestCase ):
@@ -20,15 +22,28 @@
def test_10_history_options_when_logged_in( self ):
"""Testing history options when logged in"""
self.history_options()
- self.check_page_for_string( 'Rename</a> current history')
- self.check_page_for_string( 'List</a> previously stored histories')
- self.check_page_for_string( 'Share</a> current history')
- self.check_page_for_string( 'Delete</a> current history')
- def test_10_history_rename( self ):
+ self.check_page_for_string( 'Rename</a> current history' )
+ self.check_page_for_string( 'List</a> previously stored histories' )
+ self.check_page_for_string( 'Construct workflow</a> from the current history' )
+ self.check_page_for_string( 'Share</a> current history' )
+ # Tests for changing default history permissions are done in test_security_and_libraries.py
+ self.check_page_for_string( 'Change default permissions</a> for the current history' )
+ self.check_page_for_string( 'Show deleted</a> datasets in history' )
+ self.check_page_for_string( 'Delete</a> current history' )
+ # Need to add a history item in order to create a new empty history
+ try:
+ self.check_page_for_string( 'Create</a> a new empty history' )
+ raise AssertionError, "Incorrectly able to create a new empty history when the current history is empty."
+ except:
+ pass
+ self.upload_file( '1.bed', dbkey='hg18' )
+ self.history_options()
+ self.check_page_for_string( 'Create</a> a new empty history' )
+ def test_15_history_rename( self ):
"""Testing renaming a history"""
id, old_name, new_name = self.rename_history()
self.check_page_for_string( 'History: %s renamed to: %s' %(old_name, new_name) )
- def test_15_history_view( self ):
+ def test_20_history_list( self ):
"""Testing viewing previously stored histories"""
self.view_stored_histories()
self.check_page_for_string( 'Stored histories' )
@@ -36,24 +51,15 @@
self.check_page_for_string( 'operation=Rename&id' )
self.check_page_for_string( 'operation=Switch&id' )
self.check_page_for_string( 'operation=Delete&id' )
- def test_20_delete_history_item( self ):
- """Testing deleting history item"""
- self.upload_file('1.bed', dbkey='hg15')
- self.check_history_for_string('hg15 bed')
- self.assertEqual ( len(self.get_history()), 1)
- self.delete_history_item(1)
- self.check_history_for_string("Your history is empty")
- self.assertEqual ( len(self.get_history()), 0)
- def test_25_share_history( self ):
+ def test_25_history_share( self ):
"""Testing sharing a history with another user"""
self.upload_file('1.bed', dbkey='hg18')
id, name, email = self.share_history()
- self.last_page()
- self.check_page_for_string( 'History (%s) has been shared with: %s' %(name, email) )
self.logout()
- self.login( email='test2(a)bx.psu.edu' )
- self.view_stored_histories()
- self.check_page_for_string( 'Unnamed history from test(a)bx.psu.edu' )
+ self.login( email=email )
+ self.home()
+ check_str = 'Unnamed history from test(a)bx.psu.edu'
+ self.view_stored_histories( check_str=check_str )
histories = self.get_histories()
for history in histories:
if history.get( 'name' ) == 'Unnamed history from test(a)bx.psu.edu':
@@ -63,6 +69,47 @@
self.delete_history( id )
self.logout()
self.login( email='test(a)bx.psu.edu' )
+ def test_30_history_show_and_hide_deleted_datasets( self ):
+ """Testing displaying deleted history items"""
+ self.new_history()
+ self.upload_file('1.bed', dbkey='hg18')
+ latest_hda = galaxy.model.HistoryDatasetAssociation.query() \
+ .order_by( desc( galaxy.model.HistoryDatasetAssociation.table.c.create_time ) ).first()
+ self.home()
+ self.visit_url( "%s/root/delete?show_deleted_on_refresh=False&id=%s" % ( self.url, str( latest_hda.id ) ) )
+ self.check_history_for_string( 'Your history is empty' )
+ self.home()
+ self.visit_url( "%s/history/?show_deleted=True" % self.url )
+ self.check_page_for_string( 'This dataset has been deleted.' )
+ self.check_page_for_string( '1.bed' )
+ self.home()
+ self.visit_url( "%s/history/?show_deleted=False" % self.url )
+ self.check_page_for_string( 'Your history is empty' )
+ def test_35_deleting_and_undeleting_history_items( self ):
+ """Testing deleting and un-deleting history items"""
+ self.new_history()
+ # Add a new history item
+ self.upload_file( '1.bed', dbkey='hg15' )
+ self.home()
+ self.visit_url( "%s/history/?show_deleted=False" % self.url )
+ self.check_page_for_string( '1.bed' )
+ self.check_page_for_string( 'hg15' )
+ self.assertEqual ( len( self.get_history() ), 1 )
+ # Delete the history item
+ self.delete_history_item( 1, check_str="Your history is empty" )
+ self.assertEqual ( len( self.get_history() ), 0 )
+ # Try deleting an invalid hid
+ try:
+ self.delete_history_item( 'XXX' )
+ raise AssertionError, "Inproperly able to delete hid 'XXX' which is not an integer"
+ except:
+ pass
+ # Undelete the history item
+ self.undelete_history_item( 1, show_deleted=True )
+ self.home()
+ self.visit_url( "%s/history/?show_deleted=False" % self.url )
+ self.check_page_for_string( '1.bed' )
+ self.check_page_for_string( 'hg15' )
def test_9999_clean_up( self ):
self.delete_history()
self.logout()
1
0
29 May '09
details: http://www.bx.psu.edu/hg/galaxy/rev/a07e84e73b45
changeset: 2422:a07e84e73b45
user: Dan Blankenberg <dan(a)bx.psu.edu>
date: Thu May 28 13:58:56 2009 -0400
description:
Fix for DrillDownParameter when no option is selected and saved in worflow editing.
1 file(s) affected in this change:
lib/galaxy/tools/parameters/basic.py
diffs (15 lines):
diff -r 186fcb977e75 -r a07e84e73b45 lib/galaxy/tools/parameters/basic.py
--- a/lib/galaxy/tools/parameters/basic.py Thu May 28 11:10:44 2009 -0400
+++ b/lib/galaxy/tools/parameters/basic.py Thu May 28 13:58:56 2009 -0400
@@ -947,7 +947,10 @@
def from_html( self, value, trans=None, other_values={} ):
if self.need_late_validation( trans, other_values ):
if self.multiple:
- value = value.split( "\n" )
+ if value == '': #No option selected
+ value = None
+ else:
+ value = value.split( "\n" )
return UnvalidatedValue( value )
if not value: return None
if not isinstance( value, list ):
1
0
29 May '09
details: http://www.bx.psu.edu/hg/galaxy/rev/186fcb977e75
changeset: 2421:186fcb977e75
user: Greg Von Kuster <greg(a)bx.psu.edu>
date: Thu May 28 11:10:44 2009 -0400
description:
Add a defaulttimeout setting of 10 minutes to the urlopen() call for requests to remote data sources.
1 file(s) affected in this change:
tools/data_source/data_source.py
diffs (43 lines):
diff -r 5c2d30d3fb04 -r 186fcb977e75 tools/data_source/data_source.py
--- a/tools/data_source/data_source.py Wed May 27 14:19:59 2009 -0400
+++ b/tools/data_source/data_source.py Thu May 28 11:10:44 2009 -0400
@@ -1,8 +1,8 @@
#!/usr/bin/env python
-#Retreives data from UCSC and stores in a file. UCSC parameters are provided in the input/output file.
-import urllib, sys, os, gzip, tempfile, shutil
+# Retrieves data from external data source applications and stores in a dataset file.
+# Data source application parameters are temporarily stored in the dataset file.
+import socket, urllib, sys, os, gzip, tempfile, shutil
from galaxy import eggs
-#from galaxy.datatypes import data
from galaxy.util import gzip_magic
assert sys.version_info[:2] >= ( 2, 4 )
@@ -34,15 +34,23 @@
open( filename, 'w' ).write( "" )
stop_err( 'The remote data source application has not sent back a URL parameter in the request.' )
URL_method = params.get( 'URL_method', None )
- out = open( filename, 'w' )
- CHUNK_SIZE = 2**20 # 1Mb
+ CHUNK_SIZE = 2**20 # 1Mb
+ # The Python support for fetching resources from the web is layered. urllib uses the httplib
+ # library, which in turn uses the socket library. As of Python 2.3 you can specify how long
+ # a socket should wait for a response before timing out. By default the socket module has no
+ # timeout and can hang. Currently, the socket timeout is not exposed at the httplib or urllib2
+ # levels. However, you can set the default timeout ( in seconds ) globally for all sockets by
+ # doing the following.
+ socket.setdefaulttimeout( 600 )
+ # The following calls to urllib2.urlopen() will use the above default timeout
try:
if not URL_method or URL_method == 'get':
page = urllib.urlopen( URL )
elif URL_method == 'post':
page = urllib.urlopen( URL, urllib.urlencode( params ) )
- except:
- stop_err( 'It appears that the remote data source application is currently off line. Please try again later.' )
+ except Exception, e:
+ stop_err( 'The remote data source application may be off line, please try again later. Error: %s' % str( e ) )
+ out = open( filename, 'w' )
while 1:
chunk = page.read( CHUNK_SIZE )
if not chunk:
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/7a6f75bf4be5
changeset: 2423:7a6f75bf4be5
user: Nate Coraor <nate(a)bx.psu.edu>
date: Thu May 28 15:18:49 2009 -0400
description:
Fix the cleanup_datasets script
1 file(s) affected in this change:
scripts/cleanup_datasets/cleanup_datasets.py
diffs (17 lines):
diff -r a07e84e73b45 -r 7a6f75bf4be5 scripts/cleanup_datasets/cleanup_datasets.py
--- a/scripts/cleanup_datasets/cleanup_datasets.py Thu May 28 13:58:56 2009 -0400
+++ b/scripts/cleanup_datasets/cleanup_datasets.py Thu May 28 15:18:49 2009 -0400
@@ -264,8 +264,13 @@
if dataset.extra_files_path and os.path.exists( dataset.extra_files_path ):
shutil.rmtree( dataset.extra_files_path ) #we need to delete the directory and its contents; os.unlink would always fail on a directory
dataset.purged = True
+ dataset.flush()
else:
print "# This dataset (%i) is not purgable, the file (%s) will not be removed.\n" % ( dataset.id, dataset.file_name )
+ except OSError, exc:
+ print "# Error, file has already been removed: %s" % str( exc )
+ dataset.purged = True
+ dataset.flush()
except Exception, exc:
print "# Error, exception: %s caught attempting to purge %s\n" %( str( exc ), dataset.file_name )
else:
1
0
27 May '09
details: http://www.bx.psu.edu/hg/galaxy/rev/1acbcbcebeb3
changeset: 2419:1acbcbcebeb3
user: Nate Coraor <nate(a)bx.psu.edu>
date: Wed May 27 11:15:35 2009 -0400
description:
Add a hack to force UCSC links to be rewritten as http if your upstream uses https
1 file(s) affected in this change:
lib/galaxy/datatypes/interval.py
diffs (16 lines):
diff -r 7414f90d7eae -r 1acbcbcebeb3 lib/galaxy/datatypes/interval.py
--- a/lib/galaxy/datatypes/interval.py Tue May 26 16:35:23 2009 -0400
+++ b/lib/galaxy/datatypes/interval.py Wed May 27 11:15:35 2009 -0400
@@ -223,6 +223,12 @@
stop = viewport_tuple[2]
for site_name, site_url in util.get_ucsc_by_build(dataset.dbkey):
if site_name in app.config.ucsc_display_sites:
+ # HACK: UCSC doesn't support https, so force http even
+ # if our URL scheme is https. Making this work
+ # requires additional hackery in your upstream proxy.
+ # If UCSC ever supports https, remove this hack.
+ if base_url.startswith( 'https://' ):
+ base_url = base_url.replace( 'https', 'http', 1 )
display_url = urllib.quote_plus( "%s%s/display_as?id=%i&display_app=%s" % (base_url, url_for( controller='root' ), dataset.id, type) )
link = "%sdb=%s&position=%s:%s-%s&hgt.customText=%s" % (site_url, dataset.dbkey, chrom, start, stop, display_url )
ret_val.append( (site_name, link) )
1
0