Skip to content
Merged
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 docs/results.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ kci-dev results builds --giturl 'https://git.kernel.org/pub/scm/linux/kernel/git

## --filter

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

Expand All @@ -122,6 +122,9 @@ hardware:
- radxa,rock2-square
- fsl,imx6q
- dell-latitude-3445-7520c-skyrim
test:
- kselftest.dt
- kselftest.iommu
```

Example:
Expand Down
12 changes: 12 additions & 0 deletions kcidev/subcommands/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,15 @@ def filter_out_by_hardware(test, filter_data):
return True


def filter_out_by_test(test, filter_data):
# Check if the test name is in the list
test_list = filter_data["test"]
if test["path"] in test_list:
return False

return True


def cmd_tests(data, commit, download_logs, status_filter, filter):
filter_data = yaml.safe_load(filter) if filter else None

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

if filter_data and filter_out_by_test(test, filter_data):
continue

log_path = test["log_url"]
if download_logs:
try:
Expand Down
Loading