From 8f8cd4c90ce12dd6dfcf12296da32c8de39c6f6d Mon Sep 17 00:00:00 2001 From: Michael Ernst Date: Sun, 22 Sep 2024 00:55:34 -0700 Subject: [PATCH] Log tool output (#371) --- src/python/replay_merge.py | 3 ++- src/python/repo.py | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/python/replay_merge.py b/src/python/replay_merge.py index 27991cbd16..d7a12b6b96 100755 --- a/src/python/replay_merge.py +++ b/src/python/replay_merge.py @@ -1,7 +1,8 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- """Replay merges and their test results. -The output appears in the .workdirs/ directory. +The output appears in the `.workdirs`/ directory. +Logs appear in the `replay_logs/merges/` directory. Command-line arguments are listed just after the line: if __name__ == "__main__": diff --git a/src/python/repo.py b/src/python/repo.py index 023a293085..e50b95c422 100755 --- a/src/python/repo.py +++ b/src/python/repo.py @@ -558,13 +558,18 @@ def merge( str(timeout), f"src/scripts/merge_tools/{tool.name}.sh {self.local_repo_path.resolve()} {LEFT_BRANCH_NAME} {RIGHT_BRANCH_NAME}", ] + logger.debug( + f"merge: Merging {self.repo_slug} {left_commit} {right_commit} with {tool.name}" + ) p = subprocess.run( command, capture_output=True, check=False, ) + std_streams = stdout_and_stderr(command, p) + logger.debug(std_streams) if p.returncode == 124: # Timeout - explanation = explanation + "\n" + stdout_and_stderr(command, p) + explanation = explanation + "\n" + std_streams if use_cache: cache_entry["merge status"] = MERGE_STATE.Merge_timedout.name cache_entry["explanation"] = explanation @@ -583,7 +588,7 @@ def merge( -1, ) run_time = time.time() - start_time - explanation = explanation + "\n" + stdout_and_stderr(command, p) + explanation = explanation + "\n" + std_streams merge_status = ( MERGE_STATE.Merge_success if p.returncode == 0 else MERGE_STATE.Merge_failed )