Skip to content

Commit

Permalink
Bug Fixes (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
benedikt-schesch authored Oct 31, 2023
1 parent c104908 commit 4ec6521
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
9 changes: 7 additions & 2 deletions src/python/delete_cache_placeholders.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from argparse import ArgumentParser
from pathlib import Path
import json
import shutil

if __name__ == "__main__":
parser = ArgumentParser()
Expand All @@ -27,8 +28,12 @@

n_deleted = 0
for file in cache_directory.glob("**/*.json"):
with open(file, "r") as f:
data = json.load(f)
try:
with open(file, "r") as f:
data = json.load(f)
except json.JSONDecodeError:
print(f"Could not read {file}")
file.unlink()

for key in list(data.keys()):
if data[key] is None:
Expand Down
2 changes: 0 additions & 2 deletions src/python/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,9 +572,7 @@ def compute_test_coverage(self) -> float:
"""
jacoco_file = self.repo_path / Path("target/site/jacoco/jacoco.xml")
if not jacoco_file.exists():
print("Jacoco file does not exist", jacoco_file, self.repo_path)
return 0
print("Jacoco file exists", jacoco_file)
tree = ET.parse(jacoco_file)
root = tree.getroot()

Expand Down
6 changes: 5 additions & 1 deletion src/python/test_repo_heads.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ def head_passes_tests(args: Tuple[pd.Series, Path]) -> TEST_STATE:
repo_slug = repo_info["repository"]
print("test_repo_heads:", repo_slug, ": head_passes_tests : started")

repo = Repository(repo_slug, cache_directory=cache)
try:
repo = Repository(repo_slug, cache_directory=cache)
except FileNotFoundError as e:
print("test_repo_heads:", repo_slug, ": head_passes_tests :", e)
return TEST_STATE.Git_checkout_failed
test_state, _, _ = repo.checkout_and_test(
repo_info["head hash"], timeout=TIMEOUT_TESTING, n_tests=3
)
Expand Down

0 comments on commit 4ec6521

Please sign in to comment.