How to disable dashboard report generation when running test task locally?

One of the changes in 1.7 was to essentially make all report-generating tasks run whenever one of them is run. In Hibernate build we enable checkstyle and findbugs plugins for example. Those 2 along with test are all report generating. So what ultimately happens is that locally when i make a change and want to verify my fixes so I run ‘gradle test’ I have to sit through checkstyle and findbugs also running. The trouble being that these 2 tasks take a significant amount of time to run.

So how can I set up a task to run tests but not run the other report tasks (I guess to not run the dashboard report task)?

Very odd. I cannot replicate this behavior (caveat, I did not check out the actual hibernate build)

Applying the ‘build-dashboard’ plugin to the root project and checkstyle and findbugs to any number of subprojects does not seem to trigger findbugs or checkstyle tasks when running the ‘test’ task only.

When you run a ‘gradle tasks --all’, what shows up as dependent tasks of the ‘test’ task for the subproject you were changing code within? The ‘buildDashboard’ task should not force other tasks to run if they aren’t already in the task graph.

-Spencer

Are you using 1.7? This is specifically one of the release notes wrt task finalizers and reporting tasks.

Specifically, from the release notes…

  1. “Test task implements standard Reporting interface” …

  2. “Build dashboard improvements”: > The above change (Test task implements standard Reporting interface) means that the test reports now

appear in the build dashboard. >

Also, the buildDashboard task is automatically executed when any reporting task is executed (by way of

the new “Finalizer Task” mechanism mentioned earlier).

So when you run test, its reports are run (“reporting task”) which triggers buildDashboard (via finalizer) which in turn triggers all reporting tasks (checkstyle, pmd, findbugs, etc) to be run (well, whichever ones you have configured).

I was definitely running with 1.7.

Explicitly running buildDashboard without any other tasks did not trigger checkstyle, pmd, or findbugs for me (I tried all three, and together).

For me, the buildDashboard task was aware of the findbugs, checkstyle, and pmd potential output files, but findbugsMain nor findbugsTest nor the equivalents for pmd and checkstyle actually ran to generate them unless I forced it via check or manually invoking them.

Weird. What happens if you explicitly do?

gradle test -x buildDashboard

If the pmd/checkstyle/findbugs tasks still run, it should not be because of the buildDashboard task.

-Spencer

excluding buildDashboard does in fact solve the situation (checkstyle, etc are not run). What I want is for this to be the default.

I appreciate the replies, but can we please stop with the “it does not work that way for me” train? The release notes clear say this is expected. Thanks.

Yes, test now has a reporting task that is run. Yes, running “gradle test” should trigger buildDashboard. But, no. Invoking buildDashboard either explicitly or implicitly should not trigger all reporting tasks. The release notes do not imply this assertion.

The design documents for reporting (design-docs/reporting.md) explicitly make it clear that it should never trigger report tasks: “Running gradle buildDashboard will generate an HTML report that links to the test and checkstyle reports, if they exist. It will not generate those reports.”

Line 412 of the hibernate root project build.gradle file is the culprit:

buildDashboard.dependsOn check

This is why findbugs and checkstyle are being called for your builds, and I was unable to replicate the behavior using the default behavior of the build-dashboard plugin.

-Spencer

Ok, I think I am misunderstanding the purpose of buildDashboard. Thanks for the pointer.

Not sure how to mark a question as answered, but this can be marked as such