etr  4.0-pre
Public Member Functions | Static Public Attributes | List of all members
etr.plugin.Plugin Class Reference

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ __init__()

def etr.plugin.Plugin.__init__ (   self,
ConfigurationContext  ctx 
)

Mandatory and is called once for every sequence of steps to execute.

Member Function Documentation

◆ add_options()

def etr.plugin.Plugin.add_options (   cls,
argparse.ArgumentParser  parser 
)

Used to add custom command line options.

   @note: Must be a class method

◆ run()

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.

◆ setup()

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.

◆ teardown()

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.

Member Data Documentation

◆ order

int etr.plugin.Plugin.order = 200
static

The documentation for this class was generated from the following file: