[Question]: Where can I find guidelines for contributing on JUnit Plugin?

38 views
Skip to first unread message

Sanjeet Malhotra

unread,
Jun 1, 2020, 3:06:54 PM6/1/20
to Jenkins Developers
Hi,
I wanted to contribute to JUnit Plugin by making more trends in addition to one being currently displayed right now. I was planning to make trends like one for test flappers, number of tests taking longer time based on various metrics, etc. I just wanted to know where I can find guidelines for contributing to JUnit Plugin and any advice is most welcomed. TIA.

Mark Waite

unread,
Jun 1, 2020, 4:19:04 PM6/1/20
to Jenkins Developers
Great to have you interested in helping!

https://plugins.jenkins.io/junit/ shows that the plugin is at https://github.com/jenkinsci/junit-plugin .

I didn't see any specific contributing guidelines in the plugin.  I assume it is similar to most plugins.  Discuss your idea here, refine it, provide an implementation as a pull request, discuss the implementation in the pull request.

Javadoc for the plugin is located at https://javadoc.jenkins-ci.org/plugin/junit/ .  You may want to consider creating the added functionality as a separate plugin so that users can choose to install the new capabilities with an independent plugin, rather than upgrading the junit plugin.

Mark Waite

Sanjeet Malhotra

unread,
Jun 1, 2020, 4:27:00 PM6/1/20
to Jenkins Developers
Thanks a lot for guiding. I will surely discuss my ideas after looking at the resources you mentioned.

Sanjeet Malhotra

unread,
Jun 2, 2020, 8:30:47 AM6/2/20
to Jenkins Developers
Is there any particular scheme being followed for caching or is there any technique being used for better memory management. Like I was going through the code and saw the usage of weak references. As far as I know, they are used for better memory management by allowing garbage collector to collect the object but if not collected then reusing the object. It seems to me that for making various trends I will need to used HashMap or TreeMap for better time complexity but I was thinking whether this will create an issue with memory complexity. TIA.

Jesse Glick

unread,
Jun 2, 2020, 8:48:24 AM6/2/20
to Jenkins Dev
The more important consideration by far is to avoid triggering loading
of build records. Since Jenkins does not use a database, test results
for a given build can only be obtained when the whole build (`Run`) is
in memory. This is a large object, and to load it requires reading and
parsing a `build.xml` file, which is relatively expensive. By default
a `SoftReference` is used to hold a (completed) build record, so that
when heap is running short some will be evicted. Thus any
frequently-accessed GUI page which attempts to reference historical
builds, if not written carefully, could wind up repeatedly forcing
build reloading on a loaded server.

Sanjeet Malhotra

unread,
Jun 2, 2020, 8:52:18 AM6/2/20
to Jenkins Developers
Thanks a lot. Will keep that in mind and will avoid reloading of build records.


On Tuesday, June 2, 2020 at 12:36:54 AM UTC+5:30, Sanjeet Malhotra wrote:

Sanjeet Malhotra

unread,
Jun 2, 2020, 11:22:06 AM6/2/20
to Jenkins Developers
I am bit stuck at understanding jelly files. Is there any official documentation for it? I looked at Apache jelly website but there also, majority of tags were not explained as how to use them. I new to jelly scripts and so having difficulty understanding them. TIA for any advice.


On Tuesday, June 2, 2020 at 12:36:54 AM UTC+5:30, Sanjeet Malhotra wrote:

Jesse Glick

unread,
Jun 2, 2020, 12:16:28 PM6/2/20
to Jenkins Dev
On Tue, Jun 2, 2020 at 11:22 AM Sanjeet Malhotra
<thesanjee...@gmail.com> wrote:
> I am bit stuck at understanding jelly files. Is there any official documentation for it?

https://www.jenkins.io/doc/developer

generally. The site seems to be down at the moment (!), but I can find

https://github.com/jenkins-infra/jenkins.io/blob/master/content/doc/developer/architecture/web.adoc#views

linking to

https://github.com/jenkins-infra/jenkins.io/tree/master/content/doc/developer/handling-requests

which is not too helpful.

https://github.com/jenkins-infra/jenkins.io/blob/master/content/doc/developer/forms/jelly-form-controls.adoc

is specific to configuration forms, not applicable in this context.
The most relevant content is from the old wiki and would need to be
cleaned up, vetted, and moved to the official site:

https://wiki.jenkins.io/display/JENKINS/Basic+guide+to+Jelly+usage+in+Jenkins

Sanjeet Malhotra

unread,
Jun 2, 2020, 1:08:07 PM6/2/20
to Jenkins Developers
Thanks a lot.

Ullrich Hafner

unread,
Jun 2, 2020, 2:26:56 PM6/2/20
to Jenkins Developers
And before writing a lot of new trends using the old PNG server side rendering you should think about using the new approach using ECharts. 


--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/f2ab07e8-8061-4af2-9304-a3916f3573ec%40googlegroups.com.

Sanjeet Malhotra

unread,
Jun 2, 2020, 2:33:57 PM6/2/20
to Jenkins Developers
Thanks I will look into and I was thinking of a way to have more customizable charts. Thanks for suggesting this.


On Tuesday, June 2, 2020 at 11:56:56 PM UTC+5:30, Ullrich Hafner wrote:
And before writing a lot of new trends using the old PNG server side rendering you should think about using the new approach using ECharts. 
Am 02.06.2020 um 19:08 schrieb Sanjeet Malhotra <thesanjee...@gmail.com>:

Thanks a lot.

On Tuesday, June 2, 2020 at 9:46:28 PM UTC+5:30, Jesse Glick wrote:
On Tue, Jun 2, 2020 at 11:22 AM Sanjeet Malhotra
<thesanjee...@gmail.com> wrote:
> I am bit stuck at understanding jelly files. Is there any official documentation for it?

https://www.jenkins.io/doc/developer

generally. The site seems to be down at the moment (!), but I can find

https://github.com/jenkins-infra/jenkins.io/blob/master/content/doc/developer/architecture/web.adoc#views

linking to

https://github.com/jenkins-infra/jenkins.io/tree/master/content/doc/developer/handling-requests

which is not too helpful.

https://github.com/jenkins-infra/jenkins.io/blob/master/content/doc/developer/forms/jelly-form-controls.adoc

is specific to configuration forms, not applicable in this context.
The most relevant content is from the old wiki and would need to be
cleaned up, vetted, and moved to the official site:

https://wiki.jenkins.io/display/JENKINS/Basic+guide+to+Jelly+usage+in+Jenkins

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkin...@googlegroups.com.

Sanjeet Malhotra

unread,
Jun 6, 2020, 12:25:38 PM6/6/20
to Jenkins Developers
I have started working upon JUnit plugin and planning on adding new functionalities listed below. Please suggest some advice if any correction is needed or changes are needed.
FYI: I am only using the information provided in junitResult.xml and is not making any xml file of my own having more information.
  • For all the functionalities I have implemented drop down menus along with a submit button on jenkins UI just below the trends.
  • A trend for depicting number testcases which took longer to run based upon exponential weighted average of their duration for previous builds. In fact I have implemented 3 more metrics also for the same purpose namely- max(if a testcase took maximum time to run in this build), prev(if a testcase took more time to run in this build than previous build) and threshold(if a testcase took more time to run than the specified threshold).
  • A trend for depicting number of test flappers(flaky tests) in a particular build based upon the idea that if a test passed in the given build and failed in one of the last 10 builds then it will be marked as "flake".
  • Also, upon hovering over the chart as a tooltip I am working upon displaying some testcase names rather than just count as it can also be visualized from chart itself using range axis/y-axis.
  • I am also working upon displaying trends for each project by selecting the outermost package name in which whole of the project lies, as project name may not be necessarily a substring of package name so this functionality can't directly use project name but project name can derived approximately from package name for that project(if packages are named appropriately).
  • On clicking the submit button on UI we will get the desired trend displayed at the original location where the trend is being displayed as of now.
I had a doubt that the getFailCount(), getPassedCount() which are being called from buildDataset() are synchronized methods, so what all threads will be accessing these methods simultaneously. I was not able to determine this. And if we just synchronize buildDataset method(though it won't be directly accessed by object being private method) will the purpose be not fulfilled? TIA

On Tuesday, June 2, 2020 at 12:36:54 AM UTC+5:30, Sanjeet Malhotra wrote:
Reply all
Reply to author
Forward
0 new messages