New plugin (testbed communication, build/test results display)

30 views
Skip to first unread message

Janez Novak

unread,
Oct 14, 2015, 12:36:44 PM10/14/15
to Jenkins Developers
Hi,

so I'm working on a project that requires me to produce a Jenkins plugin. My part of the project on the whole will look something like this:

1. An Eclipse user (a software engineer) will trigger a Jenkins job through the Eclipse UI on his local machine.
2. With action #1, a script (probably a bash script) will be sent to the triggered job. This script will contain parameters for the job.
3. The job will execute a build. The job will then send the build and the parameters to a third-party tool (a testbed developed by the other guys on the team). This third-party tool will execute tests based on the parameters.
4. The third-party tool will then send the test results back to the Jenkins job. Jenkins will then display the test results in some form (graph, numbers, etc.). The results should represent some sort of history (e.g. successful builds over time, etc.)

So my Jenkins plugin should really do the following things:

1. Receive the job parameters from the Eclipse user (if I understand correctly, this is already supported by Jenkins under the "File parameter" utility).
2. Run the build.
3. Send the build and the parameters to the third-party tool.
4. Receive the test results from the third-party tool and display them for the Jenkins user (the results can be viewed in a web browser through the Jenkins UI), including the results history for this job.

I'm new to Jenkins and plugin development, so I'm not really sure whether some of these functionalities are already implemented in Jenkins by default. I am also not sure which of these functionalities are already provided by existing plugins. I've chosen Java to write the whole thing (not sure if other languages are even an option).

The "results display" functionality is something I've found among existing plugins, particulary in the "Warnings" plugin. Although the "Warnings" plugin does not deal exactly with displaying results, it would at least provide some kind of a blueprint to implement this functionality.

As for the other functionalities, I haven't seen them in any of the existing plugins. I have probably missed something, which is part of the reason for this post.

Could anyone point me towards existing plugins (or the ones in development, code snippets, etc.) that I might've missed? Also, if anyone has any general idea of the best way to go about this, that would be great. Even a general discussion about how this could work would be good.

If I've been unclear about anything, feel free to ask.

Oleg Nenashev

unread,
Oct 17, 2015, 11:43:54 AM10/17/15
to Jenkins Developers
Hi Janez,



1. Receive the job parameters from the Eclipse user (if I understand correctly, this is already supported by Jenkins under the "File parameter" utility).
2. Run the build.
These steps can be done using Jenkins APIs or CLI. No need in the plugin


3. Send the build and the parameters to the third-party tool.
I need more details to provide an exact answer. There are dozens of potentially applicable plugins. E.g. https://wiki.jenkins-ci.org/display/JENKINS/Notification+Plugin


4. Receive the test results from the third-party tool and display them for the Jenkins user (the results can be viewed in a web browser through the Jenkins UI), including the results history for this job.
Does not need a plugin if you want to display it in a separate job. Tests results can be uploaded as File parameters and displayed using xUnit plugin.
 
 
 

среда, 14 октября 2015 г., 19:36:44 UTC+3 пользователь Janez Novak написал:

Janez Novak

unread,
Oct 20, 2015, 11:25:08 AM10/20/15
to Jenkins Developers
1. Receive the job parameters from the Eclipse user (if I understand correctly, this is already supported by Jenkins under the "File parameter" utility).
2. Run the build.
 These steps can be done using Jenkins APIs or CLI. No need in the plugin
 
So if I understood you correctly, sending the job parameters and running the build (as part of a job) from Eclipse can be done either by:

a) Using existing Jenkins APIs. But aren't plugins just Jenkins APIs? Isn't a Jenkins plugin just a piece of code using Jenkins APIs to modify how Jenkins works?

b) Using Jenkins CLI (Command Line Interface). I can see from the Jenkins page on CLI (https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI) that a user can use the Jenkins CLI via a script. Could job parameters be sent to a job on a remote Jenkins server by a script run from inside Eclipse? Could this job then be run from inside Eclipse (possibly by the same script)?


3. Send the build and the parameters to the third-party tool.
 I need more details to provide an exact answer. There are dozens of potentially applicable plugins. E.g. https://wiki.jenkins-ci.org/display/JENKINS/Notification+Plugin

A more detailed description of the process concerning #3: A user first uploads the project and the build/test parameters onto a Jenkins server and runs a job on this project. So far the point of the job is to run a build on the uploaded project. The (hopefully) successful build then needs to somehow become available to the third-party tool, so that the third-party tool can run tests on the build. Since the tests are also dependent on parameters, the file with the parameters needs to become available to the third-party tool as well. So far there is no preferred way as to how the third-party tool should fetch the code and the parameters.

The plugin you suggested only provides a remote host with the notification about a job, while our third-party tool needs to fetch the code itself in order to run tests on it. I hope I've cleared this up.



4. Receive the test results from the third-party tool and display them for the Jenkins user (the results can be viewed in a web browser through the Jenkins UI), including the results history for this job.
 Does not need a plugin if you want to display it in a separate job. Tests results can be uploaded as File parameters and displayed using xUnit plugin.

So if I understand you correctly, the easiest way to implement returning and displaying the results of the third-party tool would be to run a separate job for this?

One of the goals of the project is to ensure that the Eclipse user leaves the Eclipse environment as rarely as possible, in order to shorten the time used for dealing with testing. So unless this separate job (the job that would display results of the third-party tool tests) could also be run from Eclipse by the same user (preferably automatically after the first job - the job to which the code is uploaded and then runs the build - is run), this would be counter-productive. A further goal of the project is to display the test results of the third-party tool in Eclipse, so I have to keep that in mind as well.

I hope I've cleared everything up. Feel free to ask more questions.
 

Dne sobota, 17. oktober 2015 17.43.54 UTC+2 je oseba Oleg Nenashev napisala:
Reply all
Reply to author
Forward
0 new messages