Skip to content

Commit 722b56f

Browse files
committed
kernelci.build: add kselftest artifacts
Add artifacts for kselftest with a list of all the directories that have tests "emitted" by the build. Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
1 parent 2d1f1f7 commit 722b56f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

kernelci/build.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,6 +1220,17 @@ def run(self, jopt=None, verbose=False):
12201220
'tools/testing/selftests')
12211221
return self._add_run_step(jopt, res)
12221222

1223+
def _get_kselftests(self, kselftest_tarball):
1224+
with tarfile.open(kselftest_tarball, 'r:xz') as tarball:
1225+
kselftests = set(
1226+
path for path in (
1227+
os.path.split(os.path.relpath(entry.name))[0]
1228+
for entry in tarball
1229+
)
1230+
if path
1231+
)
1232+
return kselftests
1233+
12231234
def install(self, verbose=False):
12241235
"""Install the kselftest tarball
12251236
@@ -1236,6 +1247,8 @@ def install(self, verbose=False):
12361247
res = os.path.exists(kselftest_tarball)
12371248
if res:
12381249
self._install_file(kselftest_tarball, verbose=verbose)
1250+
kselftests = self._get_kselftests(kselftest_tarball)
1251+
self._artifacts['kselftest'] = kselftests
12391252

12401253
return super().install(verbose, res)
12411254

0 commit comments

Comments
 (0)