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

Add netlify configuration

parent 2858bf0368b9
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,7 @@
class TestSuite(object):
params = (REPOS)
params = [REPOS]
param_names = ["repo"]
def setup(self, repo_name):
......@@ -34,7 +34,7 @@
timings = []
# Do a first measurement
first_measure = self._single_execute(cmd)\
first_measure = self._single_execute(cmd)
N = int(30 / first_measure)
......@@ -93,7 +93,7 @@
class TimeTestSuite(object):
params = (REPOS)
params = [REPOS]
param_names = ["repo"]
def __init__(self):
......@@ -137,6 +137,9 @@
time = self._execute("status", "--change", "tip")
return time
def bench_command_status(self, *args, **kwargs):
return "status --change tip"
def time_emptydiff(self, *args, **kwargs):
time = self._execute("diff")
return time
......@@ -146,8 +149,7 @@
return time
def time_log_tip(self, *args, **kwargs):
time = self._execute("log", "-r", "tip")
return time
self._execute("log", "-r", "tip")
def time_summary(self, *args, **kwargs):
time = self._execute("summary")
......@@ -168,3 +170,46 @@
def time_id_current(self, *args, **kwargs):
time = self._execute("id", "-r", ". ")
return time
class LogTimeTestSuite(object):
params = [REPOS, [10, 100, 1000, 10000]]
param_names = ["repo", "changesets"]
def __init__(self):
super(LogTimeTestSuite, self).__init__()
self.timer = timeit.default_timer
self.goal_time = 10
def setup(self, repo_name, n):
venv = os.path.abspath(os.path.join(os.path.dirname(sys.executable), ".."))
self.repo_name = repo_name
self.hgpath = os.path.join(venv, "bin", "hg")
self.repo_path = os.path.join(REPOS_DIR, self.repo_name)
def _execute(self, command, *args):
cmd = self._prepare_cmd(command, *args)
try:
return self._single_execute(cmd)
except subprocess.CalledProcessError as error:
print("ERROR OUTPUT", error.output)
raise
def _prepare_cmd(self, command, *args):
cmd = [
self.hgpath,
"--cwd", self.repo_path,
"--traceback",
command,
] + list(args)
return cmd
def _single_execute(self, cmd):
return subprocess.check_output(cmd, stderr=subprocess.STDOUT)
def time_log_history(self, repo, n):
self._execute("log", "-r", "tip~%d::" % n)
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