Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion kernelci/kbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down
28 changes: 28 additions & 0 deletions tests/test_kbuild.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 = []
Expand Down