Skip to content
Snippets Groups Projects
Commit fc1af90d authored by Raphaël Gomès's avatar Raphaël Gomès
Browse files

Make the repos directory path configurable.

We currently are limited in the way that tests can be run against
the test data, which has to reside in the same folder.
For reasons of flexibility and/or performance, one might need to
change the filesystem path to the repositories being tested.
This change introduces a new config variable "repodir" which
must contain a valid path. While this path is ran through `os.path.abspath`,
it is recommended to use an absolute path, since the working directory in this context
is not garanteed to be stable.
parent 29598769
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,7 @@
from functools import wraps
from os.path import join
REPO_SUFFIX='.benchrepo'
REPO_SUFFIX = '.benchrepo'
BASEDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))
STRIP_VARIANTS_PATH = os.path.join(BASEDIR, "partial-sets.yaml")
......@@ -19,6 +19,11 @@
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")
def read_configuration(config_path):
# TODO refactor into single util (3 copies of this function exist)
with open(config_path) as config_file:
return yaml.load(config_file.read())
......@@ -23,5 +28,12 @@
repodir = read_configuration(os.path.join(BASEDIR, "config.yaml")).get('repodir')
if repodir:
REPOS_DIR = os.path.abspath(repodir)
else:
REPOS_DIR = os.path.join(BASEDIR, "repos")
with open(STRIP_VARIANTS_PATH) as f:
STRIP_VARIANTS = yaml.load(f.read())["partial-sets"]
......
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