From d2febc26c674f724ad6830c958b2040e16381942 Mon Sep 17 00:00:00 2001 From: Denys Fedoryshchenko Date: Sat, 8 Aug 2026 01:12:10 +0300 Subject: [PATCH] kbuild: identify kselftest suite build results Per-suite kselftest nodes report whether suite artifacts were built, not whether the tests were executed. Bare target names such as accel lose that context when dashboards display only the leaf node. Prefix suite names with build.kselftest and continue replacing slashes with dots for nested targets. Add a focused test covering both ordinary and nested suite names. Signed-off-by: Denys Fedoryshchenko --- kernelci/kbuild.py | 5 ++++- tests/test_kbuild.py | 28 ++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/kernelci/kbuild.py b/kernelci/kbuild.py index 4ff838c17b..5bad0a286e 100644 --- a/kernelci/kbuild.py +++ b/kernelci/kbuild.py @@ -1044,7 +1044,10 @@ def _kselftest_suite_results(self, kselftest_result): # A TARGET may be a nested path (e.g. "net/mptcp"); it is "built" # if any installed file lives under it. Use "." in the node name # to keep path elements free of slashes. - name = suite.replace("/", ".") + # These nodes report whether each kselftest suite was built; they + # are not results from executing the suite. Keep that distinction + # visible when dashboards display the leaf name without its path. + name = "build.kselftest." + suite.replace("/", ".") if kselftest_result == "skip": result = "skip" elif kselftest_result == "fail": diff --git a/tests/test_kbuild.py b/tests/test_kbuild.py index 5dd06d547e..148f799285 100644 --- a/tests/test_kbuild.py +++ b/tests/test_kbuild.py @@ -1,6 +1,7 @@ # SPDX-License-Identifier: LGPL-2.1-or-later """Tests for kernelci.kbuild build script generation and metadata""" +import json import os import sys import types @@ -82,6 +83,33 @@ def test_no_probe_for_gcc_without_tuxmake(self, tmp_path, monkeypatch): assert not any("--version" in s for s in kbuild._steps) +class TestKselftestSuiteResults: + def test_names_identify_build_results(self, tmp_path): + kbuild = _kbuild(tmp_path) + af_dir = tmp_path / "artifacts" + (af_dir / "kselftest_targets.txt").write_text( + "accel net/mptcp\n", encoding="utf-8" + ) + (af_dir / "kselftest_metadata.json").write_text( + json.dumps( + { + "artifacts": { + "kselftest": [ + "accel/test_accel", + "net/mptcp/mptcp_connect", + ] + } + } + ), + encoding="utf-8", + ) + + assert kbuild._kselftest_suite_results("pass") == [ + ("build.kselftest.accel", "pass"), + ("build.kselftest.net.mptcp", "pass"), + ] + + class FakeStorage: def __init__(self): self.single_uploads = []