Contibuting to JUnit Plugin

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Contibuting to JUnit Plugin

Sanjeet Malhotra
Hi all,
I am beginning to contribute on JUnit plugin by making more useful test result trends for analyzing testcases. I was looking into the code for making test result trends in JUnit plugin and I got stuck at how to use JFreeChart for making bar charts, stacked bar charts, gantt chart and line chart. Basically, I am stuck at how set the plot area properties and how to use DateAxis objects. An example of usage will be highly helpful.

Thanks,

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/b9541016-32a4-422f-b2a1-cae5a863940do%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Contibuting to JUnit Plugin

Ulli Hafner
I rather would recommend to replace those charts with some modern ones, see https://github.com/jenkinsci/echarts-api-plugin


Am 17.06.2020 um 21:23 schrieb Sanjeet Malhotra <[hidden email]>:

Hi all,
I am beginning to contribute on JUnit plugin by making more useful test result trends for analyzing testcases. I was looking into the code for making test result trends in JUnit plugin and I got stuck at how to use JFreeChart for making bar charts, stacked bar charts, gantt chart and line chart. Basically, I am stuck at how set the plot area properties and how to use DateAxis objects. An example of usage will be highly helpful.

Thanks,


--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/b9541016-32a4-422f-b2a1-cae5a863940do%40googlegroups.com.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/1FB6B406-0FDC-42B3-8A0C-6BB51B36278C%40gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Contibuting to JUnit Plugin

Sanjeet Malhotra
In reply to this post by Sanjeet Malhotra
Hi all,
I was try to do analysis of testcases which failed most on till the current and build but for that I have to reload the previous builds from xml file if the object got GC'ed as it has only weak references referring it. But reloading of previous builds is quite expensive. I was testing it for 7k testcases and 30 builds and it took 14.8 sec to load xml files for 30 builds. Can some please suggest a work around for this. I was planning to raise a PR after this performance test but now I am stuck. TIA.

On Thursday, June 18, 2020 at 12:53:27 AM UTC+5:30, Sanjeet Malhotra wrote:
Hi all,
I am beginning to contribute on JUnit plugin by making more useful test result trends for analyzing testcases. I was looking into the code for making test result trends in JUnit plugin and I got stuck at how to use JFreeChart for making bar charts, stacked bar charts, gantt chart and line chart. Basically, I am stuck at how set the plot area properties and how to use DateAxis objects. An example of usage will be highly helpful.

Thanks,

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/79b99738-76f3-48b4-86e6-3484ceecb1f9o%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Contibuting to JUnit Plugin

Jesse Glick-4
On Tue, Jun 23, 2020 at 6:20 PM Sanjeet Malhotra
<[hidden email]> wrote:
> reloading of previous builds is quite expensive […] Can some please suggest a work around for this.

There is not really a workaround:

https://www.jenkins.io/sigs/cloud-native/pluggable-storage/#test-results

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr3CLsnc6viRUJqB9rYu59JFP8xxs1aCbPn3QW7ZKq6nUw%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Contibuting to JUnit Plugin

Tim Jacomb
There’s a draft PR for converting the charts to ECharts: 

On Wed, 24 Jun 2020 at 00:18, Jesse Glick <[hidden email]> wrote:
On Tue, Jun 23, 2020 at 6:20 PM Sanjeet Malhotra
<[hidden email]> wrote:
> reloading of previous builds is quite expensive […] Can some please suggest a work around for this.

There is not really a workaround:

https://www.jenkins.io/sigs/cloud-native/pluggable-storage/#test-results

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr3CLsnc6viRUJqB9rYu59JFP8xxs1aCbPn3QW7ZKq6nUw%40mail.gmail.com.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAH-3Bifw%3Dh_yR%3DrBHF0EMa1SrojVpmWDZ13LUmOamevfWdh-Mw%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Contibuting to JUnit Plugin

Jesse Glick-4
In reply to this post by Jesse Glick-4
On Tue, Jun 23, 2020 at 7:18 PM Jesse Glick <[hidden email]> wrote:
>> reloading of previous builds is quite expensive
>
> There is not really a workaround

I should clarify that you _can_ load historical results without
triggering disk I/O, if they happened to be in memory anyway, which
the test trend graph does:

https://github.com/jenkinsci/junit-plugin/blob/bab34bcc96154a494f8c371953efe06d45813f67/src/main/java/hudson/tasks/test/AbstractTestResultAction.java#L341-L346
https://github.com/jenkinsci/junit-plugin/blob/bab34bcc96154a494f8c371953efe06d45813f67/src/main/java/hudson/tasks/test/AbstractTestResultAction.java#L218-L225

The issue is that you cannot efficiently query historical builds
without forcing them to be loaded—there is no equivalent of a SQL
statement you could run to get some aggregate statistic over thousands
of builds that would perform tolerably. So if the last five builds are
in memory (a typical situation forced by the weather list view
column), you can cheaply inspect those five, but inspecting the one
before them will be expensive.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr1qhbaPH1LRZbdiP8AB26qTD06QxWf%2BsQmK96mMNm_pww%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Contibuting to JUnit Plugin

Sanjeet Malhotra
Thanks actually I need to have build info for all the builds which needs to be displayed on the graph. So, I think anyhow the loading of xml file will get triggered because I will be trying for last 30-50 builds. Apart from this, I was trying to write a unit test using power mockito and I encountered an an error while building the plugin. I have attached the terminal output for the same and it does not seem to be due the testcases that I wrote but due to some version conflict.

On Wednesday, June 24, 2020 at 5:43:02 PM UTC+5:30, Jesse Glick wrote:
On Tue, Jun 23, 2020 at 7:18 PM Jesse Glick <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="fQZ34QLvBAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jgl...@...> wrote:
>> reloading of previous builds is quite expensive
>
> There is not really a workaround

I should clarify that you _can_ load historical results without
triggering disk I/O, if they happened to be in memory anyway, which
the test trend graph does:

<a href="https://github.com/jenkinsci/junit-plugin/blob/bab34bcc96154a494f8c371953efe06d45813f67/src/main/java/hudson/tasks/test/AbstractTestResultAction.java#L341-L346" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fjunit-plugin%2Fblob%2Fbab34bcc96154a494f8c371953efe06d45813f67%2Fsrc%2Fmain%2Fjava%2Fhudson%2Ftasks%2Ftest%2FAbstractTestResultAction.java%23L341-L346\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHcHuEy3tKVz3sabVS1ZrO_b7OEyg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fjunit-plugin%2Fblob%2Fbab34bcc96154a494f8c371953efe06d45813f67%2Fsrc%2Fmain%2Fjava%2Fhudson%2Ftasks%2Ftest%2FAbstractTestResultAction.java%23L341-L346\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHcHuEy3tKVz3sabVS1ZrO_b7OEyg&#39;;return true;">https://github.com/jenkinsci/junit-plugin/blob/bab34bcc96154a494f8c371953efe06d45813f67/src/main/java/hudson/tasks/test/AbstractTestResultAction.java#L341-L346
<a href="https://github.com/jenkinsci/junit-plugin/blob/bab34bcc96154a494f8c371953efe06d45813f67/src/main/java/hudson/tasks/test/AbstractTestResultAction.java#L218-L225" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fjunit-plugin%2Fblob%2Fbab34bcc96154a494f8c371953efe06d45813f67%2Fsrc%2Fmain%2Fjava%2Fhudson%2Ftasks%2Ftest%2FAbstractTestResultAction.java%23L218-L225\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG96K_UwELVRwGTmjJ9j02yAibL5w&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fjunit-plugin%2Fblob%2Fbab34bcc96154a494f8c371953efe06d45813f67%2Fsrc%2Fmain%2Fjava%2Fhudson%2Ftasks%2Ftest%2FAbstractTestResultAction.java%23L218-L225\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG96K_UwELVRwGTmjJ9j02yAibL5w&#39;;return true;">https://github.com/jenkinsci/junit-plugin/blob/bab34bcc96154a494f8c371953efe06d45813f67/src/main/java/hudson/tasks/test/AbstractTestResultAction.java#L218-L225

The issue is that you cannot efficiently query historical builds
without forcing them to be loaded—there is no equivalent of a SQL
statement you could run to get some aggregate statistic over thousands
of builds that would perform tolerably. So if the last five builds are
in memory (a typical situation forced by the weather list view
column), you can cheaply inspect those five, but inspecting the one
before them will be expensive.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/12410601-8a06-4b91-b391-37892f666f4ao%40googlegroups.com.

Screenshot 2020-06-26 at 6.41.26 AM.png (155K) Download Attachment
Screenshot 2020-06-26 at 6.42.12 AM.png (108K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Contibuting to JUnit Plugin

Ulli Hafner
Am 26.06.2020 um 03:32 schrieb Sanjeet Malhotra <[hidden email]>:

Thanks actually I need to have build info for all the builds which needs to be displayed on the graph. So, I think anyhow the loading of xml file will get triggered because I will be trying for last 30-50 builds.

What information are you reading? The data from the build xml or the data from the test results xml?

Apart from this, I was trying to write a unit test using power mockito and I encountered an an error while building the plugin. I have attached the terminal output for the same and it does not seem to be due the testcases that I wrote but due to some version conflict.


See https://www.jenkins.io/doc/developer/plugin-development/updating-parent/

On Wednesday, June 24, 2020 at 5:43:02 PM UTC+5:30, Jesse Glick wrote:
On Tue, Jun 23, 2020 at 7:18 PM Jesse Glick <[hidden email]> wrote:
>> reloading of previous builds is quite expensive
>
> There is not really a workaround

I should clarify that you _can_ load historical results without
triggering disk I/O, if they happened to be in memory anyway, which
the test trend graph does:

https://github.com/jenkinsci/junit-plugin/blob/bab34bcc96154a494f8c371953efe06d45813f67/src/main/java/hudson/tasks/test/AbstractTestResultAction.java#L341-L346
https://github.com/jenkinsci/junit-plugin/blob/bab34bcc96154a494f8c371953efe06d45813f67/src/main/java/hudson/tasks/test/AbstractTestResultAction.java#L218-L225

The issue is that you cannot efficiently query historical builds
without forcing them to be loaded—there is no equivalent of a SQL
statement you could run to get some aggregate statistic over thousands
of builds that would perform tolerably. So if the last five builds are
in memory (a typical situation forced by the weather list view
column), you can cheaply inspect those five, but inspecting the one
before them will be expensive.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/12410601-8a06-4b91-b391-37892f666f4ao%40googlegroups.com.
<Screenshot 2020-06-26 at 6.41.26 AM.png><Screenshot 2020-06-26 at 6.42.12 AM.png>

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/B704033D-A204-4D26-BE1D-FF2670FA5C6C%40gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Contibuting to JUnit Plugin

Jesse Glick-4
In reply to this post by Sanjeet Malhotra
On Thu, Jun 25, 2020 at 9:32 PM Sanjeet Malhotra
<[hidden email]> wrote:
> Thanks actually I need to have build info for all the builds which needs to be displayed on the graph. So, I think anyhow the loading of xml file will get triggered because I will be trying for last 30-50 builds.

Do not do this unless there is some explicit user gesture to view
historical test results, or you will cause terrible performance from
casual browsing.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr2jPS_7EUDGQ_i-qSARGb7NiaC6VEhL%3DkVXf5T%3DWiJ8gQ%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Contibuting to JUnit Plugin

Sanjeet Malhotra
Thanks, made it such that my code will only get triggered when user demands for it.

On Friday, June 26, 2020 at 5:58:15 PM UTC+5:30 Jesse Glick wrote:
On Thu, Jun 25, 2020 at 9:32 PM Sanjeet Malhotra
<[hidden email]> wrote:
> Thanks actually I need to have build info for all the builds which needs to be displayed on the graph. So, I think anyhow the loading of xml file will get triggered because I will be trying for last 30-50 builds.

Do not do this unless there is some explicit user gesture to view
historical test results, or you will cause terrible performance from
casual browsing.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/7f4b6f02-d81f-483b-8e6c-6c633645bab1n%40googlegroups.com.