Skip to content

MariaDB/mtr-junit-collector

Repository files navigation

mtr-junit-collector

mtr-junit-collector is a standalone service designed to replace MTRLogObserver from Buildbot, which has been deprecated in recent Buildbot versions.

Purpose

This service replicates the same database table models previously used by MTRLogObserver. The key design decision behind this project is based on the observation that mariadb-test can output test results in JUnit XML format.

How it works

The service exposes a single data processing endpoint: /upload-test-results

This endpoint allows uploading a JUnit-style XML file along with additional metadata — usually available as build-level properties. The service parses the XML and inserts the data into the same tables that MTRLogObserver used, ensuring compatibility.

Deployment & Communication Model

The service is designed to run on the Buildbot master host, with communication from Buildbot worker hosts handled via WireGuard tunnels. Due to this setup, no authentication module is currently implemented in this version, as the secure communication is handled at the network level.

A typical client implementation is as simple as executing a curl command from a Buildbot build step, where the XML file is generated by a previous step running the MTR tests.

Example usage in a build step:

curl -f -X POST http://#BB_MASTER_WG_IP#:#SERVICE_PORT#/upload-test-results/ \
  -F branch=main \
  -F revision=#commit_sha# \
  -F platform=#builder_name# \
  -F bbnum=#build_number# \
  -F typ=#mtr_test_type# \
  -F file=@generated_by_mtr.xml;type=application/xml

Compatibility

Because the database schema remains unchanged, tools like Cross Reference — used for reporting failed tests — can operate without any modifications. From its perspective, the data continues to come from the same source, even though it may now be populated by both Buildbot and mtr-junit-collector.

Health Check & Metrics

The application exposes endpoints for health monitoring and metrics collection:

  • The /health endpoint can be used to verify the health status of the application. Will return 200 if the application is up and the database is reachable.

  • The /metrics endpoint exposes application metrics in a format compatible with Prometheus. These metrics can be scraped by Prometheus for monitoring and alerting purposes.

Summary

  • Drop-in replacement for the deprecated MTRLogObserver.
  • Stores mariadb-test runner JUnit XML test results.

Feel free to open issues or pull requests if you encounter problems or have suggestions for improvements.

About

Drop-in replacement service for the deprecated Buildbot MTRLogObserver

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages