google/openhtf

If plug configuration is dynamic (e.g. configs loaded from a file), how can the decorators be updated accordingly?

umamibeef opened this issue · 2 comments

Hello! I'm looking for guidance on how to properly use the framework with respect to dynamic configuration of plugs. As I understand it, the test phase decorators take in a reference to an already instantiated plug (one that has been configured). If I'm using plugs that are dynamically configured, should the test be then wrapped up in a class that is instantiated with the desired config file to be used so that it can instantiate the configured plugs accordingly?

I should specify that my confusion arises from the decorator for a test phase requiring a configured plug, meaning my plug needs to be configured prior to the decorator. Ideally I would like my test definitions to be separate from the configuration of the plugs required for them, as they will vary from station to station that the tests are being run on.

OK! Figured it out. bind_init_args will only bind the key to the plug's initialization arguments. Since CONF is a singleton instance, if you load another value to the declared key, it will use that new value when the phase runs with the configured plug. Closing. Hopefully this helps someone out in the future 😄