etr
4.0-pre
|
Etr Test Runner. More...
Modules | |
Robot Framework Libraries | |
Robot Framework libraries provided by etr. | |
Files | |
file | __init__.py |
file | command.py |
file | context.py |
file | exception.py |
file | info.py |
file | main.py |
file | plugin.py |
etr plugin manager | |
file | jinja2.py |
file | nomad.py |
file | nose.py |
file | pytest.py |
file | resources.py |
file | __init__.py |
Robot Framework plugin for etr. | |
file | result.py |
file | runner.py |
file | __init__.py |
file | manager.py |
file | console.py |
file | logcapture.py |
file | subprocess.py |
file | tests.py |
file | xunit.py |
file | etr.py |
file | wscript |
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 test execution is aborted by user. More... | |
class | etr.exception.AbortException |
Exception indicating a transient error. More... | |
class | etr.exception.TransientException |
Exception indicating that an error occurred due to external circumstance with user provided data. More... | |
class | etr.info.InfoRegister |
Class holding general information about a test session. More... | |
class | etr.plugin.Plugin |
Plugin base class to simplify implementation. 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.plugins.jinja2.Renderer |
Jinja renderer. More... | |
class | etr.plugins.jinja2.Plugin |
Jinja2 plugin. More... | |
class | etr.plugins.nomad.Plugin |
Nomad plugin that enables deployment of Nomad jobs. More... | |
class | etr.plugins.nose.Plugin |
Nose plugin for etr to allow execution of nose test suites. More... | |
class | etr.plugins.pytest.Plugin |
Pytest plugin for etr to allow execution of Pytest test suites. 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.plugins.resources.Plugin |
Resources plugin. More... | |
class | etr.plugins.robot.Plugin |
Robot Framework plugin for etr to allow execution of robot test suites. More... | |
class | etr.result.ExitCode |
Application exit codes Codes are ordered by severity such that the highest number is reported. 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.subprocess.KillOrphansContextManager |
Use instead of popen to perform cleanup of orphan subprocesses. More... | |
class | etr.tools.xunit.TestCaseResult |
Result of a test case. More... | |
Functions | |
def | etr.main.main () |
etr entrypoint More... | |
def | etr.plugin.plugin (name) |
Class decorator that registers the class as a plugin. More... | |
def | etr.result.pretty_time_delta (seconds) |
Prints elapsed time in a pretty format. More... | |
def | etr.runner.parse_steps (str val) |
Parse value and return a list with steps parsed with the following rules: More... | |
def | etr.runner.parse_command (str scmd) |
Parses the command enum strings and returns a Command enum. More... | |
def | etr.tools.console.to_console (msg, file=None) |
Print msg to both console and logger. More... | |
def | etr.tools.subprocess.cmd_and_log (List[str] command, *Optional[bool] kill_orphans=None, Optional[Callable[[str], None]] line_handler=None, Optional[bool] script_file=None, **kwargs) |
Runs command and logs to line_handler. More... | |
def | etr.tools.tests.make_basename (index, test_file_path) |
Helper that creates a unified basename out of the test index and the test file path. More... | |
def | etr.tools.tests.make_tests (list tests, bool randomize, list test_filters) |
Helper that creates the list of tests execute. More... | |
TestSuiteResult | etr.tools.xunit.parse_ts (elem) |
Parse <testsuite> element. More... | |
List[TestSuiteResult] | etr.tools.xunit.parse_root (root) |
Parse xunit root element. More... | |
List[TestSuiteResult] | etr.tools.xunit.parse (xunit_file) |
Parse xunit file, or file-like object. More... | |
Etr Test Runner.
def etr.tools.subprocess.cmd_and_log | ( | List[str] | command, |
*Optional[bool] | kill_orphans = None , |
||
Optional[Callable[[str], None]] | line_handler = None , |
||
Optional[bool] | 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.
command | Command to execute. |
kill_orphans | Whether to kill orphaned processes or not. Default is True. |
line_handler | Callback invoked for each line of output of command |
script_file | Whether or not to generate a script file that reproduce the command invocation. |
def etr.main.main | ( | ) |
etr entrypoint
def etr.tools.tests.make_basename | ( | index, | |
test_file_path | |||
) |
Helper that creates a unified basename out of the test index and the test file path.
def etr.tools.tests.make_tests | ( | list | tests, |
bool | randomize, | ||
list | test_filters | ||
) |
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.:
List[TestSuiteResult] etr.tools.xunit.parse | ( | xunit_file | ) |
Parse xunit file, or file-like object.
def etr.runner.parse_command | ( | str | scmd | ) |
Parses the command enum strings and returns a Command enum.
List[TestSuiteResult] etr.tools.xunit.parse_root | ( | root | ) |
Parse xunit root element.
Returns a list of TestSuiteResult instances
The xunit xml schema also contains aggregate information, but we skip that bit and process info from the parsed testcases.
def etr.runner.parse_steps | ( | str | val | ) |
Parse value and return a list with steps parsed with the following rules:
Single step e.g. 'setup':
Starting at a step and continuing to the end: 'start:'
Starting from the beginning and run to specified step ':end':
Starting from specified and ending at a specified step:
Executing steps in reverse order is illegal:
TestSuiteResult etr.tools.xunit.parse_ts | ( | elem | ) |
Parse <testsuite> element.
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.
def etr.tools.console.to_console | ( | msg, | |
file = None |
|||
) |
Print msg to both console and logger.