TestCenter Reference
|
The coordinator of test execution. More...
Public Member Functions | |
__init__ (self, cfgFile=None, verbose=False, slave=None, slaveEnvironment=None, isInsideTestCaseManager=False) | |
The default constructor. | |
onExit (self) | |
__enter__ (self) | |
__exit__ (self, *_) | |
__del__ (self) | |
stop (self) | |
shouldStop (self) | |
getTestProgress (self) | |
resetTestProgress (self, testCaseCount) | |
updateTestProgress (self, finishedTestCase=None, additionalTestCaseCount=None) | |
setUpdateProgressFunc (self, updateProgressFunc) | |
setActiveTestCase (self, testCase) | |
setTestCaseListener (self, listener) | |
setTestCases (self, testCaseList) | |
Set the list of test cases to execute. | |
setTestCasesToIgnore (self, testCaseToIgnoreList) | |
Set the list of test cases to ignore. | |
setTestGroups (self, testGroupList) | |
Set the list of test groups to respect. | |
setTestSuites (self, testSuiteList) | |
setModules (self, moduleList=[], filterList=[]) | |
Specify the list of modules to test. | |
setPackages (self, testedPkgList=[], availablePkgList=[], ignoredPkgList=[]) | |
Specify the packages that should be tested and thought available. | |
transferNodeFromExecutionToResultXML (self, nodeName, executionNode, testResultNode) | |
shouldMeasurePythonCoverageGlobally (self) | |
run (self, funcDict=None, stopSlaveAfterTestRun=True) | |
The main method which handles all the request from the master. | |
reset (self) | |
Resets the master to the state after instantiation. | |
getConfig (self) | |
logMessageWithPID (self, message) | |
logDebugWithPID (self, message) | |
logErrorWithPID (self, message) | |
logMessageWithLastError (self, message) | |
stopSlave (self) | |
Public Attributes | |
logfileDir | |
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.
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.
cfgFile | The configuration file to load. |
verbose | Show more detailed information. |
slave | Run the tests in the same MeVisLab instance using the given slave instance. |
slaveEnvironment | Environment to use for the MeVisLab slave instance. |
Definition at line 247 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.
TestCenterAdvanced.Master.Master.__del__ | ( | self | ) |
Definition at line 318 of file Master.py.
References TestCenterAdvanced.Master.Master.onExit().
TestCenterAdvanced.Master.Master.__exit__ | ( | self, | |
* | _ ) |
Definition at line 315 of file Master.py.
References TestCenterAdvanced.Master.Master.onExit().
TestCenterAdvanced.Master.Master.getConfig | ( | self | ) |
Definition at line 1028 of file Master.py.
References TestCenterAdvanced.Master.Master.__config, TestCenterAdvanced.Master.Master.__isSlaveRunning(), and TestCenterAdvanced.Master.Master.__slaveProc.
TestCenterAdvanced.Master.Master.getTestProgress | ( | self | ) |
Definition at line 334 of file Master.py.
References TestCenterAdvanced.Master.Master.__lock, and TestCenterAdvanced.Master.Master.__testProgress.
TestCenterAdvanced.Master.Master.logDebugWithPID | ( | self, | |
message ) |
Definition at line 1046 of file Master.py.
References TestCenterAdvanced.Master.SlaveProcess.__logger, TestCenterAdvanced.Master.Master.__logger, TestCenterAdvanced.Master.SlaveProcess.logMessageWithPID(), and TestCenterAdvanced.Master.Master.logMessageWithPID().
Referenced by TestCenterAdvanced.Master.Master.logMessageWithLastError(), and TestCenterAdvanced.Master.Master.stopSlave().
TestCenterAdvanced.Master.Master.logErrorWithPID | ( | self, | |
message ) |
Definition at line 1049 of file Master.py.
References TestCenterAdvanced.Master.SlaveProcess.__logger, TestCenterAdvanced.Master.Master.__logger, TestCenterAdvanced.Master.SlaveProcess.logMessageWithPID(), and TestCenterAdvanced.Master.Master.logMessageWithPID().
Referenced by TestCenterAdvanced.Master.SlaveProcess.finish(), TestCenterAdvanced.Master.Master.logMessageWithLastError(), TestCenterAdvanced.Master.Master.stopSlave(), and TestCenterAdvanced.Master.SlaveProcess.wasKilled().
TestCenterAdvanced.Master.Master.logMessageWithLastError | ( | self, | |
message ) |
Definition at line 1052 of file Master.py.
References TestCenterAdvanced.Master.Master.__com, TestCenterAdvanced.Slave.TestCaseRemoteListener.__com, TestCenterAdvanced.Slave.Slave.__com, TestCenterAdvanced.Master.Master.__config, TestCenterAdvanced.Master.Master.__connectToSlave(), TestCenterAdvanced.Master.Master.__isInsideTestCaseManager, TestCenterAdvanced.Slave.Slave.__isInsideTestCaseManager, TestCenterAdvanced.Master.Master.__isSlaveRunning(), TestCenterAdvanced.Master.SlaveProcess.__logger, TestCenterAdvanced.Master.Master.__logger, TestCenterAdvanced.Master.Master.__sendRequest(), TestCenterAdvanced.Master.Master.__slave, TestCenterAdvanced.Master.Master.__slaveEnvironment, TestCenterAdvanced.Master.Master.__slaveProc, TestCenterAdvanced.Master.Master.__testCfg, TestCenterAdvanced.Slave.Slave.__testCfg, TestCenterAdvanced.Master.Master.__xmlRoot, TestCenterAdvanced.TestCase.TestCase.__xmlRoot, TestSupport.FieldValueTests.FieldValueTestCaseSet.__xmlRoot, TestCenterAdvanced.Master.SlaveProcess.logDebugWithPID(), TestCenterAdvanced.Master.Master.logDebugWithPID(), TestCenterAdvanced.Master.SlaveProcess.logErrorWithPID(), TestCenterAdvanced.Master.Master.logErrorWithPID(), TestCenterAdvanced.Master.Master.logfileDir, TestCenterAdvanced.Master.Master.logMessageWithLastError(), and TestCenterAdvanced.Master.Master.stopSlave().
Referenced by TestCenterAdvanced.Master.Master.logMessageWithLastError().
TestCenterAdvanced.Master.Master.logMessageWithPID | ( | self, | |
message ) |
Definition at line 1041 of file Master.py.
References TestCenterAdvanced.Master.Master.__slaveProc.
Referenced by TestCenterAdvanced.Master.SlaveProcess.finish(), TestCenterAdvanced.Master.SlaveProcess.logDebugWithPID(), TestCenterAdvanced.Master.Master.logDebugWithPID(), TestCenterAdvanced.Master.SlaveProcess.logErrorWithPID(), and TestCenterAdvanced.Master.Master.logErrorWithPID().
TestCenterAdvanced.Master.Master.onExit | ( | self | ) |
Definition at line 305 of file Master.py.
References TestCenterAdvanced.Master.Master.__hangingSlaves, TestCenterAdvanced.Master.SlaveProcess.__logger, and TestCenterAdvanced.Master.Master.__logger.
Referenced by TestCenterAdvanced.Master.Master.__del__(), and TestCenterAdvanced.Master.Master.__exit__().
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 1022 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().
TestCenterAdvanced.Master.Master.resetTestProgress | ( | self, | |
testCaseCount ) |
Definition at line 340 of file Master.py.
References TestCenterAdvanced.Master.Master.__lock, TestCenterAdvanced.Master.Master.__testProgress, and TestCenterAdvanced.Master.Master.reset().
Referenced by TestCenterAdvanced.Master.Master.run().
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.
funcDict | A dictionary with information which test functions for which test cases should be executed. |
stopSlaveAfterTestRun | If False, then the slave can be re-used for another test run after resetting the master. |
Definition at line 885 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, TestCenterAdvanced.Master.Master.resetTestProgress(), TestCenterAdvanced.Master.Master.setActiveTestCase(), TestCenterAdvanced.Master.Master.shouldMeasurePythonCoverageGlobally(), TestCenterAdvanced.Master.Master.stopSlave(), TestCenterAdvanced.Master.unicode, and TestCenterAdvanced.Master.Master.updateTestProgress().
TestCenterAdvanced.Master.Master.setActiveTestCase | ( | self, | |
testCase ) |
Definition at line 373 of file Master.py.
References TestCenterAdvanced.Master.Master.__lock, and TestCenterAdvanced.Master.Master.__testProgress.
Referenced by TestCenterAdvanced.Master.Master.run().
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").
moduleList | List of names of modules to take into account. |
filterList | List of filters to select modules. |
Definition at line 442 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.
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.
testedPkgList | The list of packages tests are taken from. |
availablePkgList | List of packages that should be available. |
ignoredPkgList | List of package that should be ignored when using wildcard |
Definition at line 462 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.__stackTraceFile, 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, and TestCenterAdvanced.Master.unicode.
TestCenterAdvanced.Master.Master.setTestCaseListener | ( | self, | |
listener ) |
Definition at line 396 of file Master.py.
References TestCenterAdvanced.Master.Master.__testCaseListener, TestCenterAdvanced.Slave.Slave.__testCaseListener, and TestCenterAdvanced.TestCase.TestCase.__testCaseListener.
Referenced by TestCenterAdvanced.Slave.Slave.runCommand().
TestCenterAdvanced.Master.Master.setTestCases | ( | self, | |
testCaseList ) |
Set the list of test cases to execute.
testCaseList | List of names of test cases to exeucte. |
Definition at line 402 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.
TestCenterAdvanced.Master.Master.setTestCasesToIgnore | ( | self, | |
testCaseToIgnoreList ) |
Set the list of test cases to ignore.
testCaseToIgnoreList | List of names of test cases to ignore. |
Definition at line 413 of file Master.py.
References TestCenterAdvanced.Master.Master.__testCasesToIgnoreList.
TestCenterAdvanced.Master.Master.setTestGroups | ( | self, | |
testGroupList ) |
Set the list of test groups to respect.
testGroupList | List of test groups to take into account. |
Definition at line 420 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.
TestCenterAdvanced.Master.Master.setTestSuites | ( | self, | |
testSuiteList ) |
TestCenterAdvanced.Master.Master.setUpdateProgressFunc | ( | self, | |
updateProgressFunc ) |
Definition at line 370 of file Master.py.
References TestCenterAdvanced.Master.Master.__updateProgressFunc.
TestCenterAdvanced.Master.Master.shouldMeasurePythonCoverageGlobally | ( | self | ) |
Definition at line 871 of file Master.py.
References TestCenterAdvanced.Master.Master.__config.
Referenced by TestCenterAdvanced.Master.Master.run().
TestCenterAdvanced.Master.Master.shouldStop | ( | self | ) |
Definition at line 328 of file Master.py.
References TestCenterAdvanced.Master.Master.__lock, and TestCenterAdvanced.Master.Master.__shouldStop.
Referenced by TestCenterAdvanced.Master.Master.transferNodeFromExecutionToResultXML().
TestCenterAdvanced.Master.Master.stop | ( | self | ) |
Definition at line 323 of file Master.py.
References TestCenterAdvanced.Master.Master.__lock, and TestCenterAdvanced.Master.Master.__shouldStop.
TestCenterAdvanced.Master.Master.stopSlave | ( | self | ) |
Definition at line 1124 of file Master.py.
References TestCenterAdvanced.Master.Master.__com, TestCenterAdvanced.Slave.TestCaseRemoteListener.__com, TestCenterAdvanced.Slave.Slave.__com, TestCenterAdvanced.Master.Master.__config, TestCenterAdvanced.Master.Master.__hangingSlaves, TestCenterAdvanced.Master.Master.__isSlaveStopped(), TestCenterAdvanced.Master.SlaveProcess.__logger, TestCenterAdvanced.Master.Master.__logger, TestCenterAdvanced.Master.Master.__sendRequest(), TestCenterAdvanced.Master.Master.__slave, TestCenterAdvanced.Master.Master.__slaveProc, TestCenterAdvanced.Master.Master.__stackTraceFile, TestCenterAdvanced.Master.Master.__startSlave(), TestCenterAdvanced.Master.Master.__testCaseListener, TestCenterAdvanced.Slave.Slave.__testCaseListener, TestCenterAdvanced.TestCase.TestCase.__testCaseListener, TestCenterAdvanced.Master.SlaveProcess.logDebugWithPID(), TestCenterAdvanced.Master.Master.logDebugWithPID(), TestCenterAdvanced.Master.SlaveProcess.logErrorWithPID(), and TestCenterAdvanced.Master.Master.logErrorWithPID().
Referenced by TestCenterAdvanced.Master.Master.logMessageWithLastError(), TestCenterAdvanced.Master.Master.run(), and TestCenterAdvanced.Master.Master.transferNodeFromExecutionToResultXML().
TestCenterAdvanced.Master.Master.transferNodeFromExecutionToResultXML | ( | self, | |
nodeName, | |||
executionNode, | |||
testResultNode ) |
Definition at line 747 of file Master.py.
References TestCenterAdvanced.Master.Master.__com, TestCenterAdvanced.Slave.TestCaseRemoteListener.__com, TestCenterAdvanced.Slave.Slave.__com, TestCenterAdvanced.Master.Master.__config, TestCenterAdvanced.Master.SlaveProcess.__logger, TestCenterAdvanced.Master.Master.__logger, TestCenterAdvanced.Master.Master.__sendRequest(), TestCenterAdvanced.Master.Master.__startSlave(), TestCenterAdvanced.Master.Master.__testCaseListener, TestCenterAdvanced.Slave.Slave.__testCaseListener, TestCenterAdvanced.TestCase.TestCase.__testCaseListener, TestCenterAdvanced.Master.Master.__testFailed(), TestCenterAdvanced.Master.Master.shouldStop(), TestCenterAdvanced.Master.Master.stopSlave(), and TestCenterAdvanced.Master.Master.transferNodeFromExecutionToResultXML().
Referenced by TestCenterAdvanced.Master.Master.transferNodeFromExecutionToResultXML().
TestCenterAdvanced.Master.Master.updateTestProgress | ( | self, | |
finishedTestCase = None, | |||
additionalTestCaseCount = None ) |
Definition at line 345 of file Master.py.
References TestCenterAdvanced.Master.Master.__lock, and TestCenterAdvanced.Master.Master.__testProgress.
Referenced by TestCenterAdvanced.Master.Master.run().
TestCenterAdvanced.Master.Master.logfileDir |
Definition at line 270 of file Master.py.
Referenced by TestCenterAdvanced.Master.Master.logMessageWithLastError().