get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/130374/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 130374,
    "url": "https://patches.dpdk.org/api/patches/130374/?format=api",
    "web_url": "https://patches.dpdk.org/project/ci/patch/20230815151053.996469-6-bruce.richardson@intel.com/",
    "project": {
        "id": 5,
        "url": "https://patches.dpdk.org/api/projects/5/?format=api",
        "name": "CI",
        "link_name": "ci",
        "list_id": "ci.dpdk.org",
        "list_email": "ci@dpdk.org",
        "web_url": "",
        "scm_url": "git://dpdk.org/tools/dpdk-ci",
        "webscm_url": "https://git.dpdk.org/tools/dpdk-ci/",
        "list_archive_url": "https://inbox.dpdk.org/ci",
        "list_archive_url_format": "https://inbox.dpdk.org/ci/{}",
        "commit_url_format": ""
    },
    "msgid": "<20230815151053.996469-6-bruce.richardson@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/ci/20230815151053.996469-6-bruce.richardson@intel.com",
    "date": "2023-08-15T15:10:49",
    "name": "[v5,05/10] app/test: define unit tests suites based on test macros",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "5ebf18319b3cd9b787f068835b4001ead4c2bf08",
    "submitter": {
        "id": 20,
        "url": "https://patches.dpdk.org/api/people/20/?format=api",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/ci/patch/20230815151053.996469-6-bruce.richardson@intel.com/mbox/",
    "series": [
        {
            "id": 29237,
            "url": "https://patches.dpdk.org/api/series/29237/?format=api",
            "web_url": "https://patches.dpdk.org/project/ci/list/?series=29237",
            "date": "2023-08-15T15:12:37",
            "name": "expand list of optional libraries",
            "version": 5,
            "mbox": "https://patches.dpdk.org/series/29237/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/130374/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/130374/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<ci-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 4F3B543074;\n\tTue, 15 Aug 2023 17:23:11 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 7E6E7432AD;\n\tTue, 15 Aug 2023 17:23:04 +0200 (CEST)",
            "from mgamail.intel.com (mgamail.intel.com [134.134.136.126])\n by mails.dpdk.org (Postfix) with ESMTP id 3B40343265;\n Tue, 15 Aug 2023 17:22:53 +0200 (CEST)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 15 Aug 2023 08:11:06 -0700",
            "from silpixa00401385.ir.intel.com ([10.237.214.14])\n by fmsmga004.fm.intel.com with ESMTP; 15 Aug 2023 08:11:04 -0700"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1692112973; x=1723648973;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=U9f2q1i/o5D6J3m1qTbO2DMH2pqL/KoB71E7bTmDAJ4=;\n b=PXLCs3YG2M+Y57ahFF/rgR5vyEL5f3xitDhNxS0HnU96xMmJ08GKvI2t\n B/Y/KICGSn1gCTRbh90+UnOVDZhJBThcKgJgiH6BGEaUD6fOOY38hB+Ab\n hpjgJv5goCC239qNEQBiDlhHNj5heRoc0rQvOZY6RPtj+M92Kz36D23Y4\n CvT5b0fY13bPBT1bTtpZa/RtgHJZe1Fm7umQQpG28RW4+GMl7bv98vAdu\n ehgREj86Eq05Wkp5O7V1JKiQx7JoylkkXzK5KUG8q76frXnRuIDELK5oN\n 18vc6Zy/444CTC9vmJ6JZVEzpvKt4PvKDhRuK0iYu4pt2PwnNWT6ZIMxT w==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6600,9927,10803\"; a=\"357271537\"",
            "E=Sophos;i=\"6.01,174,1684825200\"; d=\"scan'208\";a=\"357271537\"",
            "E=McAfee;i=\"6600,9927,10803\"; a=\"803843824\"",
            "E=Sophos;i=\"6.01,174,1684825200\"; d=\"scan'208\";a=\"803843824\""
        ],
        "X-ExtLoop1": "1",
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "ci@dpdk.org, Bruce Richardson <bruce.richardson@intel.com>, =?utf-8?q?Mo?=\n\t=?utf-8?q?rten_Br=C3=B8rup?= <mb@smartsharesystems.com>",
        "Subject": "[PATCH v5 05/10] app/test: define unit tests suites based on test\n macros",
        "Date": "Tue, 15 Aug 2023 16:10:49 +0100",
        "Message-Id": "<20230815151053.996469-6-bruce.richardson@intel.com>",
        "X-Mailer": "git-send-email 2.39.2",
        "In-Reply-To": "<20230815151053.996469-1-bruce.richardson@intel.com>",
        "References": "<20230721115125.55137-1-bruce.richardson@intel.com>\n <20230815151053.996469-1-bruce.richardson@intel.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "ci@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK CI discussions <ci.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/ci>,\n <mailto:ci-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/ci/>",
        "List-Post": "<mailto:ci@dpdk.org>",
        "List-Help": "<mailto:ci-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/ci>,\n <mailto:ci-request@dpdk.org?subject=subscribe>",
        "Errors-To": "ci-bounces@dpdk.org"
    },
    "content": "Rather than having the test suites listed out in the meson.build files\nand having to have them enabled/disabled selectively based on what libs\nare being built, pull the tests to run from the source files which were\nadded to the build.\n\nMost test suites require no additional info other than the list of test\nnames in the suite. However the fast-test are special that they have\nadditional parameters associated with them. This requires some\nadditional work in the test extraction script and in the meson.build\nfile for processing the output.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\nAcked-by: Morten Brørup <mb@smartsharesystems.com>\n---\n app/meson.build                               |  7 +-\n app/test/suites/meson.build                   | 74 +++++++++++++++++++\n buildtools/get-test-suites.py                 | 33 +++++++++\n .../has-hugepages.py                          |  0\n buildtools/meson.build                        |  2 +\n 5 files changed, 115 insertions(+), 1 deletion(-)\n create mode 100644 app/test/suites/meson.build\n create mode 100644 buildtools/get-test-suites.py\n rename app/test/has_hugepage.py => buildtools/has-hugepages.py (100%)",
    "diff": "diff --git a/app/meson.build b/app/meson.build\nindex 0d8b618e7f..c14dc80892 100644\n--- a/app/meson.build\n+++ b/app/meson.build\n@@ -101,7 +101,7 @@ foreach app:apps\n         link_libs = dpdk_static_libraries + dpdk_drivers\n     endif\n \n-    executable('dpdk-' + name,\n+    exec = executable('dpdk-' + name,\n             sources,\n             c_args: cflags,\n             link_args: ldflags,\n@@ -110,4 +110,9 @@ foreach app:apps\n             include_directories: includes,\n             install_rpath: join_paths(get_option('prefix'), driver_install_path),\n             install: true)\n+    if name == 'test'\n+        dpdk_test = exec\n+        autotest_sources = sources\n+        subdir('test/suites')  # define the pre-canned test suites\n+    endif\n endforeach\ndiff --git a/app/test/suites/meson.build b/app/test/suites/meson.build\nnew file mode 100644\nindex 0000000000..ec74d8adf2\n--- /dev/null\n+++ b/app/test/suites/meson.build\n@@ -0,0 +1,74 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright(c) 2023 Intel Corporation\n+\n+# some perf tests (eg: memcpy perf autotest)take very long\n+# to complete, so timeout to 10 minutes\n+timeout_seconds = 600\n+timeout_seconds_fast = 10\n+\n+test_no_huge_args = ['--no-huge', '-m', '2048']\n+has_hugepage = run_command(has_hugepages_cmd, check: true).stdout().strip() != '0'\n+message('hugepage availability: @0@'.format(has_hugepage))\n+\n+# process source files to determine the different unit test suites\n+# - fast_tests\n+# - perf_tests\n+# - driver_tests\n+test_suites = run_command(get_test_suites_cmd, autotest_sources,\n+         check: true).stdout().strip().split()\n+foreach suite:test_suites\n+    # simple cases - tests without parameters or special handling\n+    suite = suite.split('=')\n+    suite_name = suite[0]\n+    suite_tests = suite[1].split(',')\n+    if suite_name != 'fast-tests'\n+        # simple cases - tests without parameters or special handling\n+        foreach t: suite_tests\n+            test(t, dpdk_test,\n+                    env: ['DPDK_TEST=' + t],\n+                    timeout: timeout_seconds,\n+                    is_parallel: false,\n+                    suite: suite_name)\n+        endforeach\n+    else\n+    # special fast-test handling here\n+        foreach t: suite_tests\n+            params = t.split(':')\n+            test_name = params[0]\n+            nohuge = params[1] == 'true'\n+            asan = params[2] == 'true'\n+\n+            test_args = []\n+            if nohuge\n+                test_args += test_no_huge_args\n+            elif not has_hugepage\n+                continue  #skip this tests\n+            endif\n+            if not asan and (get_option('b_sanitize') == 'address'\n+                    or get_option('b_sanitize') == 'address,undefined')\n+                continue  # skip this test\n+            endif\n+\n+            if get_option('default_library') == 'shared'\n+                test_args += ['-d', dpdk_drivers_build_dir]\n+            endif\n+\n+            test(test_name, dpdk_test,\n+                args : test_args,\n+                env: ['DPDK_TEST=' + test_name],\n+                timeout : timeout_seconds_fast,\n+                is_parallel : false,\n+                suite : 'fast-tests')\n+            if not is_windows and test_name == 'trace_autotest'\n+                test_args += ['--trace=.*']\n+                test_args += ['--trace-dir=@0@'.format(meson.current_build_dir())]\n+                test(test_name + '_with_traces', dpdk_test,\n+                    args : test_args,\n+                    env: ['DPDK_TEST=' + test_name],\n+                    timeout : timeout_seconds_fast,\n+                    is_parallel : false,\n+                    suite : 'fast-tests')\n+            endif\n+        endforeach\n+    endif\n+endforeach\ndiff --git a/buildtools/get-test-suites.py b/buildtools/get-test-suites.py\nnew file mode 100644\nindex 0000000000..95a9cad4c8\n--- /dev/null\n+++ b/buildtools/get-test-suites.py\n@@ -0,0 +1,33 @@\n+#! /usr/bin/env python3\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright(c) 2023 Intel Corporation\n+\n+import sys\n+import re\n+\n+input_list = sys.argv[1:]\n+test_def_regex = re.compile(\"REGISTER_([A-Z]+)_TEST\\s*\\(\\s*([a-z0-9_]+)\")\n+test_suites = {}\n+\n+def get_fast_test_params(test_name, ln):\n+    \"Extract the extra fast-test parameters from the line\"\n+    #print(f\"ln: {ln.rstrip()}, test_name: {test_name}, split: {ln.split(test_name, 1)}\")\n+    (_, rest_of_line) = ln.split(test_name, 1)\n+    (_, nohuge, asan, _func) = rest_of_line.split(',', 3)\n+    return f\":{nohuge.strip().lower()}:{asan.strip().lower()}\"\n+\n+for fname in input_list:\n+    with open(fname) as f:\n+        contents = [ln for ln in f.readlines() if test_def_regex.match(ln.strip())]\n+    for ln in contents:\n+        (test_suite, test_name) = test_def_regex.match(ln).group(1, 2)\n+        suite_name = f\"{test_suite.lower()}-tests\"\n+        if suite_name in test_suites:\n+            test_suites[suite_name].append(test_name)\n+        else:\n+            test_suites[suite_name] = [test_name]\n+        if suite_name == \"fast-tests\":\n+            test_suites[\"fast-tests\"][-1] += get_fast_test_params(test_name, ln)\n+\n+for suite in test_suites.keys():\n+    print(f\"{suite}={','.join(test_suites[suite])}\")\ndiff --git a/app/test/has_hugepage.py b/buildtools/has-hugepages.py\nsimilarity index 100%\nrename from app/test/has_hugepage.py\nrename to buildtools/has-hugepages.py\ndiff --git a/buildtools/meson.build b/buildtools/meson.build\nindex e1c600e40f..ac5e4dcf08 100644\n--- a/buildtools/meson.build\n+++ b/buildtools/meson.build\n@@ -18,6 +18,8 @@ map_to_win_cmd = py3 + files('map_to_win.py')\n sphinx_wrapper = py3 + files('call-sphinx-build.py')\n get_cpu_count_cmd = py3 + files('get-cpu-count.py')\n get_numa_count_cmd = py3 + files('get-numa-count.py')\n+get_test_suites_cmd = py3 + files('get-test-suites.py')\n+has_hugepages_cmd = py3 + files('has-hugepages.py')\n binutils_avx512_check = (py3 + files('binutils-avx512-check.py') +\n                         [objdump] + cc.cmd_array())\n \n",
    "prefixes": [
        "v5",
        "05/10"
    ]
}