From 635f1633981747292947a1ed1d4129ea178432b0 Mon Sep 17 00:00:00 2001 From: Gustavo Padovan Date: Mon, 17 Feb 2025 11:25:53 -0300 Subject: [PATCH] results: add test filter to the `tests` command. Now you can pass a list of tests to the yaml filter to select only specific tests you want to see. Signed-off-by: Gustavo Padovan --- docs/results.md | 5 ++++- kcidev/subcommands/results.py | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/results.md b/docs/results.md index a02605a..c19c0fa 100644 --- a/docs/results.md +++ b/docs/results.md @@ -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`) @@ -122,6 +122,9 @@ hardware: - radxa,rock2-square - fsl,imx6q - dell-latitude-3445-7520c-skyrim +test: + - kselftest.dt + - kselftest.iommu ``` Example: diff --git a/kcidev/subcommands/results.py b/kcidev/subcommands/results.py index 55369b2..7171f54 100644 --- a/kcidev/subcommands/results.py +++ b/kcidev/subcommands/results.py @@ -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 @@ -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: