On 5. 7. 2024 19:13, Nicholas Pratte wrote:
There is some odd functionality/behavior in how the --test-suite
parameters interacts in conjunction with the 'test_suites' attribute in
the config file. If a user leaves an empty list underneath
'test_suites,' or if they negate the attribute entirely, even if said
user adds test suites via the --test-suite parameter, a schema violation
is thrown.
This patch mitigates this, by removing the schema requirement if the
user has indicated test suites within main.py parameters, allowing for
the 'test_suites' attribute to be optional.
Nice idea, doesn't look like there's any hard in adding it. Should we
document this (the fact that it could be optional under certain
circumstances) somewhere, like add something to the description in schema?
Bugzilla ID: 1360
Signed-off-by: Nicholas Pratte <npra...@iol.unh.edu>
---
dts/framework/config/__init__.py | 7 ++++++-
dts/framework/runner.py | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/dts/framework/config/__init__.py b/dts/framework/config/__init__.py
index ed1c979fb6..82182b5c99 100644
--- a/dts/framework/config/__init__.py
+++ b/dts/framework/config/__init__.py
@@ -553,7 +553,7 @@ def from_dict(cls, d: ConfigurationDict) -> Self:
return cls(test_runs=test_runs)
-def load_config(config_file_path: Path) -> Configuration:
+def load_config(config_file_path: Path, test_suites: list[TestSuiteConfig]) ->
Configuration:
The variable should maybe contain that these test suites are not from
config_file_path. Maybe just rename to other_test_suites? Or something
like that.
Also, it needs to be added to Args: