MySQL exporter

The MySQL exporter writes test case results into a MySQL database table instead of a file. It reuses the MySQL connector to connect and run the queries.

The exporter automatically creates the destination table if it does not exist, then inserts one row per test case.

Connection configuration

The exporter connects through a dedicated export connection declared in the connections file. The type of this connection must match the exporter name (mysql).

The connection accepts the same parameters as the MySQL connector.

connections:
  export:
    type: mysql
    hostname: my-server.database.windows.net
    database: my_database
    username: my_user
    password: $var.mysql_password
    port: 3306

Destination table

The exporter writes results to a table named ploosh_results by default. You can change this name by setting the table parameter in the connection configuration.

ColumnDescription
executionidUnique identifier for the test run
nameTest case name
stateResult: passed, failed, error, notExecuted
sourcestartSource data loading start time
sourceendSource data loading end time
sourcedurationSource loading duration in seconds
sourcecountNumber of rows in source dataset
sourceexecutedactionQuery or path executed for source
expectedstartExpected data loading start time
expectedendExpected data loading end time
expecteddurationExpected loading duration in seconds
expectedcountNumber of rows in expected dataset
expectedexecutedactionQuery or path executed for expected
comparestartComparison start time
compareendComparison end time
comparedurationComparison duration in seconds
success_ratePercentage of matching rows (0.0 to 1.0)

Usage

Command line

ploosh --connections connections.yml --cases test_cases --export MYSQL

Requirements

  • MySQL optional dependency installed (pip install ploosh[mysql])
  • A export connection of type mysql declared in the connections file