subunit2sql/doc/source/target-extensions.rst
Clint Byrum 35b10a9de7 Add an extension capability for adding targets
This is meant to facilitate anything else that wants to look at the
subunit stream and do something with it.

The unit test for main is simply intended to ensure that found targets
are passed in to the reader. The unit test for ReadSubunit verifies that
any targets passed in are in fact copied into the final result
processor.

Change-Id: I5200521a3c33d61ea4e4af8cfa900eff2c698355
Implements: counter-inspection
2015-11-10 23:06:54 -08:00

854 B

Target Extensions

Subunit2SQL is meant to be generic. But while processing subunit streams, you may have some site-specific behavior you'd like to enable, such as loading attachments into a storage location that can be extracted later.

To do this, you must create a plugin in the subunit2sql.target entry point namespace, and it will be invoked along with the other targets that subunit2sql invokes normally to store tests in a SQL database.

The plugin's entry point should be a class that extends testtools.StreamResult. It should also add a class method, enabled, which returns False if the plugin has no chance of functioning. The enabled method can also do any configuration file preparation if you are using oslo.config. The constructor will not be executed until after all config options are loaded.