mirror of
https://github.com/YosysHQ/sby.git
synced 2025-10-01 23:39:30 +00:00
Add --taskstatus
Used for checking tasks in the status db. Change `SBYStatusDB.all_tasks_status()` to use a `LEFT JOIN` to get a status of `UNKNOWN` for pending or aborted tasks (e.g. because they were ctrl+c'ed).
This commit is contained in:
parent
9589ce203a
commit
cb81a97808
3 changed files with 17 additions and 2 deletions
|
@ -63,6 +63,7 @@ init_config_file = args.init_config_file
|
||||||
status_show = args.status
|
status_show = args.status
|
||||||
status_reset = args.status_reset
|
status_reset = args.status_reset
|
||||||
status_cancels = args.status_cancels
|
status_cancels = args.status_cancels
|
||||||
|
task_status = args.task_status
|
||||||
status_live_csv = args.livecsv
|
status_live_csv = args.livecsv
|
||||||
status_show_csv = args.statuscsv
|
status_show_csv = args.statuscsv
|
||||||
status_latest = args.status_latest
|
status_latest = args.status_latest
|
||||||
|
@ -71,7 +72,7 @@ if autotune and linkmode:
|
||||||
print("ERROR: --link flag currently not available with --autotune")
|
print("ERROR: --link flag currently not available with --autotune")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if status_show or status_reset or status_show_csv:
|
if status_show or status_reset or task_status or status_show_csv:
|
||||||
target = workdir_prefix or workdir or sbyfile
|
target = workdir_prefix or workdir or sbyfile
|
||||||
if target is None:
|
if target is None:
|
||||||
print("ERROR: Specify a .sby config file or working directory to use --status.")
|
print("ERROR: Specify a .sby config file or working directory to use --status.")
|
||||||
|
@ -105,6 +106,9 @@ if status_show or status_reset or status_show_csv:
|
||||||
|
|
||||||
if status_show_csv:
|
if status_show_csv:
|
||||||
status_db.print_status_summary_csv(tasknames, status_latest)
|
status_db.print_status_summary_csv(tasknames, status_latest)
|
||||||
|
|
||||||
|
if task_status:
|
||||||
|
status_db.print_task_summary()
|
||||||
|
|
||||||
status_db.db.close()
|
status_db.db.close()
|
||||||
|
|
||||||
|
|
|
@ -86,6 +86,9 @@ def parser_func(release_version='unknown SBY version'):
|
||||||
parser.add_argument("--statuscancels", action="store_true", dest="status_cancels",
|
parser.add_argument("--statuscancels", action="store_true", dest="status_cancels",
|
||||||
help="intertask cancellations can be triggered by the status database")
|
help="intertask cancellations can be triggered by the status database")
|
||||||
|
|
||||||
|
parser.add_argument("--taskstatus", action="store_true", dest="task_status",
|
||||||
|
help="display the status of tasks in the status database")
|
||||||
|
|
||||||
parser.add_argument("--init-config-file", dest="init_config_file",
|
parser.add_argument("--init-config-file", dest="init_config_file",
|
||||||
help="create a default .sby config file")
|
help="create a default .sby config file")
|
||||||
parser.add_argument("sbyfile", metavar="<jobname>.sby | <dirname>", nargs="?",
|
parser.add_argument("sbyfile", metavar="<jobname>.sby | <dirname>", nargs="?",
|
||||||
|
|
|
@ -301,7 +301,7 @@ class SbyStatusDb:
|
||||||
SELECT task.id, task.name, task.created,
|
SELECT task.id, task.name, task.created,
|
||||||
task_status.status, task_status.created as 'status_created'
|
task_status.status, task_status.created as 'status_created'
|
||||||
FROM task
|
FROM task
|
||||||
INNER JOIN task_status ON task_status.task=task.id
|
LEFT JOIN task_status ON task_status.task=task.id
|
||||||
"""
|
"""
|
||||||
).fetchall()
|
).fetchall()
|
||||||
|
|
||||||
|
@ -399,6 +399,14 @@ class SbyStatusDb:
|
||||||
for display_name, statuses in sorted(properties.items()):
|
for display_name, statuses in sorted(properties.items()):
|
||||||
print(pretty_path(display_name), combine_statuses(statuses))
|
print(pretty_path(display_name), combine_statuses(statuses))
|
||||||
|
|
||||||
|
def print_task_summary(self):
|
||||||
|
tasks = self.all_tasks_status()
|
||||||
|
task_status = defaultdict(set)
|
||||||
|
for task in tasks.values():
|
||||||
|
task_status[task["name"]].add(task["status"] or "UNKNOWN")
|
||||||
|
for task_name, statuses in sorted(task_status.items()):
|
||||||
|
print(task_name, combine_statuses(statuses))
|
||||||
|
|
||||||
def get_status_data_joined(self, status_id: int):
|
def get_status_data_joined(self, status_id: int):
|
||||||
row = self.db.execute(
|
row = self.db.execute(
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue