diff --git a/python-libs/poulpe/scheduling.py b/python-libs/poulpe/scheduling.py index ebc14cd7edc5464ceef9bfda6e7ce76a3908ad10_cHl0aG9uLWxpYnMvcG91bHBlL3NjaGVkdWxpbmcucHk=..9875caa93f61b5172542e6b379e2d877cadc9abb_cHl0aG9uLWxpYnMvcG91bHBlL3NjaGVkdWxpbmcucHk= 100644 --- a/python-libs/poulpe/scheduling.py +++ b/python-libs/poulpe/scheduling.py @@ -468,9 +468,8 @@ # TODO make a "poulpe resolve-bin-env-spec"? cmd = [setup_script.resolve(), "--get-unique-id"] + cli_args_list - # Get the actual unique bin-env ID that only the suite can resolve # (because of its dependencies, etc.) res = subprocess.run( cmd, cwd=tmp_target, @@ -472,9 +471,10 @@ # Get the actual unique bin-env ID that only the suite can resolve # (because of its dependencies, etc.) res = subprocess.run( cmd, cwd=tmp_target, - env=env, capture_output=True, + env=env, + capture_output=True, ) try: res.check_returncode() diff --git a/suites/hg/benchmarks/annotate.pbd b/suites/hg/benchmarks/annotate.pbd new file mode 100644 index 0000000000000000000000000000000000000000..9875caa93f61b5172542e6b379e2d877cadc9abb_c3VpdGVzL2hnL2JlbmNobWFya3MvYW5ub3RhdGUucGJk --- /dev/null +++ b/suites/hg/benchmarks/annotate.pbd @@ -0,0 +1,47 @@ +[meta] +format = "0" +name = "hg.command.annotate" +method = "simple-command" + +[run] +copy-data-env = false + +[simple-command] +command = "hg annotate $FILES > /dev/null" +cwd = "DATA-VARS:mercurial.main-repo-path" + +[simple-command.variants.dimensions.files."file-with-long-history.a"] +default = true + +[simple-command.variants.dimensions.files."file-with-long-history.a".environment] +FILES = "DATA-VARS:mercurial.file-with-long-history.a" + +[simple-command.variants.dimensions.files."file-with-long-history.b".environment] +FILES = "DATA-VARS:mercurial.file-with-long-history.b" + +[simple-command.variants.dimensions.files."file-with-long-history.c".environment] +FILES = "DATA-VARS:mercurial.file-with-long-history.c" + +[simple-command.variants.dimensions.files."file-with-long-history.d".environment] +FILES = "DATA-VARS:mercurial.file-with-long-history.d" + +[simple-command.variants.dimensions.files."file-with-long-history.e".environment] +FILES = "DATA-VARS:mercurial.file-with-long-history.e" + +[simple-command.variants.dimensions.follow-copies.yes] +default = true + +[simple-command.variants.dimensions.follow-copies.no] +extend-command = " --no-follow" + +[simple-command.variants.dimensions.files-as-text.yes] +extend-command = " --text" + +[simple-command.variants.dimensions.files-as-text.no] +default = true + +[simple-command.variants.dimensions.listed.default] +default = true + +[simple-command.variants.dimensions.listed.all] +extend-command = " --user --file --date --changeset --line-number" diff --git a/suites/hg/benchmarks/annotate.pkl b/suites/hg/benchmarks/annotate.pkl new file mode 100644 index 0000000000000000000000000000000000000000..9875caa93f61b5172542e6b379e2d877cadc9abb_c3VpdGVzL2hnL2JlbmNobWFya3MvYW5ub3RhdGUucGts --- /dev/null +++ b/suites/hg/benchmarks/annotate.pkl @@ -0,0 +1,36 @@ +amends "lib/simple-command.pkl" +import "lib/variants.pkl" as v + +name = "hg.command.annotate" +copy_data_env = false + +command = "hg annotate $FILES > /dev/null" +cwd = "DATA-VARS:mercurial.main-repo-path" + +variants { + ["files"] = (v.simple_command["file-reading-revs"]) { + default_key = "file-with-long-history.a" + } + ["follow-copies"] { + default_key = "yes" + cases { + ["yes"]{} + ["no"]{extend_command = " --no-follow"} + } + } + ["files-as-text"] { + default_key = "no" + cases { + ["yes"]{extend_command = " --text"} + ["no"]{} + } + } + ["listed"] { + default_key = "default" + cases { + ["default"] {} + ["all"] {extend_command = " --user --file --date --changeset --line-number"} + + } + } +} diff --git a/suites/hg/benchmarks/cat.pbd b/suites/hg/benchmarks/cat.pbd index ebc14cd7edc5464ceef9bfda6e7ce76a3908ad10_c3VpdGVzL2hnL2JlbmNobWFya3MvY2F0LnBiZA==..9875caa93f61b5172542e6b379e2d877cadc9abb_c3VpdGVzL2hnL2JlbmNobWFya3MvY2F0LnBiZA== 100644 --- a/suites/hg/benchmarks/cat.pbd +++ b/suites/hg/benchmarks/cat.pbd @@ -23,9 +23,9 @@ cwd = "DATA-VARS:mercurial.main-repo-path" [simple-command.variants.dimensions.rev.working-copy.environment] -REV = "--rev wdir()" +REV = "-r wdir()" [simple-command.variants.dimensions.rev.tip] default = true [simple-command.variants.dimensions.rev.tip.environment] @@ -27,9 +27,9 @@ [simple-command.variants.dimensions.rev.tip] default = true [simple-command.variants.dimensions.rev.tip.environment] -REV = "--rev tip" +REV = "-r tip" [simple-command.variants.dimensions.rev.default.environment] REV = "" diff --git a/suites/hg/benchmarks/files.pbd b/suites/hg/benchmarks/files.pbd index ebc14cd7edc5464ceef9bfda6e7ce76a3908ad10_c3VpdGVzL2hnL2JlbmNobWFya3MvZmlsZXMucGJk..9875caa93f61b5172542e6b379e2d877cadc9abb_c3VpdGVzL2hnL2JlbmNobWFya3MvZmlsZXMucGJk 100644 --- a/suites/hg/benchmarks/files.pbd +++ b/suites/hg/benchmarks/files.pbd @@ -26,7 +26,7 @@ REV = "" [simple-command.variants.dimensions.rev.tip.environment] -REV = "--rev tip" +REV = "-r tip" [simple-command.variants.dimensions.rev.default] default = true diff --git a/suites/hg/benchmarks/lib/variants.pkl b/suites/hg/benchmarks/lib/variants.pkl index ebc14cd7edc5464ceef9bfda6e7ce76a3908ad10_c3VpdGVzL2hnL2JlbmNobWFya3MvbGliL3ZhcmlhbnRzLnBrbA==..9875caa93f61b5172542e6b379e2d877cadc9abb_c3VpdGVzL2hnL2JlbmNobWFya3MvbGliL3ZhcmlhbnRzLnBrbA== 100644 --- a/suites/hg/benchmarks/lib/variants.pkl +++ b/suites/hg/benchmarks/lib/variants.pkl @@ -139,8 +139,8 @@ cases { ["working-copy"]{ environment { - ["REV"] = "--rev wdir()" + ["REV"] = "-r wdir()" } } ["tip"]{ environment { @@ -143,8 +143,8 @@ } } ["tip"]{ environment { - ["REV"] = "--rev tip" + ["REV"] = "-r tip" } } ["default"]{ @@ -169,6 +169,10 @@ } } } + + // variante providing files patterns to access in a single revision + // + // used for example for `hg cat`, or `hg files` ["rev-reading-files"] { default_key = "all-root" cases { @@ -217,6 +221,21 @@ } } } + // single file that has an interresting file history + // + // to be used by thing like `hg annotate` or `hg log` + ["file-reading-revs"] { + default_key = "all-root" + cases { + for (suffix in List("a", "b", "c", "d", "e")) { + ["file-with-long-history.\(suffix)"] { + environment { + ["FILES"] = "DATA-VARS:mercurial.file-with-long-history.\(suffix)" + } + } + } + } + } // repo state should probably be split into multiple dimensions. // // However, that would be harder to do with the currently limited variant diff --git a/suites/hg/data-env-setup/setup-70-annotate.sh b/suites/hg/data-env-setup/setup-70-annotate.sh new file mode 100755 index 0000000000000000000000000000000000000000..9875caa93f61b5172542e6b379e2d877cadc9abb_c3VpdGVzL2hnL2RhdGEtZW52LXNldHVwL3NldHVwLTcwLWFubm90YXRlLnNo --- /dev/null +++ b/suites/hg/data-env-setup/setup-70-annotate.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# +# Simple script to record the most interesting files for benchmarking annotate +# +# You still have to build the env by hand. +set -Eeuo pipefail + +if [ $# -ne 1 ]; then + echo >&2 "USAGE: setup-70-annotate.sh DATA-ENV-PATH" + echo >&2 " DATA-ENV-PATH: the path to that data-env" + exit 32 +fi + +data_env_directory=$1 +desc="${data_env_directory}/data-env.poulpe" + +repository_path="$(poulpe env-desc get "$desc" bench-input-vars.mercurial.main-repo-path)" + +repo="$data_env_directory/$repository_path" + +INDEX=0 + +suffixes=("a" "b" "c" "d" "e") + +for filename in $( + hg -R "$repo" debug-revlog-stats -f | \ + tail -n +2 | \ + awk '{print $1, $5}' | \ + sort -n | \ + tail -n 5 | \ + cut -f2 -d' ' | \ + tac + ); do + poulpe env-desc set "$desc" \ + "bench-input-vars.mercurial.file-with-long-history.${suffixes[INDEX]}" \ + "$filename" + ((INDEX=INDEX+1)) +done diff --git a/suites/hg/data-env-setup/setup-full.py b/suites/hg/data-env-setup/setup-full.py index ebc14cd7edc5464ceef9bfda6e7ce76a3908ad10_c3VpdGVzL2hnL2RhdGEtZW52LXNldHVwL3NldHVwLWZ1bGwucHk=..9875caa93f61b5172542e6b379e2d877cadc9abb_c3VpdGVzL2hnL2RhdGEtZW52LXNldHVwL3NldHVwLWZ1bGwucHk= 100755 --- a/suites/hg/data-env-setup/setup-full.py +++ b/suites/hg/data-env-setup/setup-full.py @@ -141,6 +141,12 @@ check=True, ) + click.echo("Setting up `annotate` benchmark (can take up to a few minutes)") + subprocess.run( + [SCRIPT_DIR / "setup-70-annotate.sh", data_env], + check=True, + ) + if __name__ == "__main__": setup_full() diff --git a/tests/test-data-env-listing.t b/tests/test-data-env-listing.t index ebc14cd7edc5464ceef9bfda6e7ce76a3908ad10_dGVzdHMvdGVzdC1kYXRhLWVudi1saXN0aW5nLnQ=..9875caa93f61b5172542e6b379e2d877cadc9abb_dGVzdHMvdGVzdC1kYXRhLWVudi1saXN0aW5nLnQ= 100644 --- a/tests/test-data-env-listing.t +++ b/tests/test-data-env-listing.t @@ -34,6 +34,7 @@ Warning: running setup-working-copy without a data brick (non-default working-copy variants will be unavailable) Setting up `delta-find` benchmark (can take a very long time) + Setting up `annotate` benchmark (can take up to a few minutes) Creating the base data-env creating new file: "$TESTTMP/listing-test-den/data-env-2/data-env.poulpe" Registering graph details @@ -42,6 +43,7 @@ Warning: running setup-working-copy without a data brick (non-default working-copy variants will be unavailable) Setting up `delta-find` benchmark (can take a very long time) + Setting up `annotate` benchmark (can take up to a few minutes) Test listing itself =================== diff --git a/tests/test-data-setup.t b/tests/test-data-setup.t index ebc14cd7edc5464ceef9bfda6e7ce76a3908ad10_dGVzdHMvdGVzdC1kYXRhLXNldHVwLnQ=..9875caa93f61b5172542e6b379e2d877cadc9abb_dGVzdHMvdGVzdC1kYXRhLXNldHVwLnQ= 100644 --- a/tests/test-data-setup.t +++ b/tests/test-data-setup.t @@ -111,6 +111,7 @@ Applying hg::working-copy.copy-files with params {'files_pairs_list': 'copied.list'} Applying poulpe::modify-files with params {'files_list': 'modified.list'} Setting up `delta-find` benchmark (can take a very long time) + Setting up `annotate` benchmark (can take up to a few minutes) $ cd my-data-env $ poulpe env-desc show data-env.poulpe @@ -124,6 +125,12 @@ - mercurial.working-copy.modified-and-copied bench-input-vars: mercurial: + file-with-long-history: + a = removed-9 + b = removed-8 + c = removed-7 + d = removed-6 + e = removed-5 main-repo-path = base-repo revlog: delta-find: diff --git a/tests/test-setup-poulpe-den.t b/tests/test-setup-poulpe-den.t index ebc14cd7edc5464ceef9bfda6e7ce76a3908ad10_dGVzdHMvdGVzdC1zZXR1cC1wb3VscGUtZGVuLnQ=..9875caa93f61b5172542e6b379e2d877cadc9abb_dGVzdHMvdGVzdC1zZXR1cC1wb3VscGUtZGVuLnQ= 100644 --- a/tests/test-setup-poulpe-den.t +++ b/tests/test-setup-poulpe-den.t @@ -120,7 +120,7 @@ data environments: [OKAY] available: 0 benchmarks: [OKAY] - available: 28 + available: 29 results: [OKAY] poulpe suites: [OKAY] available bin setup: 2 @@ -137,7 +137,7 @@ data environments: [OKAY] available: 0 benchmarks: [OKAY] - available: 28 + available: 29 results: [OKAY] poulpe suites: [OKAY] available bin setup: 2 diff --git a/tests/test-tasks-consumption.t b/tests/test-tasks-consumption.t index ebc14cd7edc5464ceef9bfda6e7ce76a3908ad10_dGVzdHMvdGVzdC10YXNrcy1jb25zdW1wdGlvbi50..9875caa93f61b5172542e6b379e2d877cadc9abb_dGVzdHMvdGVzdC10YXNrcy1jb25zdW1wdGlvbi50 100644 --- a/tests/test-tasks-consumption.t +++ b/tests/test-tasks-consumption.t @@ -34,6 +34,7 @@ Warning: running setup-working-copy without a data brick (non-default working-copy variants will be unavailable) Setting up `delta-find` benchmark (can take a very long time) + Setting up `annotate` benchmark (can take up to a few minutes) Creating the base data-env creating new file: "$TESTTMP/running-test-den/data-env-2/data-env.poulpe" Registering graph details @@ -42,6 +43,7 @@ Warning: running setup-working-copy without a data brick (non-default working-copy variants will be unavailable) Setting up `delta-find` benchmark (can take a very long time) + Setting up `annotate` benchmark (can take up to a few minutes) Test execution of tasks ======================= diff --git a/tests/test-tasks-generation.t b/tests/test-tasks-generation.t index ebc14cd7edc5464ceef9bfda6e7ce76a3908ad10_dGVzdHMvdGVzdC10YXNrcy1nZW5lcmF0aW9uLnQ=..9875caa93f61b5172542e6b379e2d877cadc9abb_dGVzdHMvdGVzdC10YXNrcy1nZW5lcmF0aW9uLnQ= 100644 --- a/tests/test-tasks-generation.t +++ b/tests/test-tasks-generation.t @@ -46,6 +46,7 @@ Warning: running setup-working-copy without a data brick (non-default working-copy variants will be unavailable) Setting up `delta-find` benchmark (can take a very long time) + Setting up `annotate` benchmark (can take up to a few minutes) Creating the base data-env creating new file: "$TESTTMP/listing-test-den/data-env-2/data-env.poulpe" Registering graph details @@ -54,6 +55,7 @@ Warning: running setup-working-copy without a data brick (non-default working-copy variants will be unavailable) Setting up `delta-find` benchmark (can take a very long time) + Setting up `annotate` benchmark (can take up to a few minutes) Test generation of Tasks ========================