views:

82

answers:

1

I have set up continuous integration for multiple projects, which usually includes:

  • compilation;
  • testing;
  • javadoc generation;
  • dependency reporting;
  • static analysis ( PMD, CPD, FindBugs).

These are usually up in a ci target which cleans the workspace and runs all the above targets. I've tried most of the possible tricks to get them to run faster, including the ant parallel task, but these are still too slow.

I known about the pipeline pattern ( e.g. compile on commit, static analysis nightly ) but I'd like to get all of the information on each commit. By looking at Eclipse I can see that:

  • incremental compilation is definitely possible;
  • the findbugs plugin seems to have incremental analysis.

Is it possible to execute incremental CI builds, in order to decrease the waiting time after committing?

A: 

You haven't specified what ci system you use, but (regardless of this) have you considered using maven instead of ant as your build tool?

You can then set up two builds against your project:

  • the first build is triggered by a checkin and runs the compile + unit tests
  • the second is triggered by the first succeeding, and runs everything else

I would use sonar for "everything else" to get maximum useful reporting with minimum effort.

Kevin Wright
Thanks for your answer. I did consider this 'staged' build pattern, but it is not fast enough for that I need. In Eclipse, the findbugs plugin discovers new bugs in less than one second, because it analyses only the changes. That's what I'm looking for.
Robert Munteanu
You can do incremental stuff in hudson if your build tool supports it and you make sure not to run a clean as part of the job. Using SBT with scala for example could give you some very quick builds.Problem is, you're not cleaning between builds, which means that there's a whole class of error that your CI won't spot, and another class of error that only appears in incremental builds.I understand the desire for speed, which is why I generally advocate a fail-fast staged approach, but otherwise it's a best practice to clean before building.
Kevin Wright
Also, if you already get very fast error reporting in the IDE, why can you not allow it to be more rigorous in CI?
Kevin Wright
I could simply skip the 'clean' part, but as far as I know it's not safe to do so. The reason I want to do this is that (ideally) I'd receive fast feedback from the CI server using tools/plugins I don't necessarily have installed in my IDE.
Robert Munteanu