Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#18794 closed enhancement (implemented)

add cobertura task

Reported by: iwakeh Owned by: iwakeh
Priority: Medium Milestone: CollecTor 1.0.0
Component: Metrics/CollecTor Version:
Severity: Normal Keywords: ctip
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

add Cobertura task:

requires cobertura 1.9.4.1+dfsg-3 (wheezy or 1.9.4.1+dfsg-4 for jessie)

Child Tickets

Attachments (1)

0001-implements-tasks-18794-and-18792-java7-test-task-cov.patch (8.2 KB) - added by iwakeh 3 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 3 years ago by iwakeh

Cobertura 1.9.4 is way behind and has a problem with java 7.

I attached a patch version for cobertura 2.1.1
All other dependencies can be found in debian stable.

I also separated the different classpath settings for javac, junit, and cobertura.

And a new folder for all generated files is introduced, i.e. javadoc, cobertura report, classes, and
test results all have their own folders in this "generated" folder (see build.xml).

The cobertura check is currently set to zero values. It should be set to something we aim at once the test creation phase starts.

comment:2 Changed 3 years ago by iwakeh

Status: newneeds_review

I also added a javadoc jar to the jar task.

in order to run the tasks:

as said above, all dependencies come from debian stable (currently jessie).
except for cobertura.
cobertura 1.9 has a problem with java7 and makes the unit tests fail, so it is quite essential to use the newer version.

Last edited 3 years ago by iwakeh (previous) (diff)

comment:3 Changed 3 years ago by karsten

I'll need a quiet moment to look at the patch, which I don't have today. But here's some quick feedback on the cobertura requirement.

How about we distinguish three types of requirements:

  • All packages that are required to run a service on a host system should really be in Debian stable. That is, if somebody takes collector.jar, they only need to install openjdk-7-jre, apache2, and maybe a few others, but all of those are available via apt-get.
  • Packages required for releasing CollecTor should preferably be in Debian stable, but we can make exceptions if there are good reasons.
  • Any packages required for developing only can come from wherever, with a slight preference towards Debian stable packages.

The latter two requirements are more relaxed, because we can expect somebody who develops on or releases CollecTor to securely fetch their packages from anywhere. But the first requirement is still as strict as before, because we don't want somebody who runs a CollecTor instance to juggle versions of arbitrary libraries we decided to use here and there.

Note that this would also make #18793 a bit easier.

How crazy does this sound?

comment:4 in reply to:  3 Changed 3 years ago by iwakeh

Replying to karsten:

I'll need a quiet moment to look at the patch, which I don't have today. But here's some quick feedback on the cobertura requirement.

Thanks, for taking the time!

Your suggestion is far from being crazy. I perfectly agree with the first requirement.
The relaxed requirements in the last two are not necessary in order to accommodate using
the newer cobertura here and the newer checkstyle in #18793, I think.

Checkstyle and cobertura just help improve development, but it is possible to achieve the same
quality without them. These tasks just help us to avoid checking things manually, not a single line
of code is created or compiled using them.

And, you're right people who develop usually know what libraries to use or even have their preferred versions at hand and would override our versions anyway. At least that is what I often do when
looking at other projects. (unless it breaks, of course ;-)

Summary (to be added to the Contributor's Guide and FAQ):

Use only libraries from Debian stable as reference for compiling, packaging, and running CollecTor.
That also includes source generation (which is not in use at the time) and javadoc generation.

Any tools for determining quality metrics and quality reports are unrestricted. But, we have some suggested tasks added to our build file which aim at debian stable and only deviate for a good reason.


Hope this is in line with your thoughts.

Last edited 3 years ago by iwakeh (previous) (diff)

comment:5 Changed 3 years ago by karsten

Sounds like a great summary for the guide, and yes, this is what I had in mind. Can you add your summary to the guide or make sure we'll add it when writing/update that guide?

I also reviewed your patch and applied it with very minor changes. And I removed the Git submodule for metrics-lib. I simply committed those changes to master to speed up the process here. If anything in those commits was wrong, we can fix that in another commit.

By the way, when I tried out your patch, I started from a vanilla Debian stable machine and installed the following packages for building (but not for running) CollecTor. Maybe you want to include this list somewhere in the CollecTor-specific guide?

ant junit4 libasm4-java libcommons-codec-java libcommons-compress-java libcommons-lang3-java libgoogle-gson-java liblogback-java liboro-java libslf4j-java libxz-java openjdk-7-jdk

Not closing this ticket yet, so that we don't lose your summary and my list of packages. Feel free to close once you copied those pieces somewhere else. Thanks!

comment:6 Changed 3 years ago by iwakeh

Resolution: implemented
Status: needs_reviewclosed

Thanks for the quick review! And, for spotting those superfluous lines in build.xml!

I added the necessary parts from our comments above to #18733.

So, nothing left do be done here, closing now.

comment:7 Changed 3 years ago by iwakeh

Milestone: CollecTor 1.0.0

Added to milestone for first release.

Note: See TracTickets for help on using tickets.