{"id":27594399,"url":"https://github.com/jenkinsci/junit-sql-storage-plugin","last_synced_at":"2025-04-22T10:34:05.649Z","repository":{"id":37872504,"uuid":"296715498","full_name":"jenkinsci/junit-sql-storage-plugin","owner":"jenkinsci","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-21T02:42:47.000Z","size":362,"stargazers_count":7,"open_issues_count":4,"forks_count":15,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-22T10:31:46.539Z","etag":null,"topics":["hacktoberfest","jenkins-plugin","junit-plugin"],"latest_commit_sha":null,"homepage":"https://plugins.jenkins.io/junit-sql-storage/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jenkinsci.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-09-18T19:46:05.000Z","updated_at":"2025-04-21T02:42:51.000Z","dependencies_parsed_at":"2023-11-06T02:36:44.822Z","dependency_job_id":"823a9444-e01b-4e72-a060-35f472ab9442","html_url":"https://github.com/jenkinsci/junit-sql-storage-plugin","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fjunit-sql-storage-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fjunit-sql-storage-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fjunit-sql-storage-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fjunit-sql-storage-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jenkinsci","download_url":"https://codeload.github.com/jenkinsci/junit-sql-storage-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250221423,"owners_count":21394701,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","jenkins-plugin","junit-plugin"],"created_at":"2025-04-22T10:31:26.808Z","updated_at":"2025-04-22T10:34:05.580Z","avatar_url":"https://github.com/jenkinsci.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JUnit SQL Storage Plugin\n\n[![Build Status](https://ci.jenkins.io/job/Plugins/job/junit-sql-storage-plugin/job/master/badge/icon)](https://ci.jenkins.io/job/Plugins/job/junit-sql-storage-plugin/job/master/)\n[![Contributors](https://img.shields.io/github/contributors/jenkinsci/junit-sql-storage-plugin.svg)](https://github.com/jenkinsci/junit-sql-storage-plugin/graphs/contributors)\n[![Jenkins Plugin](https://img.shields.io/jenkins/plugin/v/junit-sql-storage.svg)](https://plugins.jenkins.io/junit-sql-storage)\n[![GitHub release](https://img.shields.io/github/release/jenkinsci/junit-sql-storage-plugin.svg?label=changelog)](https://github.com/jenkinsci/junit-sql-storage-plugin/releases/latest)\n[![Jenkins Plugin Installs](https://img.shields.io/jenkins/plugin/i/junit-sql-storage.svg?color=blue)](https://plugins.jenkins.io/junit-sql-storage)\n\n## Introduction\n\nImplements the pluggable storage API for the [JUnit plugin](https://plugins.jenkins.io/junit/).\n\nIn common CI/CD use-cases a lot of the space is consumed by test reports. \nThis data is stored within JENKINS_HOME, and the current storage format requires huge overheads when retrieving statistics and, especially trends. \nIn order to display trends, each report has to be loaded and then processed in-memory.\n\nThe main purpose of externalising Test Results is to optimize Jenkins performance by querying the desired data from external storage.\n\nThis plugin adds a SQL extension, we currently support PostgreSQL and MySQL, others can be added, create an issue or send a pull request.\n\nTables will be automatically created.\n\n## Getting started\n\nTo install the plugin login to Jenkins → Manage Jenkins → Manage Plugins → Available → Search for 'JUnit SQL Storage' → Install.\n\nUse the following steps if you want to build and install the plugin from source.\n\n### Building\n\nTo build the plugin use the `package` goal\n```\n$ mvn clean package -P quick-build\n```\nto run the tests use the `test` goal\n```\n$ mvn clean test\n```\n\n### Deploying Jenkins and the plugin\n\nTo try out your changes you can deploy Jenkins using the `deploy.sh` file provided in the repository.\n```\n$ ./deploy.sh\n```\nThis will compile the junit-sql-storage plugin (.hpi file), build a docker image of Jenkins with the compiled \njunit-sql-storage plugin installed, then deploy the docker swarm of jaeger, postgresql, and Jenkins. \n\n### UI\n\nYou can also use the Jenkins UI to install the plugin and configure it.\n\n### Installing Compiled Plugin\n\nOnce you've compiled the plugin (see above) you can install it from the Jenkins UI. Go to 'Manage Jenkins' → 'Plugins' \n→ 'Advanced' → 'Deploy' → 'Choose File' → 'Deploy'\n\n\u003cimg alt=\"Install hpi plugin file\" src=\"images/install-junit-sql-storage-plugin.png\" width=\"800\"\u003e\n\nNext, install your database vendor specific plugin, you can use the Jenkins plugin site to search for it:\n\nhttps://plugins.jenkins.io/ui/search/?labels=database\n\ne.g. you could install the [PostgreSQL Database](https://plugins.jenkins.io/database-postgresql/) plugin or the \n[MySQL Database](https://plugins.jenkins.io/database-mysql/) plugin.\n\nManage Jenkins → Configure System → Junit\n\nIn the dropdown select 'SQL Database'\n\n![JUnit SQL plugin configuration](images/junit-sql-config-screen.png)\n\nManage Jenkins → Configure System → Global Database\n\nSelect the database implementation you want to use and click 'Test Connection' to verify Jenkins can connect\n\n![JUnit SQL plugin database configuration](images/junit-sql-database-config.png)\n\n\u003e **Note:** use `db` as the 'Host Name' if running Jenkins from inside a docker container as part of the \n\u003e docker-compose.yaml deployment\n\nClick 'Save'\n\n### Configuration as code\n\nYou can also configure the plugin using the [Configuration as Code](https://plugins.jenkins.io/configuration-as-code/) plugin.\n\n```yaml\nunclassified:\n  globalDatabaseConfiguration:\n    database:\n      postgreSQL:\n        database: \"jenkins\"\n        hostname: \"${DB_HOST_NAME}\"\n        password: \"${DB_PASSWORD}\"\n        username: \"${DB_USERNAME}\"\n        validationQuery: \"SELECT 1\"\n  junitTestResultStorage:\n    storage: \"database\"\n```\n\nHere's an example of how to use it\n\n```\njava -jar java-cli.jar -s http://\u003chost.domain.name\u003e:8080 -auth admin:\u003capi_token\u003e apply-configuration \u003c junit-sql-storage-plugin-config.yml\n```\n\n### Accessing Jaeger\n\nYou can access the Jaeger UI by going to `http://localhost:16686`, here you can view the performance of the Jenkins \nserver and your plugin changes.\n\n### Accessing the database\n\nYou can also query the postgres database by connecting to the `db` container.\n\n```\n$ docker compose exec db psql -U postgres\npsql (16.3 (Debian 16.3-1.pgdg120+1))\nType \"help\" for help.\n\npostgres=# SELECT * FROM caseResults LIMIT 2;\n    job     | build |                           suite                            |                  package                  |                         classname                          |         testname         | errordetails | skipped | duration | stdout | stderr | st\nacktrace |         timestamp\n------------+-------+------------------------------------------------------------+-------------------------------------------+------------------------------------------------------------+--------------------------+--------------+---------+----------+--------+--------+---\n---------+----------------------------\n xxxx-xxxxx |     1 | xxx.xxxx.xxx.xxxx.xxxxxx.xxxxxxxxxxxxxxxxxxxxxxxx          | xxx.xxxx.xxx.xxxx.xxxxxx                  | xxx.xxxx.xxx.xxxx.xxxxxx.xxxxxxxxxxxxxxxxxxxxxxxx          | xxxxxxxxxxxxxxxxxxxxxxxx |              |         |    0.331 |        |        |\n         | 2024-06-13 18:18:26.897532\n xxxx-xxxxx |     1 | xxx.xxxx.xxx.xxxxxxxxx.xxxxxxx.xxxxxxxxxx.xxxxxxxxxxxxxxxx | xxx.xxxx.xxx.xxxxxxxxx.xxxxxxx.xxxxxxxxxx | xxx.xxxx.xxx.xxxxxxxxx.xxxxxxx.xxxxxxxxxx.xxxxxxxxxxxxxxxx | xxxxxxxxxxxxxxxxxx       |              |         |    0.292 |        |        |\n         | 2024-06-13 18:18:26.897532\n(2 rows)\n```\n\n## Contributing\n\nRefer to our [contribution guidelines](https://github.com/jenkinsci/.github/blob/master/CONTRIBUTING.md)\n\n## LICENSE\n\nLicensed under MIT, see [LICENSE](LICENSE.md)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenkinsci%2Fjunit-sql-storage-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjenkinsci%2Fjunit-sql-storage-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenkinsci%2Fjunit-sql-storage-plugin/lists"}