<div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br><div dir="ltr">On Fri, Nov 8, 2024 at 8:38 AM Luca Vizzarro <<a href="mailto:luca.vizzarro@arm.com" target="_blank">luca.vizzarro@arm.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Allow test suites to be configured individually. Moreover enable them to<br>implement their own custom configuration.<br><br>This solution adds some new complexity to DTS, which is generated source<br>code. In order to ensure strong typing, the test suites and their custom<br>configurations need to be linked in the main configuration class.<br>Unfortunately, this is not feasible during runtime as it will incur in<br>circular dependencies. Generating the links appear to be the most<br>straightforward approach.<br><br>This commit also brings a new major change to the configuration schema.<br>Test suites are no longer defined as a list of strings, like:<br><br> test_suites:<br> - hello_world<br> - pmd_buffer_scatter<br><br>but as mapping of mappings or strings:<br><br> test_suites:<br> hello_world: {} # any custom fields or test cases can be set here<br> pmd_buffer_scatter: all # "all" defines all the test cases, or<br> # they can individually be set separated<br> # by a space<br><br>Not defining the `test_cases` field in the configuration is equivalent<br>to `all`, therefore the definitions for either test suite above are<br>also equivalent.<br><br>Creating the __init__.py file under the tests folder, allows it to be<br>picked up as a package. This is a mypy requirement to import the tests<br>from within the framework.<br><br>Bugzilla ID: 1375<br><br>Signed-off-by: Luca Vizzarro <<a href="mailto:luca.vizzarro@arm.com" target="_blank">luca.vizzarro@arm.com</a>><br>Reviewed-by: Paul Szczepanek <<a href="mailto:paul.szczepanek@arm.com" target="_blank">paul.szczepanek@arm.com</a>><br></blockquote><div><br></div><div>I like the idea of mapping the suite to specific test cases, and for the most part the custom configuration option as well. The only thing that I feel should be different is the way the code generation is documented, I think it might be worth providing an example within conf.yaml through a comment near the suites section, rather than just in the dts.rst file. It might be a little more clear where to create the custom config class as well. </div><div><br></div><div> <snip></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">+class HelloWorldConfig(TestSuiteConfig):<br>+ """Example custom configuration for the `TestHelloWorld` test suite."""<br>+<br>+ #: Timeout for the DPDK apps.<br>+ timeout: int = 50<br>--<br>2.43.0<br><br></blockquote><div><br></div><div>Additionally, I was a bit confused by the custom config examples, do these fields (timeout, my_custom_field) actually affect the suite in any way as of this patch? Or is this just so that we can potentially add configuration options through this method in the future?<br><br>Reviewed-by: Dean Marx <<a href="mailto:dmarx@iol.unh.edu" target="_blank">dmarx@iol.unh.edu</a>> </div></div>
</blockquote></div></div>