Contibuting to JUnit Plugin

28 views
Skip to first unread message

Sanjeet Malhotra

unread,
Jun 17, 2020, 3:23:27 PM6/17/20
to Jenkins Developers
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,

Ullrich Hafner

unread,
Jun 17, 2020, 6:19:54 PM6/17/20
to Jenkins Developers
I rather would recommend to replace those charts with some modern ones, see https://github.com/jenkinsci/echarts-api-plugin


--
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/b9541016-32a4-422f-b2a1-cae5a863940do%40googlegroups.com.

Sanjeet Malhotra

unread,
Jun 23, 2020, 6:19:57 PM6/23/20
to Jenkins Developers
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.

Jesse Glick

unread,
Jun 23, 2020, 7:18:31 PM6/23/20
to Jenkins Dev
On Tue, Jun 23, 2020 at 6:20 PM Sanjeet Malhotra
<thesanjee...@gmail.com> 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

Tim Jacomb

unread,
Jun 24, 2020, 3:53:47 AM6/24/20
to jenkin...@googlegroups.com
There’s a draft PR for converting the charts to 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.

Jesse Glick

unread,
Jun 24, 2020, 8:13:02 AM6/24/20
to Jenkins Dev
On Tue, Jun 23, 2020 at 7:18 PM Jesse Glick <jgl...@cloudbees.com> 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.

Sanjeet Malhotra

unread,
Jun 25, 2020, 9:32:21 PM6/25/20
to Jenkins Developers
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.
Screenshot 2020-06-26 at 6.41.26 AM.png
Screenshot 2020-06-26 at 6.42.12 AM.png

Ullrich Hafner

unread,
Jun 26, 2020, 3:01:18 AM6/26/20
to Jenkins Developers
Am 26.06.2020 um 03:32 schrieb Sanjeet Malhotra <thesanjee...@gmail.com>:

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.


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 <jgl...@cloudbees.com> 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 jenkinsci-de...@googlegroups.com.
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>

Jesse Glick

unread,
Jun 26, 2020, 8:28:15 AM6/26/20
to Jenkins Dev
On Thu, Jun 25, 2020 at 9:32 PM Sanjeet Malhotra
<thesanjee...@gmail.com> 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.

thesanjee...@gmail.com

unread,
Jul 5, 2020, 8:30:47 AM7/5/20
to Jenkins Developers
Thanks, made it such that my code will only get triggered when user demands for it.
Reply all
Reply to author
Forward
0 new messages