mirror of
https://git.yoctoproject.org/poky
synced 2026-09-18 15:49:32 +02:00
oe-build-perf-report: two verbosity levels for --list
(From OE-Core rev: a77066751c81f27332cc16c565dff6a45c173b6c) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
e1f84ea823
commit
1c46fbd628
@@ -82,29 +82,50 @@ def get_test_runs(repo, tag_name, **kwargs):
|
|||||||
# Return field names and a sorted list of revs
|
# Return field names and a sorted list of revs
|
||||||
return undef_fields, sorted(revs)
|
return undef_fields, sorted(revs)
|
||||||
|
|
||||||
def list_test_revs(repo, tag_name, **kwargs):
|
def list_test_revs(repo, tag_name, verbosity, **kwargs):
|
||||||
"""Get list of all tested revisions"""
|
"""Get list of all tested revisions"""
|
||||||
fields, revs = get_test_runs(repo, tag_name, **kwargs)
|
fields, revs = get_test_runs(repo, tag_name, **kwargs)
|
||||||
ignore_fields = ['tag_number']
|
ignore_fields = ['tag_number']
|
||||||
|
if verbosity < 2:
|
||||||
|
extra_fields = ['COMMITS', 'TEST RUNS']
|
||||||
|
ignore_fields.extend(['commit_number', 'commit'])
|
||||||
|
else:
|
||||||
|
extra_fields = ['TEST RUNS']
|
||||||
|
|
||||||
print_fields = [i for i, f in enumerate(fields) if f not in ignore_fields]
|
print_fields = [i for i, f in enumerate(fields) if f not in ignore_fields]
|
||||||
|
|
||||||
# Sort revs
|
# Sort revs
|
||||||
rows = [[fields[i].upper() for i in print_fields] + ['TEST RUNS']]
|
rows = [[fields[i].upper() for i in print_fields] + extra_fields]
|
||||||
prev = [''] * len(revs)
|
|
||||||
|
prev = [''] * len(print_fields)
|
||||||
|
prev_commit = None
|
||||||
|
commit_cnt = 0
|
||||||
|
commit_field = fields.index('commit')
|
||||||
for rev in revs:
|
for rev in revs:
|
||||||
# Only use fields that we want to print
|
# Only use fields that we want to print
|
||||||
rev = [rev[i] for i in print_fields]
|
cols = [rev[i] for i in print_fields]
|
||||||
|
|
||||||
|
|
||||||
|
if cols != prev:
|
||||||
|
commit_cnt = 1
|
||||||
|
test_run_cnt = 1
|
||||||
|
new_row = [''] * (len(print_fields) + len(extra_fields))
|
||||||
|
|
||||||
if rev != prev:
|
|
||||||
new_row = [''] * len(print_fields) + [1]
|
|
||||||
for i in print_fields:
|
for i in print_fields:
|
||||||
if rev[i] != prev[i]:
|
if cols[i] != prev[i]:
|
||||||
break
|
break
|
||||||
new_row[i:-1] = rev[i:]
|
new_row[i:-len(extra_fields)] = cols[i:]
|
||||||
rows.append(new_row)
|
rows.append(new_row)
|
||||||
else:
|
else:
|
||||||
rows[-1][-1] += 1
|
if rev[commit_field] != prev_commit:
|
||||||
prev = rev
|
commit_cnt += 1
|
||||||
|
test_run_cnt += 1
|
||||||
|
|
||||||
|
if verbosity < 2:
|
||||||
|
new_row[-2] = commit_cnt
|
||||||
|
new_row[-1] = test_run_cnt
|
||||||
|
prev = cols
|
||||||
|
prev_commit = rev[commit_field]
|
||||||
|
|
||||||
print_table(rows)
|
print_table(rows)
|
||||||
|
|
||||||
@@ -411,7 +432,7 @@ Examine build performance test results from a Git repository"""
|
|||||||
help="Verbose logging")
|
help="Verbose logging")
|
||||||
parser.add_argument('--repo', '-r', required=True,
|
parser.add_argument('--repo', '-r', required=True,
|
||||||
help="Results repository (local git clone)")
|
help="Results repository (local git clone)")
|
||||||
parser.add_argument('--list', '-l', action='store_true',
|
parser.add_argument('--list', '-l', action='count',
|
||||||
help="List available test runs")
|
help="List available test runs")
|
||||||
parser.add_argument('--html', action='store_true',
|
parser.add_argument('--html', action='store_true',
|
||||||
help="Generate report in html format")
|
help="Generate report in html format")
|
||||||
@@ -447,7 +468,7 @@ def main(argv=None):
|
|||||||
repo = GitRepo(args.repo)
|
repo = GitRepo(args.repo)
|
||||||
|
|
||||||
if args.list:
|
if args.list:
|
||||||
list_test_revs(repo, args.tag_name)
|
list_test_revs(repo, args.tag_name, args.list)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
# Determine hostname which to use
|
# Determine hostname which to use
|
||||||
|
|||||||
Reference in New Issue
Block a user