Table Of Contents

This Page

Internals

funkload.TestRunner – TestRunner

FunkLoad Test runner.

Similar to unittest.TestProgram but: * you can pass the python module to load * able to override funkload configuration file using command line options * cool color output * support doctest with python2.4

$Id: TestRunner.py 24758 2005-08-31 12:33:00Z bdelbosc $

class funkload.TestRunner.ColoredTextTestRunner(stream=<open file '<stderr>', mode 'w' at 0x2b593aec21e0>, descriptions=True, verbosity=1, failfast=False, buffer=False, resultclass=None)

Override to be color powered.

run(test)

Run the given test case or test suite.

class funkload.TestRunner.TestLoader

Override to add options when instanciating test case.

loadTestsFromModule(module)

Return a suite of all tests cases contained in the given module

loadTestsFromName(name, module=None)

Return a suite of all tests cases given a string specifier.

The name may resolve either to a module, a test case class, a test method within a test case class, or a callable object which returns a TestCase or TestSuite instance.

The method optionally resolves the names relative to a given module.

loadTestsFromTestCase(testCaseClass)

Return a suite of all tests cases contained in testCaseClass

class funkload.TestRunner.TestProgram(module=None, defaultTest=None, argv=None, testRunner=None, testLoader=<unittest.loader.TestLoader object at 0x2b593fae8a90>)

Override to add a python module and more options.

loadTests()

Load unit and doc tests from modules or names.

parseArgs(argv)

Parse programs args.

runTests()

Launch the tests.

funkload.TestRunner.display_testcases(suite)

Display test cases of the suite.

funkload.TestRunner.filter_testcases(suite, cpattern, negative_pattern=False)

Filter a suite with test names that match the compiled regex pattern.

funkload.TestRunner.main()

Default main.

funkload.BenchRunner – BenchRunner

FunkLoad Bench runner.

$Id: BenchRunner.py 24746 2005-08-31 09:59:27Z bdelbosc $

class funkload.BenchRunner.BenchRunner(module_name, class_name, method_name, options)

Run a unit test in bench mode.

addThreads(number_of_threads)

Adds new threads to existing list. Used to dynamically add new threads during a debug bench run.

createThreads(cycle, number_of_threads)

Creates number_of_threads threads and returns as a list.

NOTE: This method is not thread safe. Thread safety must be handled by the caller.

deleteThreads(number_of_threads)

Stops given number of threads and deletes from thread list.

NOTE: This method is not thread safe. Thread safety must be handled by the caller.

dumpThreads()

Display all different traceback of Threads for debugging.

Require threadframe module.

getMonitorsConfig()

Get monitors configuration from hosts

logging(cycle, cvus)

Log activity during duration.

logr(message)

Log to the test result file.

logr_close()

Stop logging tag.

logr_open()

Start logging tag.

removeThreads(number_of_threads)

Removes threads. Used to dynamically remove threads during a debug bench run.

run()

Run all the cycles.

return 0 on success, 1 if there were some failures and -1 on errors.

startMonitors(monitor_key)

Start monitoring on hosts list.

startThreads(cycle, number_of_threads)

Starts threads.

stopMonitors(monitor_key)

Stop monitoring and save xml result.

stopThreads()

Stops all running threads.

class funkload.BenchRunner.LoopTestRunner(test_module, test_class, test_name, options, cycle, cvus, thread_id, thread_signaller, sleep_time, debug=False, feedback=None)

Run a unit test in loop.

run()

Run a test in loop.

class funkload.BenchRunner.ThreadData(thread, thread_id, thread_signaller)

Container for thread related data.

class funkload.BenchRunner.ThreadSignaller

A simple class to signal whether a thread should continue running or stop.

funkload.BenchRunner.add_cycle_result(status)

Count number of result.

funkload.BenchRunner.get_cycle_results()

Return counters.

funkload.BenchRunner.get_status(success, failures, errors, color=False)

Return a status and an exit code.

funkload.BenchRunner.load_unittest(test_module, test_class, test_name, options)

instantiate a unittest.

funkload.BenchRunner.main(args=['-b', 'html', '-d', 'build/doctrees', 'source', 'build/html'])

Default main.

funkload.BenchRunner.reset_cycle_results()

Clear the previous results.

funkload.Distributed – Distributed