The configuration requires the user to explicitly set the requested test
suites in the files. Sometimes we want to run all the test suites and
don't want to manually specify all of them. It is therefore reasonable
to change the default behaviour to automatically run all the available
test suites if none are specified.

Bugzilla ID: 1360

Signed-off-by: Luca Vizzarro <luca.vizza...@arm.com>
Reviewed-by: Paul Szczepanek <paul.szczepa...@arm.com>
---
 dts/framework/config/test_run.py | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/dts/framework/config/test_run.py b/dts/framework/config/test_run.py
index f08e034e25..6ea05ceeba 100644
--- a/dts/framework/config/test_run.py
+++ b/dts/framework/config/test_run.py
@@ -259,6 +259,20 @@ def validate_names(self) -> Self:
         return self
 
 
+def fetch_all_test_suites() -> list[TestSuiteConfig]:
+    """Returns all the available test suites as configuration objects.
+
+    This function does not include the smoke tests.
+    """
+    from framework.test_suite import AVAILABLE_TEST_SUITES
+
+    return [
+        TestSuiteConfig(test_suite=test_suite.name)
+        for test_suite in AVAILABLE_TEST_SUITES
+        if test_suite.name != "smoke_tests"
+    ]
+
+
 class TestRunConfiguration(FrozenModel):
     """The configuration of a test run.
 
@@ -275,7 +289,7 @@ class TestRunConfiguration(FrozenModel):
     #: Whether to skip smoke tests.
     skip_smoke_tests: bool = False
     #: The names of test suites and/or test cases to execute.
-    test_suites: list[TestSuiteConfig] = Field(min_length=1)
+    test_suites: list[TestSuiteConfig] = Field(min_length=1, 
default_factory=fetch_all_test_suites)
     #: The SUT node name to use in this test run.
     system_under_test_node: str
     #: The TG node name to use in this test run.
-- 
2.43.0

Reply via email to