Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-60687

Extend the InfluxDB plugin to send metrics from Serenity reports to InfluxDB

    • Icon: New Feature New Feature
    • Resolution: Done
    • Icon: Minor Minor
    • influxdb-plugin
    • None
    • 2.1

      Please extend the InfluxDB plugin to send metrics from Serenity reports to InfluxDB. 

      Example metrics:

      • Counts of passing/pending/ignored/skipped/failed/broken/compromised tests
      • Execution time / clock time / fastest test / slowest test / average execution time

      If there is an existing way to send metrics from Serenity reports then please let me know!

          [JENKINS-60687] Extend the InfluxDB plugin to send metrics from Serenity reports to InfluxDB

          Aleksi Simell added a comment -

          You mean from https://plugins.jenkins.io/serenity?

          Currently, you could write custom data to InfluxDB, but then you would need to do the data parsing yourself in your job. However, that might be a bit too troublesome to do in a pipeline, and most probably something the pipeline isn't intended to do anyway.

          Aleksi Simell added a comment - You mean from https://plugins.jenkins.io/serenity? Currently, you could write custom data to InfluxDB, but then you would need to do the data parsing yourself in your job. However, that might be a bit too troublesome to do in a pipeline, and most probably something the pipeline isn't intended to do anyway.

          Paul Ireland added a comment -

          Thanks aleksisimell - yes, I use https://plugins.jenkins.io/serenity

          Would it be possible to add a Serenity generator to https://github.com/jenkinsci/influxdb-plugin/tree/development/src/main/java/jenkinsci/plugins/influxdb/generators?  I'm happy to do the dev work if I can be given some guidance.

           

          Paul Ireland added a comment - Thanks aleksisimell - yes, I use  https://plugins.jenkins.io/serenity Would it be possible to add a Serenity generator to  https://github.com/jenkinsci/influxdb-plugin/tree/development/src/main/java/jenkinsci/plugins/influxdb/generators ?  I'm happy to do the dev work if I can be given some guidance.  

          Aleksi Simell added a comment -

          Make a fork from the plugin repository and create a new file for the generator. Pretty good guidelines can be found from other generators. You will most probably need the `buildAction` from the plugin and then it's just looking at the Serenity plugin code to get the correct data.

          Finally, you will need to call the generator inside `InfluxDbPublicationService.java` to actually use the generator.

          Additionally, unit tests for the generator would be nice I know the plugin lacks sufficient unit tests, but there should be some tests for other generators you can use as a base.

          Aleksi Simell added a comment - Make a fork from the plugin repository and create a new file for the generator. Pretty good guidelines can be found from other generators. You will most probably need the `buildAction` from the plugin and then it's just looking at the Serenity plugin code to get the correct data. Finally, you will need to call the generator inside `InfluxDbPublicationService.java` to actually use the generator. Additionally, unit tests for the generator would be nice I know the plugin lacks sufficient unit tests, but there should be some tests for other generators you can use as a base.

          Paul Ireland added a comment - - edited

          Thanks aleksisimell, your advice was very useful - I'm working on a Serenity generator now. 

          Paul Ireland added a comment - - edited Thanks aleksisimell , your advice was very useful - I'm working on a Serenity generator now. 

          Paul Ireland added a comment -

          Paul Ireland added a comment - aleksisimell - please see PR https://github.com/jenkinsci/influxdb-plugin/pull/91

            aleksisimell Aleksi Simell
            paul_ireland Paul Ireland
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: