dts: rename execution to test run
PATCH 1/1 dts: rename execution to test run
The configuration containing the combination of:
1. what testbed to use,
2. which tests to run,
3. and what build targets to test
is called an execution. This is confusing since we're using the exact same term to describe other things and execution does not really capture that well the three items listed above.
A new term is thus needed to describe the configuration. Test run is much less confusing and better captures what the configuration contains.
--- doc/guides/tools/dts.rst | 10 +- dts/conf.yaml | 8 +- dts/framework/config/__init__.py | 46 +++--- dts/framework/config/conf_yaml_schema.json | 6 +- dts/framework/config/types.py | 8 +- dts/framework/logger.py | 16 +- dts/framework/runner.py | 170 +++++++++++---------- dts/framework/test_result.py | 70 ++++----- dts/framework/testbed_model/node.py | 38 ++--- dts/tests/TestSuite_pmd_buffer_scatter.py | 2 +- 10 files changed, 193 insertions(+), 181 deletions(-)
doc/guides/tools/dts.rst +5 -5
@@ -198,7 +198,7 @@ and then run the tests with the newly built binaries. Configuring DTS ~~~~~~~~~~~~~~~ -DTS configuration is split into nodes and executions and build targets within executions, +DTS configuration is split into nodes and test runs and build targets within test runs, and follows a defined schema as described in `Configuration Schema`_. By default, DTS will try to use the ``dts/conf.yaml`` :ref:`config file <configuration_schema_example>`, which is a template that illustrates what can be configured in DTS.
@@ -537,12 +537,12 @@ _`Test target` Properties ~~~~~~~~~~ -The configuration requires listing all the execution environments and nodes +The configuration requires listing all the test run environments and nodes involved in the testing. These can be defined with the following mappings: -``executions`` +``test runs`` `sequence <https://docs.python.org/3/library/stdtypes.html#sequence-types-list-tuple-range>`_ listing - the execution environments. Each entry is described as per the following + the test run environments. Each entry is described as per the following `mapping <https://docs.python.org/3/library/stdtypes.html#mapping-types-dict>`_: +----------------------------+-------------------------------------------------------------------+
@@ -637,4 +637,4 @@ And they both have two network ports which are physically connected to each othe .. literalinclude:: ../../../dts/conf.yaml :language: yaml - :start-at: executions: + :start-at: test_runs:
dts/conf.yaml +4 -4
@@ -2,8 +2,8 @@ # Copyright 2022-2023 The DPDK contributors # Copyright 2023 Arm Limited -executions: - # define one execution environment +test_runs: + # define one test run environment - build_targets: - arch: x86_64 os: linux
@@ -20,9 +20,9 @@ executions: # The machine running the DPDK test executable system_under_test_node: node_name: "SUT 1" - vdevs: # optional; if removed, vdevs won't be used in the execution + vdevs: # optional; if removed, vdevs won't be used in the test run - "crypto_openssl" - # Traffic generator node to use for this execution environment + # Traffic generator node to use for this test run traffic_generator_node: "TG 1" nodes: # Define a system under test node, having two network ports physically
dts/framework/config/__init__.py +23 -23
144 lines not on this page · raw message
dts/framework/config/conf_yaml_schema.json +3 -3
@@ -322,7 +322,7 @@ }, "minimum": 1 }, - "executions": { + "test_runs": { "type": "array", "items": { "type": "object",
@@ -366,7 +366,7 @@ "$ref": "#/definitions/node_name" }, "vdevs": { - "description": "Optional list of names of vdevs to be used in execution", + "description": "Optional list of names of vdevs to be used in the test run", "type": "array", "items": { "type": "string"
@@ -395,7 +395,7 @@ } }, "required": [ - "executions", + "test_runs", "nodes" ], "additionalProperties": false
dts/framework/config/types.py +4 -4
@@ -95,7 +95,7 @@ class TestSuiteConfigDict(TypedDict): cases: list[str] -class ExecutionSUTConfigDict(TypedDict): +class TestRunSUTConfigDict(TypedDict): """Allowed keys and values.""" #:
@@ -104,7 +104,7 @@ class ExecutionSUTConfigDict(TypedDict): vdevs: list[str] -class ExecutionConfigDict(TypedDict): +class TestRunConfigDict(TypedDict): """Allowed keys and values.""" #:
@@ -118,7 +118,7 @@ class ExecutionConfigDict(TypedDict): #: test_suites: TestSuiteConfigDict #: - system_under_test_node: ExecutionSUTConfigDict + system_under_test_node: TestRunSUTConfigDict #: traffic_generator_node: str
@@ -129,4 +129,4 @@ class ConfigurationDict(TypedDict): #: nodes: list[NodeConfigDict] #: - executions: list[ExecutionConfigDict] + test_runs: list[TestRunConfigDict]
dts/framework/logger.py +8 -8
@@ -29,23 +29,23 @@ class DtsStage(StrEnum): """The DTS execution stage.""" #: - pre_execution = auto() + pre_run = auto() #: - execution_setup = auto() - #: - execution_teardown = auto() + test_run_setup = auto() #: build_target_setup = auto() #: - build_target_teardown = auto() - #: test_suite_setup = auto() #: test_suite = auto() #: test_suite_teardown = auto() #: - post_execution = auto() + build_target_teardown = auto() + #: + test_run_teardown = auto() + #: + post_run = auto() class DTSLogger(logging.Logger):
@@ -59,7 +59,7 @@ class DTSLogger(logging.Logger): a new stage switch occurs. This is useful mainly for logging per test suite. """ - _stage: ClassVar[DtsStage] = DtsStage.pre_execution + _stage: ClassVar[DtsStage] = DtsStage.pre_run _extra_file_handlers: list[FileHandler] = [] def __init__(self, *args, **kwargs):
dts/framework/runner.py +90 -80
333 lines not on this page · raw message
dts/framework/test_result.py +36 -34
175 lines not on this page · raw message
dts/framework/testbed_model/node.py +19 -19
@@ -19,8 +19,8 @@ from framework.config import ( OS, BuildTargetConfiguration, - ExecutionConfiguration, NodeConfiguration, + TestRunConfiguration, ) from framework.exception import ConfigurationError from framework.logger import DTSLogger, get_dts_logger
@@ -65,7 +65,7 @@ class Node(ABC): ports: list[Port] _logger: DTSLogger _other_sessions: list[OSSession] - _execution_config: ExecutionConfiguration + _test_run_config: TestRunConfiguration virtual_devices: list[VirtualDevice] def __init__(self, node_config: NodeConfiguration):
@@ -103,40 +103,40 @@ def _init_ports(self) -> None: for port in self.ports: self.configure_port_state(port) - def set_up_execution(self, execution_config: ExecutionConfiguration) -> None: - """Execution setup steps. + def set_up_test_run(self, test_run_config: TestRunConfiguration) -> None: + """Test run setup steps. - Configure hugepages and call :meth:`_set_up_execution` where + Configure hugepages and call :meth:`_set_up_test_run` where the rest of the configuration steps (if any) are implemented. Args: - execution_config: The execution test run configuration according to which + test_run_config: A test run configuration according to which the setup steps will be taken. """ self._setup_hugepages() - self._set_up_execution(execution_config) - self._execution_config = execution_config - for vdev in execution_config.vdevs: + self._set_up_test_run(test_run_config) + self._test_run_config = test_run_config + for vdev in test_run_config.vdevs: self.virtual_devices.append(VirtualDevice(vdev)) - def _set_up_execution(self, execution_config: ExecutionConfiguration) -> None: - """Optional additional execution setup steps for subclasses. + def _set_up_test_run(self, test_run_config: TestRunConfiguration) -> None: + """Optional additional test run setup steps for subclasses. - Subclasses should override this if they need to add additional execution setup steps. + Subclasses should override this if they need to add additional test run setup steps. """ - def tear_down_execution(self) -> None: - """Execution teardown steps. + def tear_down_test_run(self) -> None: + """Test run teardown steps. - There are currently no common execution teardown steps common to all DTS node types. + There are currently no common test run teardown steps common to all DTS node types. """ self.virtual_devices = [] - self._tear_down_execution() + self._tear_down_test_run() - def _tear_down_execution(self) -> None: - """Optional additional execution teardown steps for subclasses. + def _tear_down_test_run(self) -> None: + """Optional additional test run teardown steps for subclasses. - Subclasses should override this if they need to add additional execution teardown steps. + Subclasses should override this if they need to add additional test run teardown steps. """ def set_up_build_target(self, build_target_config: BuildTargetConfiguration) -> None:
dts/tests/TestSuite_pmd_buffer_scatter.py +1 -1
@@ -52,7 +52,7 @@ def set_up_suite(self) -> None: """Set up the test suite. Setup: - Verify that we have at least 2 port links in the current execution + Verify that we have at least 2 port links in the current test run and increase the MTU of both ports on the traffic generator to 9000 to support larger packet sizes. """
Signature · 1 line
2.34.1
Hi Juraj!
I am not fussed about naming but I am certainly in favour of making things less confusing, so I am happy with this change.
dts/framework/config/__init__.py class ExecutionConfiguration:
Quoted 13 lines · Juraj Linkeš
@staticmethod def from_dict(dts/framework/config/__init__.py +3
-3- d: ExecutionConfigDict, + d: TestRunConfigDict, node_map: dict[str, Union[SutNodeConfiguration | TGNodeConfiguration]], - ) -> "ExecutionConfiguration": + ) -> "TestRunConfiguration": - def copy_and_modify(self, **kwargs) -> "ExecutionConfiguration": + def copy_and_modify(self, **kwargs) -> "TestRunConfiguration": @staticmethod def from_dict(d: ConfigurationDict) -> "Configuration":
Unrelated, but spark for an improvement. I have noticed these, not sure if there are more instances in the code. Shouldn't from_dict be a @classmethod instead of @staticmethod. In which case you could also use:
from typing_extensions import Self
to replace all the class literals, example:
@classmethod
def from_dict(cls, d, node_map): -> Self:
...
return cls(...) # initialise class with cls
...
def copy_and_modify(self, **kwargs) -> Self:
Quoted 6 lines · Luca Vizzarro
Hi Juraj!
I am not fussed about naming but I am certainly in favour of making things less confusing, so I am happy with this change.
Yes, using execution in this context is very confusing. The main thing with this patch is to find the best replacement. If you're ok with the new name or can't think of a (even potentially) better name, that's all we need. :-)
Quoted 23 lines · Juraj Linkeš
dts/framework/config/__init__.py class ExecutionConfiguration:
Quoted 13 lines
@staticmethod def from_dict(dts/framework/config/__init__.py +3
-3- d: ExecutionConfigDict, + d: TestRunConfigDict, node_map: dict[str, Union[SutNodeConfiguration | TGNodeConfiguration]], - ) -> "ExecutionConfiguration": + ) -> "TestRunConfiguration": - def copy_and_modify(self, **kwargs) -> "ExecutionConfiguration": + def copy_and_modify(self, **kwargs) -> "TestRunConfiguration": @staticmethod def from_dict(d: ConfigurationDict) -> "Configuration":Unrelated, but spark for an improvement. I have noticed these, not sure if there are more instances in the code. Shouldn't
from_dictbe a @classmethod instead of @staticmethod. In which case you could also use:from
typing_extensionsimport Selfto replace all the class literals, example:
Quoted 8 lines
@classmethod
def from_dict(cls, d, node_map): -> Self:
...
return cls(...) # initialise class with cls
...
def copy_and_modify(self, **kwargs) -> Self:There are many of these from_dict methods. Maybe we should just put the logic into __init__ and not use the constructors generated by the dataclass decorator. Or we could also use your suggestion. I don't know that they should be class methods, it doesn't make that much of a difference (is there an appreciable one? Apart from the nicer typing). It's worth making a bugzilla ticket for this though.
+1 for the new name, "execution" in the scope of the config file gets very confusing when people start talking about their individual runs or "executions" of the dts runner. I think test runs will serve as a much more specific name.
PATCH v2 1/1 dts: rename execution to test run
In reply to Juraj LinkešThe configuration containing the combination of:
1. what testbed to use,
2. which tests to run,
3. and what build targets to test
is called an execution. This is confusing since we're using the exact same term to describe other things and execution does not really capture that well the three items listed above.
A new term is thus needed to describe the configuration. Test run is much less confusing and better captures what the configuration contains.
--- doc/guides/tools/dts.rst | 10 +- dts/conf.yaml | 8 +- dts/framework/config/__init__.py | 38 ++--- dts/framework/config/conf_yaml_schema.json | 6 +- dts/framework/config/types.py | 8 +- dts/framework/logger.py | 16 +- dts/framework/runner.py | 170 +++++++++++---------- dts/framework/test_result.py | 70 ++++----- dts/framework/testbed_model/node.py | 38 ++--- dts/tests/TestSuite_pmd_buffer_scatter.py | 2 +- 10 files changed, 189 insertions(+), 177 deletions(-)
doc/guides/tools/dts.rst +5 -5
@@ -198,7 +198,7 @@ and then run the tests with the newly built binaries. Configuring DTS ~~~~~~~~~~~~~~~ -DTS configuration is split into nodes and executions and build targets within executions, +DTS configuration is split into nodes and test runs and build targets within test runs, and follows a defined schema as described in `Configuration Schema`_. By default, DTS will try to use the ``dts/conf.yaml`` :ref:`config file <configuration_schema_example>`, which is a template that illustrates what can be configured in DTS.
@@ -505,12 +505,12 @@ _`Test target` Properties ~~~~~~~~~~ -The configuration requires listing all the execution environments and nodes +The configuration requires listing all the test run environments and nodes involved in the testing. These can be defined with the following mappings: -``executions`` +``test runs`` `sequence <https://docs.python.org/3/library/stdtypes.html#sequence-types-list-tuple-range>`_ listing - the execution environments. Each entry is described as per the following + the test run environments. Each entry is described as per the following `mapping <https://docs.python.org/3/library/stdtypes.html#mapping-types-dict>`_: +----------------------------+-------------------------------------------------------------------+
@@ -605,4 +605,4 @@ And they both have two network ports which are physically connected to each othe .. literalinclude:: ../../../dts/conf.yaml :language: yaml - :start-at: executions: + :start-at: test_runs:
dts/conf.yaml +4 -4
@@ -2,8 +2,8 @@ # Copyright 2022-2023 The DPDK contributors # Copyright 2023 Arm Limited -executions: - # define one execution environment +test_runs: + # define one test run environment - build_targets: - arch: x86_64 os: linux
@@ -20,9 +20,9 @@ executions: # The machine running the DPDK test executable system_under_test_node: node_name: "SUT 1" - vdevs: # optional; if removed, vdevs won't be used in the execution + vdevs: # optional; if removed, vdevs won't be used in the test run - "crypto_openssl" - # Traffic generator node to use for this execution environment + # Traffic generator node to use for this test run traffic_generator_node: "TG 1" nodes: # Define a system under test node, having two network ports physically
dts/framework/config/__init__.py +19 -19
@@ -16,7 +16,7 @@ The test run configuration has two main sections: - * The :class:`ExecutionConfiguration` which defines what tests are going to be run + * The :class:`TestRunConfiguration` which defines what tests are going to be run and how DPDK will be built. It also references the testbed where these tests and DPDK are going to be run, * The nodes of the testbed are defined in the other section,
@@ -47,9 +47,9 @@ from framework.config.types import ( BuildTargetConfigDict, ConfigurationDict, - ExecutionConfigDict, NodeConfigDict, PortConfigDict, + TestRunConfigDict, TestSuiteConfigDict, TrafficGeneratorConfigDict, )
@@ -430,8 +430,8 @@ def from_dict( @dataclass(slots=True, frozen=True) -class ExecutionConfiguration: - """The configuration of an execution. +class TestRunConfiguration: + """The configuration of a test run. The configuration contains testbed information, what tests to execute and with what DPDK build.
@@ -442,8 +442,8 @@ class ExecutionConfiguration: func: Whether to run functional tests. skip_smoke_tests: Whether to skip smoke tests. test_suites: The names of test suites and/or test cases to execute. - system_under_test_node: The SUT node to use in this execution. - traffic_generator_node: The TG node to use in this execution. + system_under_test_node: The SUT node to use in this test run. + traffic_generator_node: The TG node to use in this test run. vdevs: The names of virtual devices to test. """
@@ -459,7 +459,7 @@ class ExecutionConfiguration: @classmethod def from_dict( cls, - d: ExecutionConfigDict, + d: TestRunConfigDict, node_map: dict[str, SutNodeConfiguration | TGNodeConfiguration], ) -> Self: """A convenience method that processes the inputs before creating an instance.
@@ -469,11 +469,11 @@ def from_dict( are just stored. Args: - d: The configuration dictionary. + d: The test run configuration dictionary. node_map: A dictionary mapping node names to their config objects. Returns: - The execution configuration instance. + The test run configuration instance. """ build_targets: list[BuildTargetConfiguration] = list( map(BuildTargetConfiguration.from_dict, d["build_targets"])
@@ -481,14 +481,14 @@ def from_dict( test_suites: list[TestSuiteConfig] = list(map(TestSuiteConfig.from_dict, d["test_suites"])) sut_name = d["system_under_test_node"]["node_name"] skip_smoke_tests = d.get("skip_smoke_tests", False) - assert sut_name in node_map, f"Unknown SUT {sut_name} in execution {d}" + assert sut_name in node_map, f"Unknown SUT {sut_name} in test run {d}" system_under_test_node = node_map[sut_name] assert isinstance( system_under_test_node, SutNodeConfiguration ), f"Invalid SUT configuration {system_under_test_node}" tg_name = d["traffic_generator_node"] - assert tg_name in node_map, f"Unknown TG {tg_name} in execution {d}" + assert tg_name in node_map, f"Unknown TG {tg_name} in test run {d}" traffic_generator_node = node_map[tg_name] assert isinstance( traffic_generator_node, TGNodeConfiguration
@@ -516,10 +516,10 @@ def copy_and_modify(self, **kwargs) -> Self: Args: **kwargs: The names and types of keyword arguments are defined - by the fields of the :class:`ExecutionConfiguration` class. + by the fields of the :class:`TestRunConfiguration` class. Returns: - The copied and modified execution configuration. + The copied and modified test run configuration. """ new_config = {} for field in fields(self):
@@ -536,13 +536,13 @@ class Configuration: """DTS testbed and test configuration. The node configuration is not stored in this object. Rather, all used node configurations - are stored inside the execution configuration where the nodes are actually used. + are stored inside the test run configuration where the nodes are actually used. Attributes: - executions: Execution configurations. + test_runs: Test run configurations. """ - executions: list[ExecutionConfiguration] + test_runs: list[TestRunConfiguration] @classmethod def from_dict(cls, d: ConfigurationDict) -> Self:
@@ -566,11 +566,11 @@ def from_dict(cls, d: ConfigurationDict) -> Self: node_map = {node.name: node for node in nodes} assert len(nodes) == len(node_map), "Duplicate node names are not allowed" - executions: list[ExecutionConfiguration] = list( - map(ExecutionConfiguration.from_dict, d["executions"], [node_map for _ in d]) + test_runs: list[TestRunConfiguration] = list( + map(TestRunConfiguration.from_dict, d["test_runs"], [node_map for _ in d]) ) - return cls(executions=executions) + return cls(test_runs=test_runs) def load_config(config_file_path: Path) -> Configuration:
dts/framework/config/conf_yaml_schema.json +3 -3
@@ -322,7 +322,7 @@ }, "minimum": 1 }, - "executions": { + "test_runs": { "type": "array", "items": { "type": "object",
@@ -366,7 +366,7 @@ "$ref": "#/definitions/node_name" }, "vdevs": { - "description": "Optional list of names of vdevs to be used in execution", + "description": "Optional list of names of vdevs to be used in the test run", "type": "array", "items": { "type": "string"
@@ -395,7 +395,7 @@ } }, "required": [ - "executions", + "test_runs", "nodes" ], "additionalProperties": false
dts/framework/config/types.py +4 -4
@@ -95,7 +95,7 @@ class TestSuiteConfigDict(TypedDict): cases: list[str] -class ExecutionSUTConfigDict(TypedDict): +class TestRunSUTConfigDict(TypedDict): """Allowed keys and values.""" #:
@@ -104,7 +104,7 @@ class ExecutionSUTConfigDict(TypedDict): vdevs: list[str] -class ExecutionConfigDict(TypedDict): +class TestRunConfigDict(TypedDict): """Allowed keys and values.""" #:
@@ -118,7 +118,7 @@ class ExecutionConfigDict(TypedDict): #: test_suites: TestSuiteConfigDict #: - system_under_test_node: ExecutionSUTConfigDict + system_under_test_node: TestRunSUTConfigDict #: traffic_generator_node: str
@@ -129,4 +129,4 @@ class ConfigurationDict(TypedDict): #: nodes: list[NodeConfigDict] #: - executions: list[ExecutionConfigDict] + test_runs: list[TestRunConfigDict]
dts/framework/logger.py +8 -8
@@ -29,23 +29,23 @@ class DtsStage(StrEnum): """The DTS execution stage.""" #: - pre_execution = auto() + pre_run = auto() #: - execution_setup = auto() - #: - execution_teardown = auto() + test_run_setup = auto() #: build_target_setup = auto() #: - build_target_teardown = auto() - #: test_suite_setup = auto() #: test_suite = auto() #: test_suite_teardown = auto() #: - post_execution = auto() + build_target_teardown = auto() + #: + test_run_teardown = auto() + #: + post_run = auto() class DTSLogger(logging.Logger):
@@ -59,7 +59,7 @@ class DTSLogger(logging.Logger): a new stage switch occurs. This is useful mainly for logging per test suite. """ - _stage: ClassVar[DtsStage] = DtsStage.pre_execution + _stage: ClassVar[DtsStage] = DtsStage.pre_run _extra_file_handlers: list[FileHandler] = [] def __init__(self, *args, **kwargs):
dts/framework/runner.py +90 -80
333 lines not on this page · raw message
dts/framework/test_result.py +36 -34
175 lines not on this page · raw message
dts/framework/testbed_model/node.py +19 -19
@@ -19,8 +19,8 @@ from framework.config import ( OS, BuildTargetConfiguration, - ExecutionConfiguration, NodeConfiguration, + TestRunConfiguration, ) from framework.exception import ConfigurationError from framework.logger import DTSLogger, get_dts_logger
@@ -65,7 +65,7 @@ class Node(ABC): ports: list[Port] _logger: DTSLogger _other_sessions: list[OSSession] - _execution_config: ExecutionConfiguration + _test_run_config: TestRunConfiguration virtual_devices: list[VirtualDevice] def __init__(self, node_config: NodeConfiguration):
@@ -103,40 +103,40 @@ def _init_ports(self) -> None: for port in self.ports: self.configure_port_state(port) - def set_up_execution(self, execution_config: ExecutionConfiguration) -> None: - """Execution setup steps. + def set_up_test_run(self, test_run_config: TestRunConfiguration) -> None: + """Test run setup steps. - Configure hugepages and call :meth:`_set_up_execution` where + Configure hugepages and call :meth:`_set_up_test_run` where the rest of the configuration steps (if any) are implemented. Args: - execution_config: The execution test run configuration according to which + test_run_config: A test run configuration according to which the setup steps will be taken. """ self._setup_hugepages() - self._set_up_execution(execution_config) - self._execution_config = execution_config - for vdev in execution_config.vdevs: + self._set_up_test_run(test_run_config) + self._test_run_config = test_run_config + for vdev in test_run_config.vdevs: self.virtual_devices.append(VirtualDevice(vdev)) - def _set_up_execution(self, execution_config: ExecutionConfiguration) -> None: - """Optional additional execution setup steps for subclasses. + def _set_up_test_run(self, test_run_config: TestRunConfiguration) -> None: + """Optional additional test run setup steps for subclasses. - Subclasses should override this if they need to add additional execution setup steps. + Subclasses should override this if they need to add additional test run setup steps. """ - def tear_down_execution(self) -> None: - """Execution teardown steps. + def tear_down_test_run(self) -> None: + """Test run teardown steps. - There are currently no common execution teardown steps common to all DTS node types. + There are currently no common test run teardown steps common to all DTS node types. """ self.virtual_devices = [] - self._tear_down_execution() + self._tear_down_test_run() - def _tear_down_execution(self) -> None: - """Optional additional execution teardown steps for subclasses. + def _tear_down_test_run(self) -> None: + """Optional additional test run teardown steps for subclasses. - Subclasses should override this if they need to add additional execution teardown steps. + Subclasses should override this if they need to add additional test run teardown steps. """ def set_up_build_target(self, build_target_config: BuildTargetConfiguration) -> None:
dts/tests/TestSuite_pmd_buffer_scatter.py +1 -1
@@ -52,7 +52,7 @@ def set_up_suite(self) -> None: """Set up the test suite. Setup: - Verify that we have at least 2 port links in the current execution + Verify that we have at least 2 port links in the current test run and increase the MTU of both ports on the traffic generator to 9000 to support larger packet sizes. """
Signature · 1 line
2.34.1
PATCH v3 1/1 dts: rename execution to test run
In reply to Juraj LinkešThe configuration containing the combination of:
1. what testbed to use,
2. which tests to run,
3. and what build targets to test
is called an execution. This is confusing since we're using the exact same term to describe other things and execution does not really capture that well the three items listed above.
A new term is thus needed to describe the configuration. Test run is much less confusing and better captures what the configuration contains.
Depends-on: series-32026 ("dts: update mypy and clean up")
--- doc/guides/tools/dts.rst | 10 +- dts/conf.yaml | 8 +- dts/framework/config/__init__.py | 38 ++--- dts/framework/config/conf_yaml_schema.json | 6 +- dts/framework/config/types.py | 8 +- dts/framework/logger.py | 16 +- dts/framework/runner.py | 170 +++++++++++---------- dts/framework/test_result.py | 70 ++++----- dts/framework/testbed_model/node.py | 38 ++--- dts/tests/TestSuite_pmd_buffer_scatter.py | 2 +- 10 files changed, 189 insertions(+), 177 deletions(-)
doc/guides/tools/dts.rst +5 -5
@@ -198,7 +198,7 @@ and then run the tests with the newly built binaries. Configuring DTS ~~~~~~~~~~~~~~~ -DTS configuration is split into nodes and executions and build targets within executions, +DTS configuration is split into nodes and test runs and build targets within test runs, and follows a defined schema as described in `Configuration Schema`_. By default, DTS will try to use the ``dts/conf.yaml`` :ref:`config file <configuration_schema_example>`, which is a template that illustrates what can be configured in DTS.
@@ -505,12 +505,12 @@ _`Test target` Properties ~~~~~~~~~~ -The configuration requires listing all the execution environments and nodes +The configuration requires listing all the test run environments and nodes involved in the testing. These can be defined with the following mappings: -``executions`` +``test runs`` `sequence <https://docs.python.org/3/library/stdtypes.html#sequence-types-list-tuple-range>`_ listing - the execution environments. Each entry is described as per the following + the test run environments. Each entry is described as per the following `mapping <https://docs.python.org/3/library/stdtypes.html#mapping-types-dict>`_: +----------------------------+-------------------------------------------------------------------+
@@ -605,4 +605,4 @@ And they both have two network ports which are physically connected to each othe .. literalinclude:: ../../../dts/conf.yaml :language: yaml - :start-at: executions: + :start-at: test_runs:
dts/conf.yaml +4 -4
@@ -2,8 +2,8 @@ # Copyright 2022-2023 The DPDK contributors # Copyright 2023 Arm Limited -executions: - # define one execution environment +test_runs: + # define one test run environment - build_targets: - arch: x86_64 os: linux
@@ -20,9 +20,9 @@ executions: # The machine running the DPDK test executable system_under_test_node: node_name: "SUT 1" - vdevs: # optional; if removed, vdevs won't be used in the execution + vdevs: # optional; if removed, vdevs won't be used in the test run - "crypto_openssl" - # Traffic generator node to use for this execution environment + # Traffic generator node to use for this test run traffic_generator_node: "TG 1" nodes: # Define a system under test node, having two network ports physically
dts/framework/config/__init__.py +19 -19
@@ -16,7 +16,7 @@ The test run configuration has two main sections: - * The :class:`ExecutionConfiguration` which defines what tests are going to be run + * The :class:`TestRunConfiguration` which defines what tests are going to be run and how DPDK will be built. It also references the testbed where these tests and DPDK are going to be run, * The nodes of the testbed are defined in the other section,
@@ -47,9 +47,9 @@ from framework.config.types import ( BuildTargetConfigDict, ConfigurationDict, - ExecutionConfigDict, NodeConfigDict, PortConfigDict, + TestRunConfigDict, TestSuiteConfigDict, TrafficGeneratorConfigDict, )
@@ -430,8 +430,8 @@ def from_dict( @dataclass(slots=True, frozen=True) -class ExecutionConfiguration: - """The configuration of an execution. +class TestRunConfiguration: + """The configuration of a test run. The configuration contains testbed information, what tests to execute and with what DPDK build.
@@ -442,8 +442,8 @@ class ExecutionConfiguration: func: Whether to run functional tests. skip_smoke_tests: Whether to skip smoke tests. test_suites: The names of test suites and/or test cases to execute. - system_under_test_node: The SUT node to use in this execution. - traffic_generator_node: The TG node to use in this execution. + system_under_test_node: The SUT node to use in this test run. + traffic_generator_node: The TG node to use in this test run. vdevs: The names of virtual devices to test. """
@@ -459,7 +459,7 @@ class ExecutionConfiguration: @classmethod def from_dict( cls, - d: ExecutionConfigDict, + d: TestRunConfigDict, node_map: dict[str, SutNodeConfiguration | TGNodeConfiguration], ) -> Self: """A convenience method that processes the inputs before creating an instance.
@@ -469,11 +469,11 @@ def from_dict( are just stored. Args: - d: The configuration dictionary. + d: The test run configuration dictionary. node_map: A dictionary mapping node names to their config objects. Returns: - The execution configuration instance. + The test run configuration instance. """ build_targets: list[BuildTargetConfiguration] = list( map(BuildTargetConfiguration.from_dict, d["build_targets"])
@@ -481,14 +481,14 @@ def from_dict( test_suites: list[TestSuiteConfig] = list(map(TestSuiteConfig.from_dict, d["test_suites"])) sut_name = d["system_under_test_node"]["node_name"] skip_smoke_tests = d.get("skip_smoke_tests", False) - assert sut_name in node_map, f"Unknown SUT {sut_name} in execution {d}" + assert sut_name in node_map, f"Unknown SUT {sut_name} in test run {d}" system_under_test_node = node_map[sut_name] assert isinstance( system_under_test_node, SutNodeConfiguration ), f"Invalid SUT configuration {system_under_test_node}" tg_name = d["traffic_generator_node"] - assert tg_name in node_map, f"Unknown TG {tg_name} in execution {d}" + assert tg_name in node_map, f"Unknown TG {tg_name} in test run {d}" traffic_generator_node = node_map[tg_name] assert isinstance( traffic_generator_node, TGNodeConfiguration
@@ -516,10 +516,10 @@ def copy_and_modify(self, **kwargs) -> Self: Args: **kwargs: The names and types of keyword arguments are defined - by the fields of the :class:`ExecutionConfiguration` class. + by the fields of the :class:`TestRunConfiguration` class. Returns: - The copied and modified execution configuration. + The copied and modified test run configuration. """ new_config = {} for field in fields(self):
@@ -536,13 +536,13 @@ class Configuration: """DTS testbed and test configuration. The node configuration is not stored in this object. Rather, all used node configurations - are stored inside the execution configuration where the nodes are actually used. + are stored inside the test run configuration where the nodes are actually used. Attributes: - executions: Execution configurations. + test_runs: Test run configurations. """ - executions: list[ExecutionConfiguration] + test_runs: list[TestRunConfiguration] @classmethod def from_dict(cls, d: ConfigurationDict) -> Self:
@@ -566,11 +566,11 @@ def from_dict(cls, d: ConfigurationDict) -> Self: node_map = {node.name: node for node in nodes} assert len(nodes) == len(node_map), "Duplicate node names are not allowed" - executions: list[ExecutionConfiguration] = list( - map(ExecutionConfiguration.from_dict, d["executions"], [node_map for _ in d]) + test_runs: list[TestRunConfiguration] = list( + map(TestRunConfiguration.from_dict, d["test_runs"], [node_map for _ in d]) ) - return cls(executions=executions) + return cls(test_runs=test_runs) def load_config(config_file_path: Path) -> Configuration:
dts/framework/config/conf_yaml_schema.json +3 -3
@@ -322,7 +322,7 @@ }, "minimum": 1 }, - "executions": { + "test_runs": { "type": "array", "items": { "type": "object",
@@ -366,7 +366,7 @@ "$ref": "#/definitions/node_name" }, "vdevs": { - "description": "Optional list of names of vdevs to be used in execution", + "description": "Optional list of names of vdevs to be used in the test run", "type": "array", "items": { "type": "string"
@@ -395,7 +395,7 @@ } }, "required": [ - "executions", + "test_runs", "nodes" ], "additionalProperties": false
dts/framework/config/types.py +4 -4
@@ -95,7 +95,7 @@ class TestSuiteConfigDict(TypedDict): cases: list[str] -class ExecutionSUTConfigDict(TypedDict): +class TestRunSUTConfigDict(TypedDict): """Allowed keys and values.""" #:
@@ -104,7 +104,7 @@ class ExecutionSUTConfigDict(TypedDict): vdevs: list[str] -class ExecutionConfigDict(TypedDict): +class TestRunConfigDict(TypedDict): """Allowed keys and values.""" #:
@@ -118,7 +118,7 @@ class ExecutionConfigDict(TypedDict): #: test_suites: TestSuiteConfigDict #: - system_under_test_node: ExecutionSUTConfigDict + system_under_test_node: TestRunSUTConfigDict #: traffic_generator_node: str
@@ -129,4 +129,4 @@ class ConfigurationDict(TypedDict): #: nodes: list[NodeConfigDict] #: - executions: list[ExecutionConfigDict] + test_runs: list[TestRunConfigDict]
dts/framework/logger.py +8 -8
@@ -29,23 +29,23 @@ class DtsStage(StrEnum): """The DTS execution stage.""" #: - pre_execution = auto() + pre_run = auto() #: - execution_setup = auto() - #: - execution_teardown = auto() + test_run_setup = auto() #: build_target_setup = auto() #: - build_target_teardown = auto() - #: test_suite_setup = auto() #: test_suite = auto() #: test_suite_teardown = auto() #: - post_execution = auto() + build_target_teardown = auto() + #: + test_run_teardown = auto() + #: + post_run = auto() class DTSLogger(logging.Logger):
@@ -59,7 +59,7 @@ class DTSLogger(logging.Logger): a new stage switch occurs. This is useful mainly for logging per test suite. """ - _stage: ClassVar[DtsStage] = DtsStage.pre_execution + _stage: ClassVar[DtsStage] = DtsStage.pre_run _extra_file_handlers: list[FileHandler] = [] def __init__(self, *args, **kwargs):
dts/framework/runner.py +90 -80
333 lines not on this page · raw message
dts/framework/test_result.py +36 -34
175 lines not on this page · raw message
dts/framework/testbed_model/node.py +19 -19
@@ -19,8 +19,8 @@ from framework.config import ( OS, BuildTargetConfiguration, - ExecutionConfiguration, NodeConfiguration, + TestRunConfiguration, ) from framework.exception import ConfigurationError from framework.logger import DTSLogger, get_dts_logger
@@ -65,7 +65,7 @@ class Node(ABC): ports: list[Port] _logger: DTSLogger _other_sessions: list[OSSession] - _execution_config: ExecutionConfiguration + _test_run_config: TestRunConfiguration virtual_devices: list[VirtualDevice] def __init__(self, node_config: NodeConfiguration):
@@ -103,40 +103,40 @@ def _init_ports(self) -> None: for port in self.ports: self.configure_port_state(port) - def set_up_execution(self, execution_config: ExecutionConfiguration) -> None: - """Execution setup steps. + def set_up_test_run(self, test_run_config: TestRunConfiguration) -> None: + """Test run setup steps. - Configure hugepages and call :meth:`_set_up_execution` where + Configure hugepages and call :meth:`_set_up_test_run` where the rest of the configuration steps (if any) are implemented. Args: - execution_config: The execution test run configuration according to which + test_run_config: A test run configuration according to which the setup steps will be taken. """ self._setup_hugepages() - self._set_up_execution(execution_config) - self._execution_config = execution_config - for vdev in execution_config.vdevs: + self._set_up_test_run(test_run_config) + self._test_run_config = test_run_config + for vdev in test_run_config.vdevs: self.virtual_devices.append(VirtualDevice(vdev)) - def _set_up_execution(self, execution_config: ExecutionConfiguration) -> None: - """Optional additional execution setup steps for subclasses. + def _set_up_test_run(self, test_run_config: TestRunConfiguration) -> None: + """Optional additional test run setup steps for subclasses. - Subclasses should override this if they need to add additional execution setup steps. + Subclasses should override this if they need to add additional test run setup steps. """ - def tear_down_execution(self) -> None: - """Execution teardown steps. + def tear_down_test_run(self) -> None: + """Test run teardown steps. - There are currently no common execution teardown steps common to all DTS node types. + There are currently no common test run teardown steps common to all DTS node types. """ self.virtual_devices = [] - self._tear_down_execution() + self._tear_down_test_run() - def _tear_down_execution(self) -> None: - """Optional additional execution teardown steps for subclasses. + def _tear_down_test_run(self) -> None: + """Optional additional test run teardown steps for subclasses. - Subclasses should override this if they need to add additional execution teardown steps. + Subclasses should override this if they need to add additional test run teardown steps. """ def set_up_build_target(self, build_target_config: BuildTargetConfiguration) -> None:
dts/tests/TestSuite_pmd_buffer_scatter.py +1 -1
@@ -52,7 +52,7 @@ def set_up_suite(self) -> None: """Set up the test suite. Setup: - Verify that we have at least 2 port links in the current execution + Verify that we have at least 2 port links in the current test run and increase the MTU of both ports on the traffic generator to 9000 to support larger packet sizes. """
Signature · 1 line
2.34.1
Thomas Monjalon
Applied07/06/2024 10:38, Juraj Linkeš:
Quoted 5 lines
The configuration containing the combination of:
1. what testbed to use,
2. which tests to run,
3. and what build targets to test
Quoted 8 lines
is called an execution. This is confusing since we're using the exact same term to describe other things and execution does not really capture that well the three items listed above.
A new term is thus needed to describe the configuration. Test run is much less confusing and better captures what the configuration contains.
Depends-on: series-32026 ("dts: update mypy and clean up")
It should be below --- to be ignored by git when applying.
Quoted 4 lines
Signed-off-by Juraj Linkeš <[email protected]>Reviewed-by Jeremy Spewock <[email protected]>Reviewed-by Luca Vizzarro <[email protected]>
Applied, thanks.