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 = []