diff --git a/src/dvsim/job/deploy.py b/src/dvsim/job/deploy.py index 71247b85..ca4df349 100644 --- a/src/dvsim/job/deploy.py +++ b/src/dvsim/job/deploy.py @@ -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 @@ -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 @@ -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() @@ -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. @@ -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: """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