Hello, I still haven't figured out why Galaxy's Twill is returning HTTP code 404 when running the functional tests script on my personal Tool Shed. I just did another test to make sure that it is indeed returning the wrong HTTP code. $ python Python 2.7.3 (default, Sep 26 2013, 20:08:41) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import twill.commands as tc tc.go('http://toolshed.galaxy.domain.org/') ==> at http://shed.galaxy.byobu.info/ print tc.browser.get_code() 200
As you can see, now Twill returns HTTP code 200 as expected. This test was done with python-twill (0.9-3) on Linux. Galaxy also comes with Twill 0.9. To test this further, I made some changes to the Python script responsible for testing the HTTP return code. Here is the diff: ---- diff -r 6822f41bc9bb test/install_and_test_tool_shed_repositories/base/twilltestcase.py --- a/test/install_and_test_tool_shed_repositories/base/twilltestcase.py Mon Aug 19 13:06:17 2013 -0400 +++ b/test/install_and_test_tool_shed_repositories/base/twilltestcase.py Sat Oct 19 14:53:26 2013 +0200 @@ -67,7 +67,7 @@ # install_repositories_by_revision redirect, so we have to include 403 in the allowed HTTP # status codes and log in again. url = '%s/repository/install_repositories_by_revision?%s' % ( tool_shed_url, install_params ) - self.visit_url( url, allowed_codes=[ 200, 403 ] ) + self.visit_url( url, allowed_codes=[ 200, 403, 404 ] ) self.logout() self.login( email='test@bx.psu.edu', username='test' ) install_params = urllib.urlencode( dict( repository_ids=encoded_repository_id, @@ -105,7 +105,7 @@ self.check_for_strings( post_submit_strings_displayed, strings_not_displayed ) repository_ids = self.initiate_installation_process( new_tool_panel_section=new_tool_panel_section ) self.wait_for_repository_installation( repository_ids ) - def visit_url( self, url, allowed_codes=[ 200 ] ): + def visit_url( self, url, allowed_codes=[ 200, 404 ] ): new_url = tc.go( url ) return_code = tc.browser.get_code() assert return_code in allowed_codes, 'Invalid HTTP return code %s, allowed codes: %s' % \ ---- So I made the script accept the 404 return code, to see if it can now successfully run the functional tests of my tool, and it did! #################################################################################### # 2013-10-19 14:38:58 - repository installation and testing script completed. # Repository revisions tested: 1 # ---------------------------------------------------------------------------------- # 1 repositories passed all tests: # # usearch owned by serrano, changeset revision 095baaf5d877 #################################################################################### There are two tests in this repository and it passed both. I think this proves that Twill indeed returns the wrong HTTP code. It returns 404 (and sometimes 500) when it should return 200. I have no idea why this happens in Galaxy and I'm hoping that someone else can have a look at it. Regards, Serrano