Skip to content

Commit 4b5d01d

Browse files
committed
fix: report item filtering
The `CompletedJobStatus` objects were no longer being filtered by project. So each report page had the entire set of tests. Signed-off-by: James McCorrie <[email protected]>
1 parent ae4f947 commit 4b5d01d

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

src/dvsim/flow/base.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -471,14 +471,25 @@ def gen_results(self, results: Sequence[CompletedJobStatus]) -> None:
471471
472472
"""
473473
for item in self.cfgs:
474+
project = item.name
475+
item_results = [r for r in results if r.project == project]
476+
474477
json_str = (
475-
item._gen_json_results(results) if hasattr(item, "_gen_json_results") else None
478+
item._gen_json_results(item_results) if hasattr(item, "_gen_json_results") else None
479+
)
480+
result = item._gen_results(item_results)
481+
482+
log.info("[results]: [%s]:\n%s\n", project, result)
483+
log.info("[scratch_path]: [%s] [%s]", project, item.scratch_path)
484+
485+
item.write_results(
486+
self.results_html_name,
487+
item.results_md,
488+
json_str=json_str,
476489
)
477-
result = item._gen_results(results)
478-
log.info("[results]: [%s]:\n%s\n", item.name, result)
479-
log.info("[scratch_path]: [%s] [%s]", item.name, item.scratch_path)
480-
item.write_results(self.results_html_name, item.results_md, json_str)
481-
log.verbose("[report]: [%s] [%s/report.html]", item.name, item.results_dir)
490+
491+
log.verbose("[report]: [%s] [%s/report.html]", project, item.results_dir)
492+
482493
self.errors_seen |= item.errors_seen
483494

484495
if self.is_primary_cfg:

src/dvsim/job/data.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ class CompletedJobStatus(BaseModel):
119119

120120
model_config = ConfigDict(frozen=True, extra="forbid")
121121

122+
project: str
123+
"""Name of the project"""
122124
job_type: str
123125
"""Deployment type"""
124126
name: str

src/dvsim/scheduler.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ def on_signal(signal_received: int, _: FrameType | None) -> None:
237237

238238
results.append(
239239
CompletedJobStatus(
240+
project=job_spec.workspace_cfg.project,
240241
job_type=job_spec.job_type,
241242
name=job_spec.name,
242243
seed=job_spec.seed,

0 commit comments

Comments
 (0)