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

Add a separate hg update suite with more params

parent f132ac6588cd
No related branches found
No related tags found
Loading
...@@ -171,10 +171,6 @@ ...@@ -171,10 +171,6 @@
time = self._execute("id", "-r", ". ") time = self._execute("id", "-r", ". ")
return time return time
def time_up_tip_100(self, *args, **kwargs):
self._execute("up", "-r", "tip~100")
self._execute("up", "-r", "tip")
class LogTimeTestSuite(object): class LogTimeTestSuite(object):
...@@ -217,3 +213,46 @@ ...@@ -217,3 +213,46 @@
def time_log_history(self, repo, n): def time_log_history(self, repo, n):
self._execute("log", "-r", "tip~%d::" % n) self._execute("log", "-r", "tip~%d::" % n)
class UpdateTimeTestSuite(object):
params = [REPOS, [10, 100, 1000, 10000]]
param_names = ["repo", "changesets"]
def __init__(self):
super(UpdateTimeTestSuite, 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_up_tip(self, repo, n):
self._execute("up", "-r", "tip~%d" % n)
self._execute("up", "-r", "tip")
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