Skip to content
Open
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
16 changes: 11 additions & 5 deletions src/dvsim/job/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from pathlib import Path
from typing import TYPE_CHECKING, ClassVar

from dvsim.flow.base import FlowCfg
from dvsim.job.data import JobSpec, WorkspaceConfig
from dvsim.job.status import JobStatus
from dvsim.job.time import JobTime
Expand Down Expand Up @@ -538,9 +539,9 @@ class RunTest(Deploy):

# Initial seed values when running tests (if available).
target = "run"
seeds = []
seeds: ClassVar[list[int]] = []
fixed_seed = None
cmds_list_vars = ["pre_run_cmds", "post_run_cmds"]
cmds_list_vars: ClassVar[list[str]] = ["pre_run_cmds", "post_run_cmds"]

def __init__(self, index, test, build_job, sim_cfg: "SimCfg") -> None:
self.test_obj = test
Expand Down Expand Up @@ -572,7 +573,12 @@ def __init__(self, index, test, build_job, sim_cfg: "SimCfg") -> None:

# We did something wrong if build_mode is not the same as the build_job
# arg's name.
assert self.build_mode == build_job.name
if self.build_mode != build_job.name:
msg = (
f"Created a build job with name {build_job.name}, when we "
f"expected the name to be {self.build_mode}."
)
raise AssertionError(msg)

def _define_attrs(self) -> None:
super()._define_attrs()
Expand Down Expand Up @@ -678,7 +684,7 @@ def get_seed() -> int:
RunTest.seeds.append(seed)
return RunTest.seeds.pop(0)

def get_timeout_mins(self):
def get_timeout_mins(self) -> float:
"""Return the timeout in minutes.

Limit run jobs to 60 minutes if the timeout is not set.
Expand Down Expand Up @@ -737,7 +743,7 @@ class CovMerge(Deploy):
target = "cov_merge"
weight = 10

def __init__(self, run_items, sim_cfg) -> None:
def __init__(self, run_items: list[RunTest], sim_cfg: FlowCfg) -> None:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: ideally this would be

Suggested change
def __init__(self, run_items: list[RunTest], sim_cfg: FlowCfg) -> None:
def __init__(self, run_items: Iterable[RunTest], sim_cfg: FlowCfg) -> None:

and then later down we would do:

-        self.dependencies += run_items
+        self.dependencies.extend(run_items)

"""Initialise a job deployment to merge coverage databases."""
# Construct the cov_db_dirs right away from the run_items. This is a
# special variable used in the HJson. The coverage associated with
Expand Down
Loading