diff --git a/README.md b/README.md index ddb3ed8692..c31b122303 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,13 @@ To execute `run_full.sh` on multiple machines in parallel create a machine addre ./run_multiple_machine.sh main machines.txt ``` +#### If `make small-test` fails + +If `make small-test` fails in a branch that you wish to merge into the main +branch, run `make small-test` in the main branch (which should succeed) and also +in your branch, and investigate the differences. + + ### Load the stored cache To decompress the cache run `make decompress-cache`. This is done automatically in `run_full.sh` if `cache/` does not exist. diff --git a/run.sh b/run.sh index 6fcf56e7bc..1da71605a8 100755 --- a/run.sh +++ b/run.sh @@ -138,7 +138,7 @@ echo "Number of machines: $num_machines" echo "Output directory: $OUT_DIR" echo "Options: $comparator_flags" -./gradlew -q assemble -g ../.gradle/ +JAVA_HOME="$JAVA11_HOME" ./gradlew -q assemble -g ../.gradle/ mkdir -p "$OUT_DIR" @@ -168,7 +168,7 @@ python3 src/python/test_repo_heads.py \ --output_path "$OUT_DIR/repos_head_passes.csv" \ --cache_dir "$CACHE_DIR" -java -cp build/libs/astmergeevaluation-all.jar \ +JAVA_HOME="${JAVA17_HOME}" "${JAVA17_HOME}"/bin/java -cp build/libs/astmergeevaluation-all.jar \ astmergeevaluation.FindMergeCommits \ "$OUT_DIR/repos_head_passes.csv" \ "$OUT_DIR/merges" diff --git a/src/python/cache_utils.py b/src/python/cache_utils.py index ff76b4dd09..1532849405 100755 --- a/src/python/cache_utils.py +++ b/src/python/cache_utils.py @@ -86,7 +86,7 @@ def lookup_in_cache( lock.release() return cache_data if set_run: - logger.debug(f"lookup_in_cache: Setting {cache_key} to None") + logger.debug(f"lookup_in_cache: Setting {cache_key} to None for {repo_slug}") set_in_cache(cache_key, None, repo_slug, cache_directory, acquire_lock=False) lock.release() return None diff --git a/src/python/merge_runtime_measure.py b/src/python/merge_runtime_measure.py index b6977dd1a3..3183e37a7a 100755 --- a/src/python/merge_runtime_measure.py +++ b/src/python/merge_runtime_measure.py @@ -81,7 +81,7 @@ def main(): else: logger.info( f"merge_timer: Running {merge_tool.name} " - f"on {repo_slug} {left_hash} {right_hash}" + f"on {idx} {repo_slug} {left_hash} {right_hash}" ) run_times = [] for _ in range(args.n_timings): diff --git a/src/python/test_repo_heads.py b/src/python/test_repo_heads.py index da31c897aa..61f4129e5e 100755 --- a/src/python/test_repo_heads.py +++ b/src/python/test_repo_heads.py @@ -136,9 +136,9 @@ def head_passes_tests(args: Tuple[pd.Series, Path]) -> pd.Series: logger.info("test_repo_heads: Finished Building Output") logger.success( - "test_repo_heads: Number of repos whose head passes tests:" + "test_repo_heads: Number of repos whose head passes tests: " + str(len(filtered_df)) - + "out of" + + " out of " + str(len(df)) ) if len(filtered_df) == 0: diff --git a/src/python/write_head_hashes.py b/src/python/write_head_hashes.py index 732de1ec6c..a0243aa1ff 100755 --- a/src/python/write_head_hashes.py +++ b/src/python/write_head_hashes.py @@ -77,13 +77,17 @@ def get_latest_hash(args): # If file exists ignore this step if os.path.isfile(arguments.output_path): - logger.info("write_head_hashes: File already exists, skipping") + logger.info( + f"write_head_hashes: File already exists, skipping {arguments.output_path}" + ) sys.exit(0) df = pd.read_csv(arguments.repos_csv, index_col="idx") df["repository"] = df["repository"].str.lower() - logger.info("write_head_hashes: Started cloning repos and collecting head hashes") + logger.info( + "write_head_hashes: Started cloning repos and collecting head hashes for {arguments.output_path}" + ) with multiprocessing.Pool(processes=num_processes()) as pool: with Progress( SpinnerColumn(), diff --git a/src/scripts/merge_tools/git_hires_merge.sh b/src/scripts/merge_tools/git_hires_merge.sh index 19e47d2c88..a91d69cda1 100755 --- a/src/scripts/merge_tools/git_hires_merge.sh +++ b/src/scripts/merge_tools/git_hires_merge.sh @@ -9,7 +9,7 @@ branch2=$3 # Print the current PATH echo "PATH: $PATH" -cd "$clone_dir" || exit 1 +cd "$clone_dir" || (echo "$0: cannot cd to $clone_dir" ; exit 1) git checkout "$branch1" --force diff --git a/src/scripts/merge_tools/gitmerge.sh b/src/scripts/merge_tools/gitmerge.sh index 3aacd86864..0fdbeddd10 100755 --- a/src/scripts/merge_tools/gitmerge.sh +++ b/src/scripts/merge_tools/gitmerge.sh @@ -20,7 +20,7 @@ branch2=$3 strategy=$4 # perform merge -cd "$clone_dir" || exit 1 +cd "$clone_dir" || (echo "$0: cannot cd to $clone_dir" ; exit 1) git checkout "$branch1" --force git config merge.conflictstyle zdiff3 diff --git a/src/scripts/merge_tools/gitmerge_resolve.sh b/src/scripts/merge_tools/gitmerge_resolve.sh index 859faf70e2..5c5965d0bc 100755 --- a/src/scripts/merge_tools/gitmerge_resolve.sh +++ b/src/scripts/merge_tools/gitmerge_resolve.sh @@ -12,7 +12,7 @@ status=$? if [ "$status" -ne 0 ]; then echo "Removing filenames from conflict markers." - cd "$clone_dir" || exit 1 + cd "$clone_dir" || (echo "$0: cannot cd to $clone_dir" ; exit 1) readarray -t files < <(grep -l -r '^\(<<<<<<<\||||||||\|>>>>>>>\) .merge_file_') for file in "${files[@]}" ; do echo "Removing filenames from conflict markers in $file" diff --git a/src/scripts/merge_tools/intellimerge.sh b/src/scripts/merge_tools/intellimerge.sh index 8fd4ccaf47..f1d9deaff8 100755 --- a/src/scripts/merge_tools/intellimerge.sh +++ b/src/scripts/merge_tools/intellimerge.sh @@ -34,7 +34,7 @@ echo "Temp dir: $temp_out_dir" clone_dir_absolutepath=$(realpath "$clone_dir") # run intellimerge -cd "$clone_dir" || exit 1 +cd "$clone_dir" || (echo "$0: cannot cd to $clone_dir" ; exit 1) java -Djava.util.concurrent.ForkJoinPool.common.parallelism=1 -Djava.io.tmpdir="$temp_intellimerge_dir" -jar "$intellimerge_absolutepath" -r "$clone_dir_absolutepath" -b "$branch1" "$branch2" -o $temp_out_dir diff --git a/src/scripts/merge_tools/merge_plumelib.sh b/src/scripts/merge_tools/merge_plumelib.sh index 4000d080c6..ebfe4745a0 100755 --- a/src/scripts/merge_tools/merge_plumelib.sh +++ b/src/scripts/merge_tools/merge_plumelib.sh @@ -10,7 +10,7 @@ merge_strategy=$5 #"--only-adjacent" echo "$0: Merging $branch1 and $branch2 with git_strategy=$git_strategy and merge_strategy=$merge_strategy" -cd "$clone_dir" || exit 1 +cd "$clone_dir" || (echo "$0: cannot cd to $clone_dir" ; exit 1) git checkout "$branch1" --force diff --git a/src/scripts/merge_tools/spork.sh b/src/scripts/merge_tools/spork.sh index 4505403c3d..b652dad3a6 100755 --- a/src/scripts/merge_tools/spork.sh +++ b/src/scripts/merge_tools/spork.sh @@ -26,7 +26,7 @@ clone_dir=$1 branch1=$2 branch2=$3 -cd "$clone_dir" || exit +cd "$clone_dir" || (echo "$0: cannot cd to $clone_dir" ; exit 1) # set up spork driver git config --local merge.spork.name "spork" diff --git a/test/check_equal_csv.py b/test/check_equal_csv.py index 64318e0957..1a47af11e6 100755 --- a/test/check_equal_csv.py +++ b/test/check_equal_csv.py @@ -51,7 +51,10 @@ def remove_run_time(df): if actual_df[col].equals(goal_df[col]): continue # Print the differences. - print(os.system(f"diff {goal_folder/goal_file} {actual_file}")) + diff_exit_code = os.waitstatus_to_exitcode( + os.system(f"diff {goal_folder/goal_file} {actual_file}") + ) + print(f"diff exit code: {diff_exit_code}") # Now print details, after diffs so it is not obscured by the diff output. different_columns = [] for col in goal_df.columns: