diff --git a/src/python/delete_cache_placeholders.py b/src/python/delete_cache_placeholders.py index 22acd35c11..757a089e75 100755 --- a/src/python/delete_cache_placeholders.py +++ b/src/python/delete_cache_placeholders.py @@ -15,6 +15,7 @@ from argparse import ArgumentParser from pathlib import Path import json +import shutil if __name__ == "__main__": parser = ArgumentParser() @@ -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: diff --git a/src/python/repo.py b/src/python/repo.py index fddbfaa952..0d67f756fa 100755 --- a/src/python/repo.py +++ b/src/python/repo.py @@ -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() diff --git a/src/python/test_repo_heads.py b/src/python/test_repo_heads.py index 1fa8bca13b..093ab3a9d7 100755 --- a/src/python/test_repo_heads.py +++ b/src/python/test_repo_heads.py @@ -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 )