From 293ce5a4720c7fc2ec26d44985750188e3762e6b Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Sun, 12 Aug 2018 20:09:52 +0200 Subject: [PATCH] py3: Fix mules test cases We're now just copying the current python path. Also the handler names have actually changed, I think this hasn't been updated after a late change (it is now as it should be, based on the documentation). --- test/base/driver_util.py | 10 ++++++---- test/integration/test_mules_as_job_handlers.py | 7 ++++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/test/base/driver_util.py b/test/base/driver_util.py index 5684c12791b..897022c1afa 100644 --- a/test/base/driver_util.py +++ b/test/base/driver_util.py @@ -411,10 +411,11 @@ def wait_for_http_server(host, port, sleep_amount=0.1, sleep_tries=150): conn = http_client.HTTPConnection(host, port) try: conn.request("GET", "/") - if conn.getresponse().status == 200: + response = conn.getresponse() + if response.status == 200: break except socket.error as e: - if e[0] not in [61, 111]: + if e.errno not in [61, 111]: raise time.sleep(sleep_amount) else: @@ -670,8 +671,6 @@ def launch_uwsgi(kwargs, tempdir, prefix=DEFAULT_CONFIG_PREFIX, config_object=No "uwsgi", "--http", "%s:%s" % (host, port), - "--pythonpath", - os.path.join(galaxy_root, "lib"), "--yaml", yaml_config_path, "--module", @@ -679,6 +678,9 @@ def launch_uwsgi(kwargs, tempdir, prefix=DEFAULT_CONFIG_PREFIX, config_object=No "--enable-threads", "--die-on-term", ] + for p in sys.path: + uwsgi_command.append('--pythonpath') + uwsgi_command.append(p) handle_uwsgi_cli_command = getattr( config_object, "handle_uwsgi_cli_command", None diff --git a/test/integration/test_mules_as_job_handlers.py b/test/integration/test_mules_as_job_handlers.py index 0fa974caecf..eff39ff2dc5 100644 --- a/test/integration/test_mules_as_job_handlers.py +++ b/test/integration/test_mules_as_job_handlers.py @@ -13,10 +13,11 @@ class _BaseMulesIntegrationTestCase(integration_util.IntegrationTestCase): framework_tool_and_types = True require_uwsgi = True + expected_server_name = 'main.web' def test_runs_on_mule(self): tool_id = 'config_vars' - expect_server_name = 'main.mule' + expect_server_name = self.expected_server_name dataset_populator = DatasetPopulator(self.galaxy_interactor) history_id = dataset_populator.new_history() payload = dataset_populator.run_tool( @@ -38,6 +39,8 @@ class _BaseMulesIntegrationTestCase(integration_util.IntegrationTestCase): @integration_util.skip_if_jenkins class SingleMuleAsJobHandlersIntegrationTestCase(_BaseMulesIntegrationTestCase): + expected_server_name = 'main.job-handlers' + @classmethod def handle_uwsgi_cli_command(cls, command): command.extend([ @@ -50,6 +53,8 @@ class SingleMuleAsJobHandlersIntegrationTestCase(_BaseMulesIntegrationTestCase): @integration_util.skip_if_jenkins class MultipleMulesAsJobHandlersIntegrationTestCase(_BaseMulesIntegrationTestCase): + expected_server_name = 'main.job-handlers' + @classmethod def handle_uwsgi_cli_command(cls, command): command.extend([