Sub Test Plan Execution
In some situations it might be necessary to run a test plan within a test plan. This could both be in cases where the test plan would otherwise become too large or if one wants to sweep a list of test plans.
- Logging should be redirected: It should not create strange logging artifacts like that
-------starting testplan -----
- Results should be redirected to make it appear like all the test step runs came from the same test step.
- Resources should be used in a consistent manner, so that the inner plan does not need to open new resources if they are already open and should not close resource needed by the existing test plan.
- PrePlanRun/PostPlanRun on the sub step should probably be called when the sub plan is entered.
- The same test plan can be used from multiple steps as long as the parameters are set correctly before beginning. This would make it possible to make much more compact test plans.
- Support a test plan Inception scenario, where sub-plans runs other sub-plans.
Implementation
Logging
The logging should be modified to support redirecting the log messages coming from a thread to a different path than the normal one. This different path will then be filtered so it seems like all messages came from the same step.
The best way to do this is probably to use the ThreadField class somewhere inside the logging system to add a thread-heirarchy-based way of redirecting the log messages.
Results
The result system should also be modified to support redirection (as log), but it is simpler as this can be done by just implementing a result listener to redirect all the results coming from that test step.
Resources
It is currently not supported to keep resources open after exiting a test plan. If open is used, it is slightly different though, but then we have to manage which resources to close.
The best is probably to reuse the same resource manager in the next sub plan, or to completely disable resource management and forwarding all the resources to a virtual property on the sub test plan step.