The tests config is created by parsing the testrun config
earlier in the DTS execution than when the smoke_tests
testsuite is added. This situation causes a key error
on the tests_config dictionary when smoke_tests is enabled.
This commit creates a placeholder TestSuiteConfig for
smoke tests in the function which is responsible for
creating the tests config model, resolving the issue.

Fixes: 184d21f08db4 ("dts: add per-test-suite configuration")

Signed-off-by: Patrick Robb <pr...@iol.unh.edu>
---
 dts/framework/config/test_run.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/dts/framework/config/test_run.py b/dts/framework/config/test_run.py
index 06fe28143c..9bbed10f33 100644
--- a/dts/framework/config/test_run.py
+++ b/dts/framework/config/test_run.py
@@ -303,6 +303,9 @@ def make_test_suite_config_field(config_obj: 
type["BaseConfig"]):
 
 def create_test_suites_config_model(test_suites: Iterable[TestSuiteConfig]) -> 
type[BaseModel]:
     """Create model for the test suites configuration."""
+
+    test_suites += [TestSuiteConfig(test_suite="smoke_tests")]
+
     test_suites_kwargs = {
         t.test_suite_name: 
make_test_suite_config_field(t.test_suite_spec.config_obj)
         for t in test_suites
-- 
2.48.1

Reply via email to