Skip to content
Snippets Groups Projects
Commit 86c61cf9 authored by Boris Feld's avatar Boris Feld
Browse files

Update bighgperf tests to find its partials repos

Hardcode variants and revset for the moment
parent 4b53bc85
No related branches found
No related tags found
No related merge requests found
...@@ -24,6 +24,17 @@ ...@@ -24,6 +24,17 @@
else: else:
import queue 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): class TestSuite(BaseTestSuite):
...@@ -195,7 +206,7 @@ ...@@ -195,7 +206,7 @@
'repo_type', 'strip', 'revset'] 'repo_type', 'strip', 'revset']
params = BaseTestSuite.params + [ params = BaseTestSuite.params + [
['local', 'ssh', 'http'], ['local', 'ssh', 'http'],
['same', 'last(all(), 10)', 'last(all(), 100)', 'last(all(), 1000)'], get_strip_variants(),
[None, 'default']] [None, 'default']]
timer = timeit.default_timer timer = timeit.default_timer
sample_time = 10 sample_time = 10
...@@ -271,7 +282,7 @@ ...@@ -271,7 +282,7 @@
# debugdiscovery does not support revset argument # debugdiscovery does not support revset argument
params = BaseTestSuite.params + [ params = BaseTestSuite.params + [
['local', 'ssh', 'http'], ['local', 'ssh', 'http'],
['same', 'last(all(), 10)', 'last(all(), 100)', 'last(all(), 1000)'], get_strip_variants(),
[None]] [None]]
def time_debugdiscovery(self, *args, **kwargs): def time_debugdiscovery(self, *args, **kwargs):
...@@ -280,7 +291,7 @@ ...@@ -280,7 +291,7 @@
class UnbundleTimeSuite(BaseExchangeTimeSuite): class UnbundleTimeSuite(BaseExchangeTimeSuite):
params = BaseTestSuite.params + [ params = BaseTestSuite.params + [
['last(all(), 10)', 'last(all(), 100)', 'last(all(), 1000)']] get_strip_variants()]
param_names = BaseTestSuite.param_names + ['strip'] param_names = BaseTestSuite.param_names + ['strip']
def setup(self, repo_name, strip): def setup(self, repo_name, strip):
...@@ -303,7 +314,9 @@ ...@@ -303,7 +314,9 @@
# impact performances metrics # impact performances metrics
self.check_output('sync') 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): def time_debugunbundle(self, *args, **kwargs):
self.run(self.tmp_clone_path, 'unbundle', "/tmp/bundle.bundle", self.run(self.tmp_clone_path, 'unbundle', "/tmp/bundle.bundle",
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
from functools import wraps from functools import wraps
BASEDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)) 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_DIR = os.path.join(BASEDIR, "repos")
REPOS = [d for d in os.listdir(REPOS_DIR) REPOS = [d for d in os.listdir(REPOS_DIR)
if os.path.isdir(os.path.join(REPOS_DIR, d, ".hg"))] if os.path.isdir(os.path.join(REPOS_DIR, d, ".hg"))]
...@@ -11,6 +12,9 @@ ...@@ -11,6 +12,9 @@
REPOS_DIR = os.path.join(BASEDIR, "repos") REPOS_DIR = os.path.join(BASEDIR, "repos")
REPOS = [d for d in os.listdir(REPOS_DIR) REPOS = [d for d in os.listdir(REPOS_DIR)
if os.path.isdir(os.path.join(REPOS_DIR, d, ".hg"))] 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): class SkipResult(Exception):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment