Skip to content

Replace repetative XML writes with an underlying CurrentState singleton class

Jonathan Hartman requested to merge dev_singleton_classes into dev

Adds two new files - objects/errors.py and state/current_state.py. CurrentState from current_state.py is a singleton class like Settings, the idea being that this object will track all information we need to pass between stages and between runs of the pipeline, as well as providing a cleaner and more standardized way of adding testcases to the JUnit XML. objects/errors.py contains a series of classes which all inherit BaseTestCase, which provides a simple method for adding itself to a JUnitXML.TestSuites object. The individual classes can then provide simplified ways of formatting a test case, e.g. CredentialsTestCase(is_valid=True) can set the id, name, type, message, and testsuite for a TestCase object.

Merge request reports

Loading