Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Fixes #238

Merged
merged 1 commit into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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