Skip to content

Commit bd4b29f

Browse files
authored
Merge pull request #115 from padovan/add-test-name-filter
results: add test filter to the `tests` command.
2 parents 382c5fd + 635f163 commit bd4b29f

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

docs/results.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ kci-dev results builds --giturl 'https://git.kernel.org/pub/scm/linux/kernel/git
113113

114114
## --filter
115115

116-
Pass a YAML filter file to customize results. Only supports hardware filtering at the moment.
116+
Pass a YAML filter file to customize results. Only supports hardware and test name filtering at the moment.
117117
See filter yaml example below:
118118
(available for subcommands `boots` and `tests`)
119119

@@ -122,6 +122,9 @@ hardware:
122122
- radxa,rock2-square
123123
- fsl,imx6q
124124
- dell-latitude-3445-7520c-skyrim
125+
test:
126+
- kselftest.dt
127+
- kselftest.iommu
125128
```
126129
127130
Example:

kcidev/subcommands/results.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,15 @@ def filter_out_by_hardware(test, filter_data):
314314
return True
315315

316316

317+
def filter_out_by_test(test, filter_data):
318+
# Check if the test name is in the list
319+
test_list = filter_data["test"]
320+
if test["path"] in test_list:
321+
return False
322+
323+
return True
324+
325+
317326
def cmd_tests(data, commit, download_logs, status_filter, filter):
318327
filter_data = yaml.safe_load(filter) if filter else None
319328

@@ -324,6 +333,9 @@ def cmd_tests(data, commit, download_logs, status_filter, filter):
324333
if filter_data and filter_out_by_hardware(test, filter_data):
325334
continue
326335

336+
if filter_data and filter_out_by_test(test, filter_data):
337+
continue
338+
327339
log_path = test["log_url"]
328340
if download_logs:
329341
try:

0 commit comments

Comments
 (0)