Skip to content
Snippets Groups Projects
Commit d4d456a21b99 authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

setup-base-dir: added a step that clone the necessary repository.

I don't like the index on test, so making optional might be important soon.
parent 4f649a5f3d84
No related branches found
No related tags found
No related merge requests found
......@@ -16,9 +16,10 @@
BIN_ENV_DIR = "bin-envs"
DATA_ENV_DIR = "data-envs"
BENCHMARK_DIR = "benchmarks"
REPOSITORIES_DIR = "repositories"
DIRECTORIES = [
RESULT_DIR,
BIN_ENV_DIR,
DATA_ENV_DIR,
BENCHMARK_DIR,
......@@ -19,9 +20,10 @@
DIRECTORIES = [
RESULT_DIR,
BIN_ENV_DIR,
DATA_ENV_DIR,
BENCHMARK_DIR,
REPOSITORIES_DIR
]
SUITE_DIR = "suites"
......@@ -82,6 +84,27 @@
bash_proxy.chmod(bash_proxy.stat().st_mode | stat.S_IEXEC)
def clone_one_repo(repo_dir, repo_type, url, dest):
dest = repo_dir / dest
if repo_type != "hg":
raise NotImplementedError(repo_type)
clone_hg(url, dest)
def clone_hg(source, dest):
environ = os.environ.copy()
environ["HGRCPATH"] = ""
environ["HGPLAIN"] = ""
command = [
"hg",
"clone",
"--quiet",
source,
dest,
]
subprocess.run(command, check=True)
def setup_base_dir(path):
base_path = Path(path).absolute()
print("Creating folders")
......@@ -103,6 +126,7 @@
b = Path(p).relative_to(base_path)
suite_name = b.name
os.symlink('..' / b, bench / suite_name)
finally:
os.chdir(old_dir)
......@@ -106,6 +130,20 @@
finally:
os.chdir(old_dir)
print("cloning repositories to benchmark")
repos = base_path / REPOSITORIES_DIR
for listing in glob.glob(str(base_path / 'suites' / '*' / 'repositories')):
with open(listing) as f:
for line in f:
line = line.strip()
if not line.startswith('#'):
spec = line.split()
if len(spec) != 3:
msg = "ignoring malformated repository line: %r"
msg %= line
print(msg, file=sys.stderr)
clone_one_repo(repos, *spec)
# TODO HGPERFPATH
......
hg https://foss.heptapod.net/mercurial/mercurial-devel/ mercurial
......@@ -12,6 +12,7 @@
Installing poulpe (editable) into a new venv
Creating a "bin/" directory with some utility
Create symlinks to development Poulpe for suites
cloning repositories to benchmark
Check the resulting dir
=======================
......@@ -21,6 +22,7 @@
bin/
bin-envs/
data-envs/
repositories/
results/
suites@
$ ls -l benchmark-home/benchmarks/
......@@ -65,3 +67,9 @@
$ which poulpe
$TESTTMP/benchmark-home/.venv/bin/poulpe
$ deactivate
check repositories content
--------------------------
$ ls benchmark-home/repositories
mercurial
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