ifw
0.0.1-dev
|
Coordinates running of integration test runners. More...
Files | |
file | command.py |
file | context.py |
file | exception.py |
file | info.py |
file | main.py |
file | plugin.py |
file | jinja2.py |
file | nomad.py |
file | nose.py |
file | resources.py |
file | robot.py |
file | result.py |
file | runner.py |
file | manager.py |
file | fsisolation.py |
file | logcapture.py |
file | subprocess.py |
file | tests.py |
file | xunit.py |
file | command.py |
file | context.py |
file | exception.py |
file | info.py |
file | main.py |
file | plugin.py |
file | jinja2.py |
file | nomad.py |
file | nose.py |
file | resources.py |
file | robot.py |
file | result.py |
file | runner.py |
file | manager.py |
file | fsisolation.py |
file | logcapture.py |
file | subprocess.py |
file | tests.py |
file | xunit.py |
file | etr.py |
Classes | |
class | etr.context.Command |
Application commands enumeration. More... | |
class | etr.context.Step |
Main execution steps for the test command. More... | |
class | etr.exception.UserError |
A user error should never result in a back trace but a user friendly message about the error. More... | |
class | etr.exception.DeferredException |
Exception indicating that one or more exceptions was caught but execution should not stop so the error was deferred and this exception was thrown after the execution. More... | |
class | etr.exception.AbortException |
Exception indicating that test execution should be aborted. More... | |
class | etr.info.InfoRegister |
Class holding general information about a test session. More... | |
class | etr.plugin.PluginMgr |
Plugin instance manager. More... | |
class | etr.plugin.PluginRegister |
Plugin register containing types but not instances of plugins. More... | |
class | etr.plugin.Plugin |
Plugin base class to simplify implementation. More... | |
class | etr.plugins.jinja2.Renderer |
Jinja renderer. More... | |
class | etr.plugins.resources.Storage |
Provides the storage abstraction for Resources. More... | |
class | etr.plugins.resources.RemoteService |
Adapter for the remote resource manager service. More... | |
class | etr.plugins.resources.LocalResources |
Acquire/release local resources, as specified by config files. More... | |
class | etr.plugins.resources.ResourceManager |
Resource Manager that acquires and releases resources as well as keeping the record of acquired/released resources. More... | |
class | etr.result.TextTestResult |
Outputs test results as text on a stream. More... | |
class | etr.runner.Runner |
ESO Test Facility Runner. More... | |
class | etr.storage.manager.CommitContext |
Context manager that does automatic commits if no errors occur. More... | |
class | etr.storage.manager.StorageManager |
Provides the storage abstraction for etr. More... | |
class | etr.tools.logcapture.CaptureHandler |
Captures logs into a line-buffer (list). More... | |
class | etr.tools.logcapture.LogCapture |
Captures log messages into a memory buffer and allows on-demand writing captured messages to stderr. More... | |
class | etr.tools.subprocess.SignalContextManager |
Provides a context manager to be able to captue signals and forward them to a subprocess within a context manager scope. More... | |
class | etr.tools.xunit.TestCaseResult |
Result of a test case. More... | |
Functions | |
def | etr.main.main |
etr entrypoint More... | |
def | etr.plugin.plugin |
Class decorator that registers the class as a plugin. More... | |
def | etr.result.pretty_time_delta |
Prints elapsed time in a pretty format. More... | |
def | etr.runner.parse_steps |
Parse value and return a list with steps parsed with the following rules: More... | |
def | etr.runner.parse_command |
Parses the command enum strings and returns a Command enum. More... | |
def | etr.tools.subprocess.cmd_and_log |
Runs command and logs to line_handler. More... | |
def | etr.tools.tests.make_tests |
Helper that creates the list of tests execute. More... | |
def | etr.tools.xunit.parse |
Parse xunit file, or file-like object. More... | |
Coordinates running of integration test runners.
def etr.tools.subprocess.cmd_and_log | ( | command, | |
line_handler = None , |
|||
script_file = None , |
|||
kwargs | |||
) |
Runs command and logs to line_handler.
It can also generate a script file that re-creates the execution environment which can be useful for debugging outside etr.
def etr.main.main | ( | ) |
etr entrypoint
def etr.tools.tests.make_tests | ( | tests | ) |
Helper that creates the list of tests execute.
Additionally, it implements standard features that should be valid across any test runner plugin. These are:
Returns an ordered list (that may be shuffled) of tuples where each tuple contains the original sequence and the test filename, e.g.:
[(12, 'src/some_test.robot'), (1, 'src/other_test.robot'), ...]
def etr.tools.xunit.parse | ( | xunit_file | ) |
Parse xunit file, or file-like object.
def etr.runner.parse_command | ( | scmd | ) |
Parses the command enum strings and returns a Command enum.
parse_command('test').name
'TEST'
parse_command('clean').name
'CLEAN'
parse_command('info').name
'INFO'
def etr.runner.parse_steps | ( | val | ) |
Parse value and return a list with steps parsed with the following rules:
Single step e.g. 'setup':
[s.name for s in parse_steps('setup')]
['SETUP']
Starting at a step and continuing to the end: 'start:'
[s.name for s in parse_steps('setup:')]
['SETUP', 'RUN', 'TEARDOWN']
Starting from the beginning and run to specified step ':end':
[s.name for s in parse_steps(':run')]
['SETUP', 'RUN']
Starting from specified and ending at a specified step:
[s.name for s in parse_steps('run:teardown')]
['RUN', 'TEARDOWN']
Executing steps in reverse order is illegal:
parse_steps('teardown:run') # doctest: +ELLIPSIS
Traceback (most recent call last): ... etr Can only run the step sequence in order...
def etr.plugin.plugin | ( | name | ) |
Class decorator that registers the class as a plugin.
Although not it's not necessary that plugins inherit from Plugin, they need to implement the same methods.
@plugin('myplugin') class MyPlugin(Plugin): @classmethod def add_options(cls, parser): '''Optional Used to add custom command line options. @note: Must be a static method. ''' pass def setup(self, ctx:SetupContext): '''Optional Called during setup step ''' pass def run(self, ctx:RunContext): '''Optional Called during run ''' pass def teardown(self, ctx:TeardownContext): '''Optional Called during teardown ''' pass
def etr.result.pretty_time_delta | ( | seconds | ) |
Prints elapsed time in a pretty format.
pretty_time_delta(7.1)
'7.1s'
pretty_time_delta(30*60 + 1)
'30m 1s'
pretty_time_delta(3601)
'1h 0m 1s'