commit/galaxy-central: fubar: Changes to allow all test outputs generated by twill to be saved to a folder pointed to by
1 new changeset in galaxy-central: http://bitbucket.org/galaxy/galaxy-central/changeset/b9cff3fbd170/ changeset: r5383:b9cff3fbd170 user: fubar date: 2011-04-14 14:09:48 summary: Changes to allow all test outputs generated by twill to be saved to a folder pointed to by an environment variable "GALAXY_TEST_SAVE" if defined before running functional tests If the environment variable is empty, all tests procede as usual and test outputs are deleted without saving affected #: 3 files (770 bytes) --- a/scripts/functional_tests.py Wed Apr 13 19:14:21 2011 -0400 +++ b/scripts/functional_tests.py Thu Apr 14 08:09:48 2011 -0400 @@ -47,6 +47,8 @@ galaxy_test_host = os.environ.get( 'GALAXY_TEST_HOST', default_galaxy_test_host ) galaxy_test_port = os.environ.get( 'GALAXY_TEST_PORT', None ) + galaxy_test_save = os.environ.get( 'GALAXY_TEST_SAVE', None) + if 'HTTP_ACCEPT_LANGUAGE' not in os.environ: os.environ['HTTP_ACCEPT_LANGUAGE'] = default_galaxy_locales galaxy_test_file_dir = os.environ.get( 'GALAXY_TEST_FILE_DIR', default_galaxy_test_file_dir ) @@ -126,10 +128,14 @@ print "Database connection:", database_connection - # What requires these? + # What requires these? + # handy for (eg) functional tests to save outputs? + if galaxy_test_save: + os.environ['GALAXY_TEST_SAVE'] = galaxy_test_save + # pass in through script setenv + # will leave a copy of ALL test validate files os.environ['GALAXY_TEST_HOST'] = galaxy_test_host os.environ['GALAXY_TEST_FILE_DIR'] = galaxy_test_file_dir - # ---- Build Application -------------------------------------------------- app = None --- a/test/base/twilltestcase.py Wed Apr 13 19:14:21 2011 -0400 +++ b/test/base/twilltestcase.py Thu Apr 14 08:09:48 2011 -0400 @@ -32,7 +32,14 @@ self.port = os.environ.get( 'GALAXY_TEST_PORT' ) self.url = "http://%s:%s" % ( self.host, self.port ) self.file_dir = os.environ.get( 'GALAXY_TEST_FILE_DIR' ) + self.keepOutdir = os.environ.get( 'GALAXY_TEST_SAVE', '' ) + if self.keepOutdir > '': + try: + os.makedirs(self.keepOutdir) + except: + pass self.home() + #self.set_history() # Functions associated with files @@ -632,6 +639,10 @@ self.visit_page( "display?hid=" + hid ) data = self.last_page() file( temp_name, 'wb' ).write(data) + if self.keepOutdir > '': + ofn = os.path.join(self.keepOutdir,os.path.basename(local_name)) + shutil.copy(temp_name,ofn) + log.debug('## GALAXY_TEST_SAVE=%s. saved %s' % (self.keepOutdir,ofn)) try: # have to nest try-except in try-finally to handle 2.4 try: --- a/tools/rgenetics/rgQC.xml Wed Apr 13 19:14:21 2011 -0400 +++ b/tools/rgenetics/rgQC.xml Thu Apr 14 08:09:48 2011 -0400 @@ -28,6 +28,7 @@ </param><param name='title' value='rgQCtest1' /><output name='html_file' file='rgtestouts/rgQC/rgQCtest1.html' ftype='html' lines_diff='300'> + <param name="dbkey" value="hg18" /><extra_files type="file" name='tinywga_All_Paged.pdf' value="rgtestouts/rgQC/tinywga_All_Paged.pdf" compare="sim_size" delta = "100000"/><extra_files type="file" name='tinywga.log' value="rgtestouts/rgQC/tinywga.log" compare="diff" lines_diff="15"/><extra_files type="file" name='tinywga.frq' value="rgtestouts/rgQC/tinywga.frq" compare="diff" /> Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket