diff --git a/.github/workflows/small-test.yml b/.github/workflows/small-test.yml index 44bf55ba28..dd20bf348d 100644 --- a/.github/workflows/small-test.yml +++ b/.github/workflows/small-test.yml @@ -4,7 +4,7 @@ jobs: test: strategy: matrix: - maven: [ '3.9.2'] + maven: [ '3.9.2' ] runs-on: ubuntu-latest defaults: run: @@ -52,6 +52,7 @@ jobs: maven-version: ${{ matrix.maven }} - name: Clean caches & workspace run: make clean + - run: echo "LOGURU_COLORIZE=NO" >> $GITHUB_ENV - name: Run small test run: | git config --global user.email "example@example.com" diff --git a/README.md b/README.md index 1f8c965c25..b3dec663f1 100644 --- a/README.md +++ b/README.md @@ -215,6 +215,5 @@ To run style checking run `make style`. ## Comparing merge algorithms To investigate differences between two mergers: - * run `src/python/select_from_results.py` to produce a CSV file containing only the differences you are interested in. - * run `` to create a .csv database containing only the differences. + * run `src/python/select_from_results.py` to produce a CSV file containing only the differences you are interested in. See its [documentation (at top of file)](src/python/select_from_results.py) for how to run it. * run `src/python/replay_merge.py --merges_csv CSV_FILE --idx INDEX` (maybe add `-test`) for the index of the merge you are interested in. diff --git a/src/python/replay_merge.py b/src/python/replay_merge.py index 698dcc561a..e4e15b955d 100755 --- a/src/python/replay_merge.py +++ b/src/python/replay_merge.py @@ -52,10 +52,9 @@ def merge_replay( if (WORKDIR_DIRECTORY / workdir).exists(): # Ask the user if they want to delete the workdir - print( - f"workdir {workdir} already exists. Do you want to delete it? (y/n)" + answer = input( + f"workdir {workdir} exists. Delete it (n=reuse it)? (y/n)" ) - answer = input() if answer == "y": shutil.rmtree(WORKDIR_DIRECTORY / workdir) else: @@ -107,7 +106,10 @@ def merge_replay( log_path, repo.local_repo_path, ] - if merge_data[f"{merge_tool.name}_merge_fingerprint"] != merge_fingerprint: + if ( + merge_data[f"{merge_tool.name}_merge_fingerprint"] != merge_fingerprint + and not arguments.dont_check_fingerprints + ): raise Exception( f"fingerprints differ: after merge of {workdir} with {merge_tool}, found" + f" {merge_fingerprint} but expected " @@ -170,7 +172,7 @@ def merge_replay( "--merges_csv", help="CSV file with merges that have been tested", type=str, - default="results/small/result.csv", + default="results/combined/result.csv", ) parser.add_argument( "--idx", @@ -183,11 +185,17 @@ def merge_replay( help="Test the replay of a merge", action="store_true", ) + parser.add_argument( + "--dont_check_fingerprints", + help="Don't check the fingerprint of a merge", + default=False, + action="store_true", + ) arguments = parser.parse_args() # Setup for imports os.system( - "./src/scripts/merge_tools/merging/gradlew -p src/scripts/merge_tools/merging shadowJar" + "./src/scripts/merge_tools/merging/gradlew -q -p src/scripts/merge_tools/merging shadowJar" ) os.environ["PATH"] = os.environ["PATH"] + os.getcwd() + "/src/scripts/merge_tools/:" os.environ["PATH"] = ( diff --git a/src/python/select_from_results.py b/src/python/select_from_results.py index 43045a5688..684937d3d4 100755 --- a/src/python/select_from_results.py +++ b/src/python/select_from_results.py @@ -13,6 +13,10 @@ Here are example invocations: select_from_results.py '(gitmerge_ort == "Merge_failed") and (spork != "Merge_failed")' select_from_results.py '(gitmerge_ort == "Merge_failed") != (spork == "Merge_failed")' + +The resulting .csv is useful for manual examination but cannot be passed to +`replay_merge.py` because that requires a .csv file with all tools and all +fingerprints. """ import argparse @@ -62,9 +66,20 @@ def main(): # Select some columns columns_to_select = ( - ["idx", "repo-idx", "merge-idx", "branch_name", "merge", "left", "right"] + [ + "idx", + "repo-idx", + "merge-idx", + "branch_name", + "merge", + "left", + "left_tree_fingerprint", + "right", + "right_tree_fingerprint", + ] + columns_in_query(args.query) + args.columns + + ["repository"] ) df = df[columns_to_select]