From 83723696c739e5903ce51fe6b02826247eb5bc2b Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Tue, 8 Jul 2025 16:04:45 +1200 Subject: [PATCH] Update failing test Each property can have more than one status, but we only need to test the last one. Also fix the warning about `\c` being an invalid escape. --- tests/statusdb/mixed.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/statusdb/mixed.py b/tests/statusdb/mixed.py index 5daba53..e8995a1 100644 --- a/tests/statusdb/mixed.py +++ b/tests/statusdb/mixed.py @@ -5,7 +5,7 @@ import sys def get_prop_type(prop: str): prop = json.loads(prop or "[]") name_parts = prop[-1].split("_") - if name_parts[0] == "\check": + if name_parts[0] == "\\check": # read_verilog style # \check_cover_mixed_v... return name_parts[1] @@ -24,22 +24,28 @@ def main(): # custom sql to get all task property statuses for the current workdir rows = db.execute( """ - SELECT task.id, task_property.name, task_property.src, task_property_status.status + SELECT task.id, task_property.id, task_property.name, task_property.src, task_property_status.status FROM task LEFT JOIN task_property ON task_property.task=task.id LEFT JOIN task_property_status ON task_property_status.task_property=task_property.id - WHERE task.workdir=:workdir; + WHERE task.workdir=:workdir + ORDER BY task_property_status.id DESC; """, {"workdir": workdir} ).fetchall() # only check the most recent iteration of the test last_id = 0 - for row_id, _, _, _ in rows: + for row_id, _, _, _, _ in rows: if row_id > last_id: last_id = row_id - for row_id, prop, src, status in rows: + # only check the last status of a property + checked_props = set() + for row_id, prop_id, prop, src, status in rows: if row_id != last_id: continue + if prop_id in checked_props: + continue + checked_props.add(prop_id) prop_type = get_prop_type(prop) valid_status: list[None|str] = [] if workdir in ["mixed_bmc", "mixed_assert"] and prop_type == "assert":