Package buildbot :: Package process :: Module mtrlogobserver :: Class MTR
[frames] | no frames]

Class MTR

source code

properties.PropertiesMixin --+                    
                             |                    
           buildstep.BuildStep --+                
                                 |                
        buildstep.LoggingBuildStep --+            
                                     |            
              steps.shell.ShellCommand --+        
                                         |        
   steps.shell.WarningCountingShellCommand --+    
                                             |    
                              steps.shell.Test --+
                                                 |
                                                MTR


Build step that runs mysql-test-run.pl, as used in MySQL, Drizzle,
MariaDB, etc.

It uses class MtrLogObserver to parse test results out from the
output of mysql-test-run.pl, providing better completion time
estimates and summarising test failures on the waterfall page.

It also provides access to mysqld server error logs from the test
run to help debugging any problems.

Optionally, it can insert into a database data about the test run,
including details of any test failures.

Parameters:

textLimit
    Maximum number of test failures to show on the waterfall page
    (to not flood the page in case of a large number of test
    failures. Defaults to 5.

testNameLimit
    Maximum length of test names to show unabbreviated in the
    waterfall page, to avoid excessive column width. Defaults to 16.

parallel
    Value of --parallel option used for mysql-test-run.pl (number
    of processes used to run the test suite in parallel). Defaults
    to 4. This is used to determine the number of server error log
    files to download from the slave. Specifying a too high value
    does not hurt (as nonexisting error logs will be ignored),
    however if using --parallel value greater than the default it
    needs to be specified, or some server error logs will be
    missing.

dbpool
    An instance of twisted.enterprise.adbapi.ConnectionPool, or None.
    Defaults to None. If specified, results are inserted into the database
    using the ConnectionPool.

    The class process.mtrlogobserver.EqConnectionPool subclass of
    ConnectionPool can be useful to pass as value for dbpool, to
    avoid having config reloads think the Buildstep is changed
    just because it gets a new ConnectionPool instance (even
    though connection parameters are unchanged).

autoCreateTables
    Boolean, defaults to False. If True (and dbpool is specified), the
    necessary database tables will be created automatically if they do
    not exist already. Alternatively, the tables can be created manually
    from the SQL statements found in the mtrlogobserver.py source file.

test_type
test_info
    Two descriptive strings that will be inserted in the database tables if
    dbpool is specified. The test_type string, if specified, will also
    appear on the waterfall page.

Nested Classes
  MyMtrLogObserver
Instance Methods
 
__init__(self, dbpool=None, test_type=None, test_info='', description=None, descriptionDone=None, autoCreateTables=False, textLimit=5, testNameLimit=16, parallel=4, logfiles={}, lazylogfiles=True, warningPattern='MTR\'s internal check of the test case \'.*\' failed', mtr_subdir='mysql-test', **kwargs) source code
 
start(self) source code
 
getText(self, command, results) source code
 
runInteractionWithRetry(self, actionFn, *args, **kw)
Run a database transaction with dbpool.runInteraction, but retry the transaction in case of a temporary error (like connection lost).
source code
 
runQueryWithRetry(self, *args, **kw)
Run a database query, like with dbpool.runQuery, but retry the query in case of a temporary error (like connection lost).
source code
 
registerInDB(self) source code
 
doRegisterInDB(self, txn) source code
 
afterRegisterInDB(self, insert_id) source code
 
reportError(self, err) source code

Inherited from steps.shell.Test: describe, setTestResults

Inherited from steps.shell.WarningCountingShellCommand: addSuppression, createSummary, evaluateCommand, maybeAddWarning, uploadDone, warnExtractFromRegexpGroups, warnExtractWholeLine

Inherited from steps.shell.ShellCommand: buildCommandKwargs, getWorkdir, setBuild, setCommand, setDefaultWorkdir, setStepStatus, setupEnvironment

Inherited from buildstep.LoggingBuildStep: addLogFile, checkDisconnect, commandComplete, getText2, interrupt, maybeGetText2, setStatus, setupLogfiles, startCommand

Inherited from buildstep.BuildStep: __provides__, acquireLocks, addCompleteLog, addFactoryArguments, addHTMLLog, addLog, addLogObserver, addURL, failed, finished, getLog, getSlaveName, getStepFactory, releaseLocks, runCommand, setBuildSlave, setProgress, setupProgress, slaveVersion, slaveVersionIsOlderThan, startStep

Inherited from properties.PropertiesMixin: __providedBy__, getProperties, getProperty, hasProperty, has_key, render, setProperty

Class Variables
  renderables = ['mtr_subdir']

Inherited from steps.shell.Test: command, description, descriptionDone, name, warnOnFailure

Inherited from steps.shell.WarningCountingShellCommand: commentEmptyLineRe, directoryEnterPattern, directoryLeavePattern, suppressionFile, suppressionLineRe, warnCount, warningPattern

Inherited from steps.shell.ShellCommand: flunkOnFailure

Inherited from buildstep.LoggingBuildStep: cmd, parms, progressMetrics

Inherited from buildstep.BuildStep: __implemented__, alwaysRun, build, doStepIf, flunkOnWarnings, haltOnFailure, hideStepIf, locks, progress, set_runtime_properties, step_status, useProgress, warnOnWarnings

Instance Variables

Inherited from steps.shell.ShellCommand: lazylogfiles, logfiles

Method Details

__init__(self, dbpool=None, test_type=None, test_info='', description=None, descriptionDone=None, autoCreateTables=False, textLimit=5, testNameLimit=16, parallel=4, logfiles={}, lazylogfiles=True, warningPattern='MTR\'s internal check of the test case \'.*\' failed', mtr_subdir='mysql-test', **kwargs)
(Constructor)

source code 
Overrides: buildstep.BuildStep.__init__

start(self)

source code 
Overrides: buildstep.BuildStep.start

getText(self, command, results)

source code 
Overrides: buildstep.LoggingBuildStep.getText

runInteractionWithRetry(self, actionFn, *args, **kw)

source code 

Run a database transaction with dbpool.runInteraction, but retry the transaction in case of a temporary error (like connection lost).

This is needed to be robust against things like database connection idle timeouts.

The passed callable that implements the transaction must be retryable, ie. it must not have any destructive side effects in the case where an exception is thrown and/or rollback occurs that would prevent it from functioning correctly when called again.

runQueryWithRetry(self, *args, **kw)

source code 

Run a database query, like with dbpool.runQuery, but retry the query in case of a temporary error (like connection lost).

This is needed to be robust against things like database connection idle timeouts.