TestCenter Reference
TestCenterAdvanced.Master.Master Class Reference

The coordinator of test execution. More...

Public Member Functions

 __init__ (self, cfgFile=None, verbose=False, slave=None, slaveEnvironment=None, isInsideTestCaseManager=False)
 Initialize the master process.
 
 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 take into account.
 
 setTestSuites (self, testSuiteList)
 
 setModules (self, moduleList=None, filterList=None)
 Specify the list of modules to test.
 
 setPackages (self, testedPkgList=None, availablePkgList=None, ignoredPkgList=None)
 Specify the packages that should be tested and thought available.
 
 setTestTimeoutFactor (self, float factor)
 
 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)
 Stop the slave process.
 

Static Public Member Functions

 defaultTestTimeoutFactor ()
 
 transferNodeFromExecutionToResultXML (nodeName, executionNode, testResultNode)
 

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 instantiated directly in the master.

Definition at line 209 of file Master.py.

Constructor & Destructor Documentation

◆ __init__()

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

◆ __del__()

TestCenterAdvanced.Master.Master.__del__ (   self)

Definition at line 302 of file Master.py.

References TestCenterAdvanced.Master.Master.onExit().

Member Function Documentation

◆ __enter__()

TestCenterAdvanced.Master.Master.__enter__ (   self)

Definition at line 296 of file Master.py.

◆ __exit__()

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

Definition at line 299 of file Master.py.

References TestCenterAdvanced.Master.Master.onExit().

◆ defaultTestTimeoutFactor()

TestCenterAdvanced.Master.Master.defaultTestTimeoutFactor ( )
static

Definition at line 468 of file Master.py.

◆ getConfig()

TestCenterAdvanced.Master.Master.getConfig (   self)

◆ getTestProgress()

TestCenterAdvanced.Master.Master.getTestProgress (   self)

◆ logDebugWithPID()

◆ logErrorWithPID()

◆ logMessageWithLastError()

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

◆ logMessageWithPID()

◆ onExit()

◆ reset()

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 1138 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()

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

◆ 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.

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 972 of file Master.py.

References TestCenterAdvanced.Master.Master.__buildTestAgenda(), TestCenterAdvanced.Slave.Slave.__buildTestAgenda(), 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.__sortNodes(), 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(), and TestCenterAdvanced.Master.Master.updateTestProgress().

◆ setActiveTestCase()

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

◆ setModules()

TestCenterAdvanced.Master.Master.setModules (   self,
  moduleList = None,
  filterList = None 
)

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 419 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()

TestCenterAdvanced.Master.Master.setPackages (   self,
  testedPkgList = None,
  availablePkgList = None,
  ignoredPkgList = None 
)

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 437 of file Master.py.

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

◆ setTestCaseListener()

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

◆ setTestCases()

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

◆ setTestCasesToIgnore()

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

Set the list of test cases to ignore.

Definition at line 400 of file Master.py.

References TestCenterAdvanced.Master.Master.__testCasesToIgnoreList.

◆ setTestGroups()

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

◆ setTestSuites()

◆ setTestTimeoutFactor()

◆ setUpdateProgressFunc()

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

Definition at line 359 of file Master.py.

References TestCenterAdvanced.Master.Master.__updateProgressFunc.

◆ shouldMeasurePythonCoverageGlobally()

TestCenterAdvanced.Master.Master.shouldMeasurePythonCoverageGlobally (   self)

◆ shouldStop()

TestCenterAdvanced.Master.Master.shouldStop (   self)

◆ stop()

TestCenterAdvanced.Master.Master.stop (   self)

◆ stopSlave()

TestCenterAdvanced.Master.Master.stopSlave (   self)

◆ transferNodeFromExecutionToResultXML()

◆ updateTestProgress()

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

Member Data Documentation

◆ logfileDir

TestCenterAdvanced.Master.Master.logfileDir

Definition at line 257 of file Master.py.

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


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