Skip to content

Commit

Permalink
Validate repos refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
benedikt-schesch committed Aug 8, 2023
1 parent e1a9324 commit 808d1ce
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.vscode
venv
**/*_explanation.txt
test_cache/
cache-small/
apache-maven-3.9.2/
results/local_repos.csv
machines.txt
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ clean-cache:

# This target deletes files in the test cache.
clean-test-cache:
rm -rf test_cache
rm -rf cache-small

# This target deletes files that are committed to version control.
clean-stored-hashes:
Expand All @@ -49,7 +49,7 @@ clean-everything: clean clean-cache clean-test-cache clean-stored-hashes
# Compresses the cache.
compress-cache:
rm -r cache.tar
tar --exclude="*explanation.txt" --exclude="*explanation.lock" -czf cache.tar cache
tar --exclude="*explanation.txt" --exclude="*.lock" -czf cache.tar cache

# Decompresses the cache.
decompress-cache:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ To run style checking run `make style`.

* merge_diff_results/ -> Caches the diff results for specific merges.

* test_cache/ -> This folder is a cache for each test computation. contains:
* cache-small/ -> This folder is a cache for each test computation. contains:

* test_result/ -> Caches the test results for a specific commit. Used for parent testing and repo validation.

Expand Down
2 changes: 1 addition & 1 deletion run_small.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
set -e
set -o nounset

./run.sh input_data/repos_small.csv results-small 2 test_cache "$@"
./run.sh input_data/repos_small.csv results-small 2 cache-small "$@"
5 changes: 4 additions & 1 deletion src/python/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"Tests_failed",
"Tests_running",
"Tests_timedout",
"Git_checkout_failed",
],
)

Expand Down Expand Up @@ -150,7 +151,9 @@ def test(self, timeout: int) -> TEST_STATE:
"""
sha = self.compute_tree_fingerprint()
cache_entry_name = sha + ".json"
cache_entry = self.cache_prefix / self.repo_name / cache_entry_name
cache_entry = (
self.cache_prefix / self.repo_name.split("/")[1] / cache_entry_name
)
cache_entry.parent.mkdir(parents=True, exist_ok=True)

lock = fasteners.InterProcessLock(str(cache_entry) + ".lock")
Expand Down

0 comments on commit 808d1ce

Please sign in to comment.