Closed Rahix closed 4 years ago
Looks like a very good change. Any plans when this will be merged?
I'm still ironing out a few more details, to make this new design work well for even more situations. Should not be too far off, though!
I'd consider this implementation feature complete now. I still want to let it sit for a bit to see how well it works in practice, but apart from that I think it is ready. :)
The next release will include this new API as an optional feature and after that I will start migrating more code towards it and deprecating the "old" mechanisms which are now superseded.
(Fixed some minor bugs and documentation issues).
The existing
tbot.selectable
module is a glorified hack for bridging between the selected config and the testcases. As tbot aims to support more and more complex use-cases, it becomes apparent that this existing mechanism is not sufficient.The "Context" is an attempt to solve this problem: It is a central "machine manager" where the config registers available machine classes and testcases request instances from. The idea is to have global management of instances so testcases need not concern themselves with creating and passing instances around. Instead, the manager keeps the instances at the ready for any testcase that needs access.
A few quick examples:
Testcase with just Linux on the board
Testcase with Lab-Host and board's U-Boot
New-style lab configuration
The "context" API is compatible with
tbot.selectble
for the time being. This means, old configuration will work with new testcases and new configuration will work with old testcases.For more details, please refer to the context documentation in this PR.