Skip to content
Snippets Groups Projects
Commit 86c61cf9729f 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 4b53bc85964f
No related branches found
No related tags found
No related merge requests found
......@@ -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",
......
......@@ -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):
......
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