etr
4.0-pre
|
Plugin base class to simplify implementation. More...
Public Member Functions | |
def | __init__ (self, ConfigurationContext ctx) |
Mandatory and is called once for every sequence of steps to execute. More... | |
def | add_options (cls, argparse.ArgumentParser parser) |
Used to add custom command line options. More... | |
None | setup (self, SetupContext ctx) |
Called during Step.SETUP step. More... | |
None | run (self, RunContext ctx) |
Called during Step.RUN step. More... | |
None | teardown (self, TeardownContext ctx) |
Called during Step.TEARDOWN. More... | |
Static Public Attributes | |
int | order = 200 |
Plugin base class to simplify implementation.
class attributes: order used to order the plugin execution order in each step, low value = earlier execution.
The step methods Plugin.setup
, Plugin.run
, Plugin.teardown
shall only assume that Plugin.__init__
has been called previously. This is because the user may choose to only execute parts of the full test sequence, most often to repeateadly execute the Steps.RUN step. The methods need to implement graceful error handling to handle missing steps.
def etr.plugin.Plugin.__init__ | ( | self, | |
ConfigurationContext | ctx | ||
) |
Mandatory and is called once for every sequence of steps to execute.
def etr.plugin.Plugin.add_options | ( | cls, | |
argparse.ArgumentParser | parser | ||
) |
Used to add custom command line options.
@note: Must be a class method
None etr.plugin.Plugin.run | ( | self, | |
RunContext | ctx | ||
) |
Called during Step.RUN step.
State and data from previous steps must be loaded from `ctx.env` or `ctx.storage`. `ctx.env` shall be considered read-only. Changes will not persist.
None etr.plugin.Plugin.setup | ( | self, | |
SetupContext | ctx | ||
) |
Called during Step.SETUP step.
Any state or data needed in the following steps shall be stored persistantly using the key-value store in `ctx.storage` or by modifying the `ctx.env` dictionary.
None etr.plugin.Plugin.teardown | ( | self, | |
TeardownContext | ctx | ||
) |
Called during Step.TEARDOWN.
State and data from previous steps must be loaded from `ctx.env`, or `ctx.storage`. `ctx.env` shall be considered read-only. Changes will not persist.
|
static |