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

variants: get strip variants from config instead of hard coding them

Now that we have yaml, the sky is the limit.
parent abada82f
No related branches found
No related tags found
No related merge requests found
......@@ -20,7 +20,8 @@
BaseTestSuite,
params_as_kwargs,
median,
REPOS_DIR
REPOS_DIR,
STRIP_VARIANTS,
)
if sys.version_info[0] == 2:
......@@ -28,14 +29,13 @@
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)",
}
STRIP_REVSETS = {}
for key, value in STRIP_VARIANTS.items():
if value is None:
# not sure why tip is the expected value here
STRIP_REVSETS[key] = 'tip'
else:
STRIP_REVSETS[key] = value['remove']
def get_strip_variants():
return ["same", "last-ten", "last-hundred", "last-thousand"]
......
......@@ -10,6 +10,7 @@
import subprocess
import sys
import timeit
import yaml
from functools import wraps
REPO_SUFFIX='.benchrepo'
......@@ -20,10 +21,8 @@
REPOS_DATA = sorted(d for d in os.listdir(REPOS_DIR)
if d.endswith(REPO_SUFFIX))
REPOS = [r[:-len(REPO_SUFFIX)] for r in REPOS_DATA]
# TODO fix
# with open(STRIP_VARIANTS_PATH) as f:
# STRIP_VARIANTS = yaml.load(f.read())["partial-sets"]
with open(STRIP_VARIANTS_PATH) as f:
STRIP_VARIANTS = yaml.load(f.read())["partial-sets"]
class SkipResult(Exception):
pass
......
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