Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 19 additions & 15 deletions pyperformance/_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,17 @@ def _add_sections(self, sections, resolve):
_resolve = resolve_default_benchmark
lastfile = filename

section_key = section
if section == "group":
section_key = (section, data[0])

if filename not in sections_seen:
sections_seen[filename] = {section}
elif section in sections_seen[filename]:
# For now each section can only show up once.
raise NotImplementedError((section, data))
sections_seen[filename] = {section_key}
elif section_key in sections_seen[filename]:
# For now each section_key can only show up once.
raise NotImplementedError((section_key, data))
else:
sections_seen[filename].add(section)
sections_seen[filename].add(section_key)

if section == 'includes':
pass
Expand Down Expand Up @@ -415,20 +419,20 @@ def _resolve_groups(rawgroups, byname):
while unresolved:
for groupname, names in list(unresolved.items()):
benchmarks = set()
for name in names:

q = list(names)
while q:
name = q.pop()

if name in byname:
benchmarks.add(byname[name])
elif name in groups:
benchmarks.update(groups[name])
names.remove(name)
elif name == groupname:
names.remove(name)
break
pass
else: # name in unresolved
names.remove(name)
names.extend(unresolved[name])
break
else:
groups[groupname] = benchmarks
del unresolved[groupname]
q.extend(unresolved[name])

groups[groupname] = benchmarks
del unresolved[groupname]
return groups
2 changes: 1 addition & 1 deletion pyperformance/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def filter_opts(cmd, *, allow_no_benchmarks=False):
cmd.add_argument("--manifest", help="benchmark manifest file to use")

cmd.add_argument("-b", "--benchmarks", metavar="BM_LIST", default='<default>',
help=("Comma-separated list of benchmarks to run. Can"
help=("Comma-separated list of benchmarks or groups to run. Can"
" contain both positive and negative arguments:"
" --benchmarks=run_this,also_this,-not_this. If"
" there are no positive arguments, we'll run all"
Expand Down