Implements the pluggable storage API for the JUnit plugin.
In common CI/CD use-cases a lot of the space is consumed by test reports. This data is stored within JENKINS_HOME, and the current storage format requires huge overheads when retrieving statistics and, especially trends. In order to display trends, each report has to be loaded and then processed in-memory.
The main purpose of externalising Test Results is to optimize Jenkins performance by querying the desired data from external storage.
This plugin adds a SQL extension, we currently support PostgreSQL and MySQL, others can be added, create an issue or send a pull request.
Tables will be automatically created.
Install your database vendor specific plugin, you can use the Jenkins plugin site to search for it:
https://plugins.jenkins.io/ui/search/?labels=database
e.g. you could install the PostgreSQL Database plugin.
Manage Jenkins → Configure System → Junit
In the dropdown select 'SQL Database'
Manage Jenkins → Configure System → Global Database
Select the database implementation you want to use and click 'Test Connection' to verify Jenkins can connect
Click 'Save'
unclassified:
globalDatabaseConfiguration:
database:
postgreSQL:
database: "jenkins"
hostname: "${DB_HOST_NAME}"
password: "${DB_PASSWORD}"
username: "${DB_USERNAME}"
validationQuery: "SELECT 1"
junitTestResultStorage:
storage: "database"
Refer to our contribution guidelines
Licensed under MIT, see LICENSE