From 5a0217a1f527b1a8ba0471173ee4c1785cbdf201 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 7 Apr 2023 08:02:44 +0200 Subject: [PATCH] Revert pulsar-side stdio redirection It just happened to pass tests in https://github.com/galaxyproject/galaxy/pull/15907 because the test framework looks at the stdio and stderr attributes, which are merged from tool_std{out,err} and job_std{out,err}. It however fails the tests for detect_errors that specifically checks tool_stdout and tool_stderr. I think it is a good idea to let pulsar handle the stdio redirection, but for this to work we'd have to ship parts of the command line to pulsar for final assembly, and that seems like a bigger change. --- lib/galaxy/jobs/command_factory.py | 12 ++++++------ test/integration/test_pulsar_embedded.py | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/galaxy/jobs/command_factory.py b/lib/galaxy/jobs/command_factory.py index 1ca1bc0ee20..10b9c137347 100644 --- a/lib/galaxy/jobs/command_factory.py +++ b/lib/galaxy/jobs/command_factory.py @@ -104,12 +104,12 @@ def build_command( else: commands_builder = CommandsBuilder(externalized_commands) - if not for_pulsar: - # Galaxy writes I/O files to outputs, Pulsar instruments own I/O redirection - io_directory = "../outputs" - commands_builder.capture_stdout_stderr( - f"{io_directory}/tool_stdout", f"{io_directory}/tool_stderr", stream_stdout_stderr=stream_stdout_stderr - ) + # Galaxy writes I/O files to outputs, Pulsar uses metadata. metadata seems like + # it should be preferred - at least if the directory exists. + io_directory = "../metadata" if for_pulsar else "../outputs" + commands_builder.capture_stdout_stderr( + f"{io_directory}/tool_stdout", f"{io_directory}/tool_stderr", stream_stdout_stderr=stream_stdout_stderr + ) # Don't need to create a separate tool working directory for Pulsar # jobs - that is handled by Pulsar. diff --git a/test/integration/test_pulsar_embedded.py b/test/integration/test_pulsar_embedded.py index 0ea983a8a7b..f5af46a75ff 100644 --- a/test/integration/test_pulsar_embedded.py +++ b/test/integration/test_pulsar_embedded.py @@ -36,5 +36,6 @@ test_tools = integration_util.integration_tool_runner( "tool_provided_metadata_9", "simple_constructs_y", "composite_output", + "detect_errors", ] )