Skip to content

Commit

Permalink
Merge Tester Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
benedikt-schesch committed Nov 20, 2023
1 parent 5817da5 commit cad8d3a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
Binary file modified results/merges_analyzer_histograms.pdf
Binary file not shown.
24 changes: 21 additions & 3 deletions src/python/merge_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import time
import psutil
import pandas as pd
from repo import Repository, MERGE_TOOL, TEST_STATE
from repo import Repository, MERGE_TOOL, TEST_STATE, MERGE_STATE
from write_head_hashes import num_processes
from cache_utils import slug_repo_name
from tqdm import tqdm
Expand Down Expand Up @@ -71,8 +71,26 @@ def merge_tester(args: Tuple[str, pd.Series, Path]) -> pd.Series:
timeout=TIMEOUT_TESTING_MERGE,
n_tests=N_TESTS,
)
assert left_fingerprint == merge_data["left_tree_fingerprint"]
assert right_fingerprint == merge_data["right_tree_fingerprint"]
if result not in (
MERGE_STATE.Merge_failed,
MERGE_STATE.Git_checkout_failed,
TEST_STATE.Git_checkout_failed,
) and (
left_fingerprint != merge_data["left_tree_fingerprint"]
or right_fingerprint != merge_data["right_tree_fingerprint"]
):
raise Exception(
"merge_tester: The merge tester is not testing the correct merge.",
result,
repo_slug,
merge_data["left"],
merge_data["right"],
left_fingerprint,
right_fingerprint,
merge_data["left_tree_fingerprint"],
merge_data["right_tree_fingerprint"],
merge_data,
)

merge_data[merge_tool.name] = result.name
merge_data[f"{merge_tool.name}_merge_fingerprint"] = merge_fingerprint
Expand Down
4 changes: 2 additions & 2 deletions src/python/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ def stdout_and_stderr(
"""Produces the standard output and standard error of a timedout process."""
explanation = "Run Command: " + " ".join(command) + "\nTimed out"
if source.stdout:
explanation += "\nstdout:\n" + source.stdout.decode("utf-8")
explanation += "\nstdout:\n" + source.stdout.decode("utf-8", "replace")
if source.stderr:
explanation += "\nstderr:\n" + source.stderr.decode("utf-8")
explanation += "\nstderr:\n" + source.stderr.decode("utf-8", "replace")
return explanation


Expand Down

0 comments on commit cad8d3a

Please sign in to comment.