Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/134384/?format=api
http://patches.dpdk.org/api/patches/134384/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20231115130959.39420-8-juraj.linkes@pantheon.tech/", "project": { "id": 1, "url": "http://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20231115130959.39420-8-juraj.linkes@pantheon.tech>", "list_archive_url": "https://inbox.dpdk.org/dev/20231115130959.39420-8-juraj.linkes@pantheon.tech", "date": "2023-11-15T13:09:45", "name": "[v7,07/21] dts: dts runner and main docstring update", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "cacd4966f2ef855cbf7e9ed84ea4ea08fe1208bc", "submitter": { "id": 1626, "url": "http://patches.dpdk.org/api/people/1626/?format=api", "name": "Juraj Linkeš", "email": "juraj.linkes@pantheon.tech" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20231115130959.39420-8-juraj.linkes@pantheon.tech/mbox/", "series": [ { "id": 30302, "url": "http://patches.dpdk.org/api/series/30302/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=30302", "date": "2023-11-15T13:09:38", "name": "dts: docstrings update", "version": 7, "mbox": "http://patches.dpdk.org/series/30302/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/134384/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/134384/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 03C6043339;\n\tWed, 15 Nov 2023 14:12:35 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 9FA9740E0F;\n\tWed, 15 Nov 2023 14:12:05 +0100 (CET)", "from mail-ed1-f47.google.com (mail-ed1-f47.google.com\n [209.85.208.47]) by mails.dpdk.org (Postfix) with ESMTP id 6029040A87\n for <dev@dpdk.org>; Wed, 15 Nov 2023 14:11:59 +0100 (CET)", "by mail-ed1-f47.google.com with SMTP id\n 4fb4d7f45d1cf-53e04b17132so10469206a12.0\n for <dev@dpdk.org>; Wed, 15 Nov 2023 05:11:59 -0800 (PST)", "from jlinkes-PT-Latitude-5530.pantheon.local\n (81.89.53.154.host.vnet.sk. [81.89.53.154])\n by smtp.gmail.com with ESMTPSA id\n tb16-20020a1709078b9000b009f2b7282387sm1011914ejc.46.2023.11.15.05.11.57\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 15 Nov 2023 05:11:58 -0800 (PST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=pantheon.tech; s=google; t=1700053919; x=1700658719; darn=dpdk.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=2ZNMam0a1R4XoTdcPdnNVy5Fpo9kpNHkFyw2wLxXUoc=;\n b=NWWSFAL9cETgz9i/MV4ufWfaGOhmhBtmXUpRxEwKPm5YKkq63T7vlwxkGWTN72tuXP\n RM+H+ThwxwScMxlhGMSf04XE231L41W5rCwRYvNdTfoXBH2t80iZiIB8TFZIdmBqsvKy\n 6Vgu3Et78hhP3efX6JXXPP/xUljZ0PUPy2Wml3RzKP5rhcXsOlSqOc7OfXWghqdHbDtX\n rSC/WuJTOx8sSkF710Zd7pkvSsPXht1X9t1W6v7BpOmN6DdcdzO5rcsmI5i+v6OD0eLK\n VFgHZckRwWJ/yPYNNPHsW5NQ7Oh4PcwBanEkOFshM7AAi3qgqfQTSpD1FkSP/9NtFwXK\n Wjgg==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1700053919; x=1700658719;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=2ZNMam0a1R4XoTdcPdnNVy5Fpo9kpNHkFyw2wLxXUoc=;\n b=O87/fK3QdTgeKnNH0DcOi7qDudOjhv6UrMyL3gVvyHErwNud/+f4GS8+VXvc2KEuXK\n ADINlXTHch+ZsrznMKPmYRu5JPdHGBVFKoj6VnwS90TjXbslCgJhT5BC7xQmbpzMNGrO\n yY8ijSuMKP22QuapkgR3ioi/rfXkkaxIBPPE7IVKAD4/MmWeouC+3Q/e65hq3k8XJefb\n ryPiNW/dIKmRui0UGohy3xDv1abb7Mbo5d45MHwQm0+Du1mFQY9wwLp2kosaaL869or1\n fmQHlpyx0TeqOtnHWb/TgcdWUj1xdZhOfJrVE5vkO2/F9jXiuFT88KqsUkMkEXX0DfjG\n kJaw==", "X-Gm-Message-State": "AOJu0YyrVM6gnAJhw1NPFZnMA0qYGLOjzlg307PKO2vRwqtwr6tHJvJE\n NERq4OKxTBa/rA7PgHPRN3Q0MLiNdqZb32LnxANN8A==", "X-Google-Smtp-Source": "\n AGHT+IHu5GId6jxSCCLsG8bJpRmJxXw8NOD6DlDFJZrMIXzJ42dLGbXFkF2VhxWxoeg7doV16UUiaw==", "X-Received": "by 2002:a17:906:404:b0:9e6:4156:af4f with SMTP id\n d4-20020a170906040400b009e64156af4fmr9595592eja.55.1700053919082;\n Wed, 15 Nov 2023 05:11:59 -0800 (PST)", "From": "=?utf-8?q?Juraj_Linke=C5=A1?= <juraj.linkes@pantheon.tech>", "To": "thomas@monjalon.net, Honnappa.Nagarahalli@arm.com, jspewock@iol.unh.edu,\n probb@iol.unh.edu, paul.szczepanek@arm.com, yoan.picchi@foss.arm.com", "Cc": "dev@dpdk.org, =?utf-8?q?Juraj_Linke=C5=A1?= <juraj.linkes@pantheon.tech>", "Subject": "[PATCH v7 07/21] dts: dts runner and main docstring update", "Date": "Wed, 15 Nov 2023 14:09:45 +0100", "Message-Id": "<20231115130959.39420-8-juraj.linkes@pantheon.tech>", "X-Mailer": "git-send-email 2.34.1", "In-Reply-To": "<20231115130959.39420-1-juraj.linkes@pantheon.tech>", "References": "<20231108125324.191005-23-juraj.linkes@pantheon.tech>\n <20231115130959.39420-1-juraj.linkes@pantheon.tech>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "Format according to the Google format and PEP257, with slight\ndeviations.\n\nSigned-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>\n---\n dts/framework/dts.py | 128 ++++++++++++++++++++++++++++++++++++-------\n dts/main.py | 8 ++-\n 2 files changed, 112 insertions(+), 24 deletions(-)", "diff": "diff --git a/dts/framework/dts.py b/dts/framework/dts.py\nindex 4c7fb0c40a..331fed7dc4 100644\n--- a/dts/framework/dts.py\n+++ b/dts/framework/dts.py\n@@ -3,6 +3,33 @@\n # Copyright(c) 2022-2023 PANTHEON.tech s.r.o.\n # Copyright(c) 2022-2023 University of New Hampshire\n \n+r\"\"\"Test suite runner module.\n+\n+A DTS run is split into stages:\n+\n+ #. Execution stage,\n+ #. Build target stage,\n+ #. Test suite stage,\n+ #. Test case stage.\n+\n+The module is responsible for running tests on testbeds defined in the test run configuration.\n+Each setup or teardown of each stage is recorded in a :class:`~framework.test_result.DTSResult` or\n+one of its subclasses. The test case results are also recorded.\n+\n+If an error occurs, the current stage is aborted, the error is recorded and the run continues in\n+the next iteration of the same stage. The return code is the highest `severity` of all\n+:class:`~.framework.exception.DTSError`\\s.\n+\n+Example:\n+ An error occurs in a build target setup. The current build target is aborted and the run\n+ continues with the next build target. If the errored build target was the last one in the given\n+ execution, the next execution begins.\n+\n+Attributes:\n+ dts_logger: The logger instance used in this module.\n+ result: The top level result used in the module.\n+\"\"\"\n+\n import sys\n \n from .config import (\n@@ -23,9 +50,38 @@\n \n \n def run_all() -> None:\n- \"\"\"\n- The main process of DTS. Runs all build targets in all executions from the main\n- config file.\n+ \"\"\"Run all build targets in all executions from the test run configuration.\n+\n+ Before running test suites, executions and build targets are first set up.\n+ The executions and build targets defined in the test run configuration are iterated over.\n+ The executions define which tests to run and where to run them and build targets define\n+ the DPDK build setup.\n+\n+ The tests suites are set up for each execution/build target tuple and each scheduled\n+ test case within the test suite is set up, executed and torn down. After all test cases\n+ have been executed, the test suite is torn down and the next build target will be tested.\n+\n+ All the nested steps look like this:\n+\n+ #. Execution setup\n+\n+ #. Build target setup\n+\n+ #. Test suite setup\n+\n+ #. Test case setup\n+ #. Test case logic\n+ #. Test case teardown\n+\n+ #. Test suite teardown\n+\n+ #. Build target teardown\n+\n+ #. Execution teardown\n+\n+ The test cases are filtered according to the specification in the test run configuration and\n+ the :option:`--test-cases` command line argument or\n+ the :envvar:`DTS_TESTCASES` environment variable.\n \"\"\"\n global dts_logger\n global result\n@@ -87,6 +143,8 @@ def run_all() -> None:\n \n \n def _check_dts_python_version() -> None:\n+ \"\"\"Check the required Python version - v3.10.\"\"\"\n+\n def RED(text: str) -> str:\n return f\"\\u001B[31;1m{str(text)}\\u001B[0m\"\n \n@@ -111,9 +169,16 @@ def _run_execution(\n execution: ExecutionConfiguration,\n result: DTSResult,\n ) -> None:\n- \"\"\"\n- Run the given execution. This involves running the execution setup as well as\n- running all build targets in the given execution.\n+ \"\"\"Run the given execution.\n+\n+ This involves running the execution setup as well as running all build targets\n+ in the given execution. After that, execution teardown is run.\n+\n+ Args:\n+ sut_node: The execution's SUT node.\n+ tg_node: The execution's TG node.\n+ execution: An execution's test run configuration.\n+ result: The top level result object.\n \"\"\"\n dts_logger.info(\n f\"Running execution with SUT '{execution.system_under_test_node.name}'.\"\n@@ -150,8 +215,18 @@ def _run_build_target(\n execution: ExecutionConfiguration,\n execution_result: ExecutionResult,\n ) -> None:\n- \"\"\"\n- Run the given build target.\n+ \"\"\"Run the given build target.\n+\n+ This involves running the build target setup as well as running all test suites\n+ in the given execution the build target is defined in.\n+ After that, build target teardown is run.\n+\n+ Args:\n+ sut_node: The execution's SUT node.\n+ tg_node: The execution's TG node.\n+ build_target: A build target's test run configuration.\n+ execution: The build target's execution's test run configuration.\n+ execution_result: The execution level result object associated with the execution.\n \"\"\"\n dts_logger.info(f\"Running build target '{build_target.name}'.\")\n build_target_result = execution_result.add_build_target(build_target)\n@@ -183,10 +258,17 @@ def _run_all_suites(\n execution: ExecutionConfiguration,\n build_target_result: BuildTargetResult,\n ) -> None:\n- \"\"\"\n- Use the given build_target to run execution's test suites\n- with possibly only a subset of test cases.\n- If no subset is specified, run all test cases.\n+ \"\"\"Run the execution's (possibly a subset) test suites using the current build_target.\n+\n+ The function assumes the build target we're testing has already been built on the SUT node.\n+ The current build target thus corresponds to the current DPDK build present on the SUT node.\n+\n+ Args:\n+ sut_node: The execution's SUT node.\n+ tg_node: The execution's TG node.\n+ execution: The execution's test run configuration associated with the current build target.\n+ build_target_result: The build target level result object associated\n+ with the current build target.\n \"\"\"\n end_build_target = False\n if not execution.skip_smoke_tests:\n@@ -215,16 +297,22 @@ def _run_single_suite(\n build_target_result: BuildTargetResult,\n test_suite_config: TestSuiteConfig,\n ) -> None:\n- \"\"\"Runs a single test suite.\n+ \"\"\"Run all test suite in a single test suite module.\n+\n+ The function assumes the build target we're testing has already been built on the SUT node.\n+ The current build target thus corresponds to the current DPDK build present on the SUT node.\n \n Args:\n- sut_node: Node to run tests on.\n- execution: Execution the test case belongs to.\n- build_target_result: Build target configuration test case is run on\n- test_suite_config: Test suite configuration\n+ sut_node: The execution's SUT node.\n+ tg_node: The execution's TG node.\n+ execution: The execution's test run configuration associated with the current build target.\n+ build_target_result: The build target level result object associated\n+ with the current build target.\n+ test_suite_config: Test suite test run configuration specifying the test suite module\n+ and possibly a subset of test cases of test suites in that module.\n \n Raises:\n- BlockingTestSuiteError: If a test suite that was marked as blocking fails.\n+ BlockingTestSuiteError: If a blocking test suite fails.\n \"\"\"\n try:\n full_suite_path = f\"tests.TestSuite_{test_suite_config.test_suite}\"\n@@ -248,9 +336,7 @@ def _run_single_suite(\n \n \n def _exit_dts() -> None:\n- \"\"\"\n- Process all errors and exit with the proper exit code.\n- \"\"\"\n+ \"\"\"Process all errors and exit with the proper exit code.\"\"\"\n result.process()\n \n if dts_logger:\ndiff --git a/dts/main.py b/dts/main.py\nindex 5d4714b0c3..f703615d11 100755\n--- a/dts/main.py\n+++ b/dts/main.py\n@@ -4,9 +4,7 @@\n # Copyright(c) 2022 PANTHEON.tech s.r.o.\n # Copyright(c) 2022 University of New Hampshire\n \n-\"\"\"\n-A test framework for testing DPDK.\n-\"\"\"\n+\"\"\"The DTS executable.\"\"\"\n \n import logging\n \n@@ -17,6 +15,10 @@ def main() -> None:\n \"\"\"Set DTS settings, then run DTS.\n \n The DTS settings are taken from the command line arguments and the environment variables.\n+ The settings object is stored in the module-level variable settings.SETTINGS which the entire\n+ framework uses. After importing the module (or the variable), any changes to the variable are\n+ not going to be reflected without a re-import. This means that the SETTINGS variable must\n+ be modified before the settings module is imported anywhere else in the framework.\n \"\"\"\n settings.SETTINGS = settings.get_settings()\n from framework import dts\n", "prefixes": [ "v7", "07/21" ] }{ "id": 134384, "url": "