TestCenter Reference
TestCenterAdvanced.Master.Master Class Reference

The coordinator of test execution. More...

Inheritance diagram for TestCenterAdvanced.Master.Master:

Public Member Functions

def __init__ (self, cfgFile=None, verbose=False, slave=None, slaveEnvironment=None, isInsideTestCaseManager=False)
 The default constructor. More...
 
def onExit (self)
 
def __enter__ (self)
 
def __exit__ (self, *_)
 
def __del__ (self)
 
def stop (self)
 
def shouldStop (self)
 
def getTestProgress (self)
 
def resetTestProgress (self, testCaseCount)
 
def updateTestProgress (self, finishedTestCase=None, additionalTestCaseCount=None)
 
def setUpdateProgressFunc (self, updateProgressFunc)
 
def setActiveTestCase (self, testCase)
 
def setTestCaseListener (self, listener)
 
def setTestCases (self, testCaseList)
 Set the list of test cases to execute. More...
 
def setTestCasesToIgnore (self, testCaseToIgnoreList)
 Set the list of test cases to ignore. More...
 
def setTestGroups (self, testGroupList)
 Set the list of test groups to respect. More...
 
def setTestSuites (self, testSuiteList)
 
def setModules (self, moduleList=[], filterList=[])
 Specify the list of modules to test. More...
 
def setPackages (self, testedPkgList=[], availablePkgList=[], ignoredPkgList=[])
 Specify the packages that should be tested and thought available. More...
 
def transferNodeFromExecutionToResultXML (self, nodeName, executionNode, testResultNode)
 
def shouldMeasurePythonCoverageGlobally (self)
 
def run (self, funcDict=None, stopSlaveAfterTestRun=True)
 The main method which handles all the request from the master. More...
 
def reset (self)
 Resets the master to the state after instantiation. More...
 
def getConfig (self)
 
def logMessageWithPID (self, message)
 
def logDebugWithPID (self, message)
 
def logErrorWithPID (self, message)
 
def logMessageWithLastError (self, message)
 
def stopSlave (self)
 

Public Attributes

 logfileDir
 

Detailed Description

The coordinator of test execution.

The master can be used in two ways: either with tests executed in another MeVisLab instance or in the same. In the first scenario a new MeVisLab instance is started, the TestCenter module loaded via the runMacro parameter and communication handled using socket based interprocess communication. In the second one the slave is instanciated directly in the master.

Definition at line 203 of file Master.py.

Constructor & Destructor Documentation

◆ __init__()

def TestCenterAdvanced.Master.Master.__init__ (   self,
  cfgFile = None,
  verbose = False,
  slave = None,
  slaveEnvironment = None,
  isInsideTestCaseManager = False 
)

The default constructor.

The constructor is used to make some basic settings, like usage of a given configuration file (the default is tc_cfg_<platform>.xml), being more verbose and offline usage.

Parameters
cfgFileThe configuration file to load.
verboseShow more detailed information.
slaveRun the tests in the same MeVisLab instance using the given slave instance.
slaveEnvironmentEnvironment to use for the MeVisLab slave instance.

Definition at line 240 of file Master.py.

References TestCenterAdvanced.Master.Master.__com, TestCenterAdvanced.Slave.TestCaseRemoteListener.__com, TestCenterAdvanced.Slave.Slave.__com, TestCenterAdvanced.Master.Master.__config, TestCenterAdvanced.Master.Master.__lock, TestCenterAdvanced.Master.SlaveProcess.__logger, TestCenterAdvanced.Master.Master.__logger, TestCenterAdvanced.Master.Master.__shouldStop, TestCenterAdvanced.Master.Master.__slave, TestCenterAdvanced.Master.Master.__slaveEnvironment, TestCenterAdvanced.Master.Master.__testCaseListener, TestCenterAdvanced.Slave.Slave.__testCaseListener, TestCenterAdvanced.TestCase.TestCase.__testCaseListener, TestCenterAdvanced.Master.Master.__testedPkgList, and TestCenterAdvanced.Master.Master.__testProgress.

◆ __del__()

def TestCenterAdvanced.Master.Master.__del__ (   self)

Definition at line 306 of file Master.py.

References TestCenterAdvanced.Master.Master.onExit().

Member Function Documentation

◆ __enter__()

def TestCenterAdvanced.Master.Master.__enter__ (   self)

Definition at line 300 of file Master.py.

◆ __exit__()

def TestCenterAdvanced.Master.Master.__exit__ (   self,
_ 
)

Definition at line 303 of file Master.py.

References TestCenterAdvanced.Master.Master.onExit().

◆ getConfig()

def TestCenterAdvanced.Master.Master.getConfig (   self)

◆ getTestProgress()

def TestCenterAdvanced.Master.Master.getTestProgress (   self)

◆ logDebugWithPID()

◆ logErrorWithPID()

◆ logMessageWithLastError()

def TestCenterAdvanced.Master.Master.logMessageWithLastError (   self,
  message 
)

◆ logMessageWithPID()

◆ onExit()

◆ reset()

def TestCenterAdvanced.Master.Master.reset (   self)

Resets the master to the state after instantiation.

In particular, it removes the configuration and the results of the last test run. After resetting the master you can start another test run with other tests.

Definition at line 990 of file Master.py.

References TestCenterAdvanced.Master.Master.__testCfg, TestCenterAdvanced.Slave.Slave.__testCfg, TestCenterAdvanced.Master.Master.__testConfigSkeleton(), TestCenterAdvanced.Master.Master.__xmlRoot, TestCenterAdvanced.TestCase.TestCase.__xmlRoot, and TestSupport.FieldValueTests.FieldValueTestCaseSet.__xmlRoot.

Referenced by TestCenterAdvanced.Master.Master.resetTestProgress().

◆ resetTestProgress()

def TestCenterAdvanced.Master.Master.resetTestProgress (   self,
  testCaseCount 
)

◆ run()

def TestCenterAdvanced.Master.Master.run (   self,
  funcDict = None,
  stopSlaveAfterTestRun = True 
)

The main method which handles all the request from the master.

The master asks the slave to serve some request. This is divided into two major blocks; on the first hand verifying whether the given information is valid and what tests to execute and on the second hand to process the given tests.

Parameters
funcDictA dictionary with information which test functions for which test cases should be executed.
stopSlaveAfterTestRunIf False, then the slave can be re-used for another test run after resetting the master.

Definition at line 853 of file Master.py.

References TestCenterAdvanced.Master.Master.__buildTestAgenda(), TestCenterAdvanced.Slave.Slave.__buildTestAgenda(), TestCenterAdvanced.Slave.Slave.__buildTestCaseAgenda(), TestCenterAdvanced.Master.Master.__buildTestCaseAgenda(), TestCenterAdvanced.Master.Master.__config, TestCenterAdvanced.Master.Master.__doTest(), TestCenterAdvanced.Slave.Slave.__doTest(), TestCenterAdvanced.Master.Master.__handleExtraTestCaseResults(), TestCenterAdvanced.Master.SlaveProcess.__logger, TestCenterAdvanced.Master.Master.__logger, TestCenterAdvanced.Master.Master.__slave, TestCenterAdvanced.Master.Master.__slaveProc, TestCenterAdvanced.Master.Master.__startSlave(), TestCenterAdvanced.Master.Master.__testCaseListener, TestCenterAdvanced.Slave.Slave.__testCaseListener, TestCenterAdvanced.TestCase.TestCase.__testCaseListener, TestCenterAdvanced.Master.Master.__testTypeAndName(), TestCenterAdvanced.Master.Master.__updateProgressFunc, TestCenterAdvanced.Master.Master.__xmlRoot, TestCenterAdvanced.TestCase.TestCase.__xmlRoot, TestSupport.FieldValueTests.FieldValueTestCaseSet.__xmlRoot, TestSupport.Logging.error(), TestSupport.Logging.info(), TestCenterAdvanced.Master.Master.resetTestProgress(), TestCenterAdvanced.Master.Master.setActiveTestCase(), TestCenterAdvanced.Master.Master.shouldMeasurePythonCoverageGlobally(), TestCenterAdvanced.Master.Master.stopSlave(), TestCenterAdvanced.Master.unicode, TestCenterAdvanced.Master.Master.updateTestProgress(), and TestSupport.Logging.warning().

◆ setActiveTestCase()

def TestCenterAdvanced.Master.Master.setActiveTestCase (   self,
  testCase 
)

◆ setModules()

def TestCenterAdvanced.Master.Master.setModules (   self,
  moduleList = [],
  filterList = [] 
)

Specify the list of modules to test.

The filters can be used to specify a larger list of modules, for example all the modules of a certain author ("author:Jon Doe").

Parameters
moduleListList of names of modules to take into account.
filterListList of filters to select modules.

Definition at line 430 of file Master.py.

References TestCenterAdvanced.Master.Master.__testCfg, TestCenterAdvanced.Slave.Slave.__testCfg, TestCenterAdvanced.Master.Master.__xmlRoot, TestCenterAdvanced.TestCase.TestCase.__xmlRoot, and TestSupport.FieldValueTests.FieldValueTestCaseSet.__xmlRoot.

◆ setPackages()

def TestCenterAdvanced.Master.Master.setPackages (   self,
  testedPkgList = [],
  availablePkgList = [],
  ignoredPkgList = [] 
)

Specify the packages that should be tested and thought available.

The packages tested are those that test cases are taken from. The available packages are those that should be expected to be there. This is important for checking the meta information like the seeAlso tags. In released installers all seeAlso links should only point to modules being the public packages.

Parameters
testedPkgListThe list of packages tests are taken from.
availablePkgListList of packages that should be available.
ignoredPkgListList of package that should be ignored when using wildcard

Definition at line 450 of file Master.py.

References TestCenterAdvanced.Master.Master.__buildListOfTestFunctionsToExecute(), TestCenterAdvanced.Master.Master.__config, TestCenterAdvanced.Master.Master.__createTimeoutTooHighErrorFunction(), TestCenterAdvanced.Master.Master.__executeTestFunctions(), TestCenterAdvanced.Master.SlaveProcess.__logger, TestCenterAdvanced.Master.Master.__logger, TestCenterAdvanced.Master.Master.__sendRequest(), TestCenterAdvanced.Master.Master.__statusMessage(), TestCenterAdvanced.Master.Master.__testCaseListener, TestCenterAdvanced.Slave.Slave.__testCaseListener, TestCenterAdvanced.TestCase.TestCase.__testCaseListener, TestCenterAdvanced.Master.Master.__testCasesToIgnoreList, TestCenterAdvanced.Master.Master.__testCfg, TestCenterAdvanced.Slave.Slave.__testCfg, TestCenterAdvanced.Master.Master.__testedPkgList, TestCenterAdvanced.Master.Master.__testTypeAndName(), TestCenterAdvanced.Master.Master.__verifyConfiguration(), TestCenterAdvanced.Master.Master.__xmlRoot, TestCenterAdvanced.TestCase.TestCase.__xmlRoot, TestSupport.FieldValueTests.FieldValueTestCaseSet.__xmlRoot, TestSupport.Logging.error(), TestCenterAdvanced.Master.unicode, and TestSupport.Logging.warning().

◆ setTestCaseListener()

def TestCenterAdvanced.Master.Master.setTestCaseListener (   self,
  listener 
)

◆ setTestCases()

def TestCenterAdvanced.Master.Master.setTestCases (   self,
  testCaseList 
)

◆ setTestCasesToIgnore()

def TestCenterAdvanced.Master.Master.setTestCasesToIgnore (   self,
  testCaseToIgnoreList 
)

Set the list of test cases to ignore.

Parameters
testCaseToIgnoreListList of names of test cases to ignore.

Definition at line 401 of file Master.py.

References TestCenterAdvanced.Master.Master.__testCasesToIgnoreList.

◆ setTestGroups()

def TestCenterAdvanced.Master.Master.setTestGroups (   self,
  testGroupList 
)

Set the list of test groups to respect.

Parameters
testGroupListList of test groups to take into account.

Definition at line 408 of file Master.py.

References TestCenterAdvanced.Master.Master.__testCfg, TestCenterAdvanced.Slave.Slave.__testCfg, TestCenterAdvanced.Master.Master.__xmlRoot, TestCenterAdvanced.TestCase.TestCase.__xmlRoot, and TestSupport.FieldValueTests.FieldValueTestCaseSet.__xmlRoot.

◆ setTestSuites()

◆ setUpdateProgressFunc()

def TestCenterAdvanced.Master.Master.setUpdateProgressFunc (   self,
  updateProgressFunc 
)

Definition at line 358 of file Master.py.

References TestCenterAdvanced.Master.Master.__updateProgressFunc.

◆ shouldMeasurePythonCoverageGlobally()

def TestCenterAdvanced.Master.Master.shouldMeasurePythonCoverageGlobally (   self)

◆ shouldStop()

def TestCenterAdvanced.Master.Master.shouldStop (   self)

◆ stop()

def TestCenterAdvanced.Master.Master.stop (   self)

◆ stopSlave()

◆ transferNodeFromExecutionToResultXML()

◆ updateTestProgress()

def TestCenterAdvanced.Master.Master.updateTestProgress (   self,
  finishedTestCase = None,
  additionalTestCaseCount = None 
)

Member Data Documentation

◆ logfileDir

TestCenterAdvanced.Master.Master.logfileDir

Definition at line 263 of file Master.py.

Referenced by TestCenterAdvanced.Master.Master.logMessageWithLastError().


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