diff --git a/benchmarks/basic_commands.py b/benchmarks/basic_commands.py index 4b53bc85964f278108463cac3bc073e36668c7a3_YmVuY2htYXJrcy9iYXNpY19jb21tYW5kcy5weQ==..86c61cf9729fe235de131d96c9a0fa38ffa7d10a_YmVuY2htYXJrcy9iYXNpY19jb21tYW5kcy5weQ== 100644 --- a/benchmarks/basic_commands.py +++ b/benchmarks/basic_commands.py @@ -24,6 +24,17 @@ else: import queue +# TODO: don't hardcode +STRIP_REVSETS = {"same": "tip", "last-ten": "last(all(), 10)", "last-hundred": "last(all(), 100)", "last-thousand": "last(all(), 1000)"} + + +def get_strip_variants(): + return ["same", "last-ten", "last-hundred", "last-thousand"] + + +def get_strip_revset(strip): + return STRIP_REVSETS[strip] + class TestSuite(BaseTestSuite): @@ -195,7 +206,7 @@ 'repo_type', 'strip', 'revset'] params = BaseTestSuite.params + [ ['local', 'ssh', 'http'], - ['same', 'last(all(), 10)', 'last(all(), 100)', 'last(all(), 1000)'], + get_strip_variants(), [None, 'default']] timer = timeit.default_timer sample_time = 10 @@ -271,7 +282,7 @@ # debugdiscovery does not support revset argument params = BaseTestSuite.params + [ ['local', 'ssh', 'http'], - ['same', 'last(all(), 10)', 'last(all(), 100)', 'last(all(), 1000)'], + get_strip_variants(), [None]] def time_debugdiscovery(self, *args, **kwargs): @@ -280,7 +291,7 @@ class UnbundleTimeSuite(BaseExchangeTimeSuite): params = BaseTestSuite.params + [ - ['last(all(), 10)', 'last(all(), 100)', 'last(all(), 1000)']] + get_strip_variants()] param_names = BaseTestSuite.param_names + ['strip'] def setup(self, repo_name, strip): @@ -303,7 +314,9 @@ # impact performances metrics self.check_output('sync') - self.hg("bundle", "--base", "not(%s)" % strip, "/tmp/bundle.bundle") + strip_revset = get_strip_revset(strip) + + self.hg("bundle", "--base", "not(%s)" % strip_revset, "/tmp/bundle.bundle") def time_debugunbundle(self, *args, **kwargs): self.run(self.tmp_clone_path, 'unbundle', "/tmp/bundle.bundle", diff --git a/benchmarks/utils.py b/benchmarks/utils.py index 4b53bc85964f278108463cac3bc073e36668c7a3_YmVuY2htYXJrcy91dGlscy5weQ==..86c61cf9729fe235de131d96c9a0fa38ffa7d10a_YmVuY2htYXJrcy91dGlscy5weQ== 100644 --- a/benchmarks/utils.py +++ b/benchmarks/utils.py @@ -8,6 +8,7 @@ from functools import wraps BASEDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)) +STRIP_VARIANTS_PATH = os.path.join(BASEDIR, "partial-sets.yaml") REPOS_DIR = os.path.join(BASEDIR, "repos") REPOS = [d for d in os.listdir(REPOS_DIR) if os.path.isdir(os.path.join(REPOS_DIR, d, ".hg"))] @@ -11,6 +12,9 @@ REPOS_DIR = os.path.join(BASEDIR, "repos") REPOS = [d for d in os.listdir(REPOS_DIR) if os.path.isdir(os.path.join(REPOS_DIR, d, ".hg"))] +# TODO fix +# with open(STRIP_VARIANTS_PATH) as f: +# STRIP_VARIANTS = yaml.load(f.read())["partial-sets"] class SkipResult(Exception):