Skip to content

Commit

Permalink
Make workdir ids unique
Browse files Browse the repository at this point in the history
  • Loading branch information
mernst committed Oct 31, 2023
1 parent fe5b009 commit a8cbded
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
14 changes: 10 additions & 4 deletions src/python/merge_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,20 @@ def merge_analyzer( # pylint: disable=too-many-locals
return merge_data

cache_data = {}
left_sha = merge_data["left"]
right_sha = merge_data["right"]
repo_left = Repository(
repo_slug, cache_directory=cache_directory, workdir_id=merge_data["left"]
repo_slug,
cache_directory=cache_directory,
workdir_id="left-" + left_sha + "-" + right_sha,
)
repo_right = Repository(
repo_slug, cache_directory=cache_directory, workdir_id=merge_data["right"]
repo_slug,
cache_directory=cache_directory,
workdir_id="right-" + left_sha + "-" + right_sha,
)
left_success, _ = repo_left.checkout(merge_data["left"])
right_success, _ = repo_right.checkout(merge_data["right"])
left_success, _ = repo_left.checkout(left_sha)
right_success, _ = repo_right.checkout(right_sha)

# Compute diff size in lines between left and right
assert repo_left.repo_path.exists()
Expand Down
2 changes: 1 addition & 1 deletion src/python/merge_differ.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def get_merge_fingerprint(
repo = Repository(
repo_slug,
cache_directory=cache_directory,
workdir_id="merge-" + left + "-" + right,
workdir_id="merge-differ-" + left + "-" + right,
)
(
merge_status,
Expand Down
4 changes: 3 additions & 1 deletion src/python/merge_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ def merge_tester(args: Tuple[str, pd.Series, Path]) -> pd.Series:
for branch in ["left", "right"]:
commit_sha = merge_data[branch]
repo = Repository(
repo_slug, cache_directory=cache_directory, workdir_id=commit_sha
repo_slug,
cache_directory=cache_directory,
workdir_id="test-" + branch + "-" + commit_sha,
)
test_result, test_coverage, tree_fingerprint = repo.checkout_and_test(
commit_sha, TIMEOUT_TESTING_PARENT, N_TESTS
Expand Down

0 comments on commit a8cbded

Please sign in to comment.