diff --git a/gitbug-java b/gitbug-java index 7fc271d..03ae9f5 100755 --- a/gitbug-java +++ b/gitbug-java @@ -101,16 +101,14 @@ class GitBugJavaCli(object): shutil.rmtree(source) os.remove(gitbug) - def __setup_act_cache(self, name: str, download_url: str): + def __setup_act_cache(self, download_url: str): # Download the zip - zip_path = Path(get_project_root(), f"{name}.zip") + zip_path = Path(get_project_root(), "act-cache.zip") if not zip_path.exists(): self.__download(download_url, zip_path) # Extract the zip - cache_path = Path(get_project_root(), name) - cache_path.mkdir(parents=True, exist_ok=True) with zipfile.ZipFile(zip_path, "r") as zip_ref: - zip_ref.extractall(cache_path) + zip_ref.extractall(get_project_root()) os.remove(zip_path) def pids(self): @@ -211,7 +209,6 @@ class GitBugJavaCli(object): "https://zenodo.org/records/10578617/files/gitbug-java_offline_environments_2.tar.gz?download=1", ) self.__setup_act_cache( - "act-cache", "https://zenodo.org/records/10592626/files/act-cache.zip?download=1", ) diff --git a/test/test_all.py b/test/test_all.py index 76a62eb..b0cfd18 100644 --- a/test/test_all.py +++ b/test/test_all.py @@ -23,8 +23,8 @@ def test_help(): def run_bug(bid: str, fixed: bool, act_cache_dir: str = "./act-cache"): # Setup temporary directory - temp_dir = os.path.join(tempfile.gettempdir(), bid, str(uuid.uuid4())) - output_dir = os.path.join(temp_dir, "gitbug-java-output", str(uuid.uuid4())) + temp_dir = Path(tempfile.gettempdir(), bid, str(uuid.uuid4())) + output_dir = Path(temp_dir, ".gitbug-java") try: # Checkout the bug and check correctness @@ -38,15 +38,14 @@ def run_bug(bid: str, fixed: bool, act_cache_dir: str = "./act-cache"): return # Run the bug and check results - run = run_command( - f"gitbug-java run {temp_dir} --act_cache_dir={act_cache_dir} --output={output_dir}" - ) - if not Path(output_dir, f"{bid}.json").exists(): + run = run_command(f"gitbug-java run {temp_dir} --act_cache_dir={act_cache_dir}") + test_results_path = Path(output_dir, "test-results.json") + if not test_results_path.exists(): print(f"{bid} ({fixed}) failed to find report") print(run.stdout.decode("utf-8")) print(run.stderr.decode("utf-8")) return False - with open(os.path.join(output_dir, f"{bid}.json"), "r") as f: + with open(test_results_path, "r") as f: report = json.loads(f.read()) if fixed and run.returncode != 0: