Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too loud output #506

Closed
boris-petrov opened this issue Nov 29, 2017 · 6 comments
Closed

Too loud output #506

boris-petrov opened this issue Nov 29, 2017 · 6 comments

Comments

@boris-petrov
Copy link

Whenever I run SpotBugs, there's billions of lines like:

Scanning archives (58 / 218)
...
Pass 1: Analyzing classes (22 / 201) - 10% complete
Pass 1: Analyzing classes (23 / 201) - 11% complete
...

Is is possible to somehow suppress this output? This can be seen when using gradle --console=plain.

@bernolanger
Copy link

Which version of Gradle are you using?

An entry in https://docs.gradle.org/4.2.1/release-notes.html states

FindBugs plugin does not render analysis progress anymore

@boris-petrov
Copy link
Author

That's strange. I'm using the latest version, 4.3.1.

Actually now that I think about it this happens only in our CI server - we're using Hudson and we can see these things in its log. On my machine when I run it I get a much smaller output - something like:

Scanning archives (1011 / 1011)
2 analysis passes to perform
Pass 1: Analyzing classes (1617 / 1617) - 100% complete
Pass 2: Analyzing classes (806 / 806) - 100% complete
Done with analysis

I guess when Gradle is redirecting the output it uses console=plain but on my machine it still doesn't happen neither with a pipe, nor with a plain console. Any ideas?

@bernolanger
Copy link

bernolanger commented Nov 30, 2017

I can confirm the issue. Locally the output is very short, on the (Jenkins-)Build-Server the progress is reported.

When switching back to FindBugs there is the same output locally and no output on the build server.

Looking at the sources it seems that the FindBugs-Gradle-Plug-in got two new properties in the meantime: jvmArgs and showProgress.

https://github.com/gradle/gradle/blob/master/subprojects/code-quality/src/main/groovy/org/gradle/api/plugins/quality/FindBugsExtension.java

When adding the "showProgress = true" in the build configuration of the findbugs Task, the progress is shown on the build server again.

asfgit pushed a commit to apache/aurora that referenced this issue Dec 12, 2017
Spotbugs prints multiple lines with \r [1][2]. This looks like a single
line for shell commands but will be converted to multiple lines once
read by Python.

By performing the conversion before the tail command, we will get a
consistent line count in Bash and Python.

[1] https://github.com/spotbugs/spotbugs/blob/fe8a8d66e97d3ae0b830731461aab0f8b39791f6/spotbugs/src/main/java/edu/umd/cs/findbugs/TextUIProgressCallback.java#L103
[2] spotbugs/spotbugs#506

Bugs closed: AURORA-1961

Reviewed at https://reviews.apache.org/r/64508/
@AdamRoberts
Copy link

This issue appears to occurs anytime you redirect the Spotbugs output to a file. So it will probably occur on all CI servers. I can personally confirm that it adds 2 log lines per Java class on TeamCity. For a single build that adds 8k log lines making investigating build issue much harder.

@KengoTODA
Copy link
Member

@bernolanger
Copy link

Is there any plan to maintain the FindBugs- and the SpotBugs-Gradle-Plug-ins together to avoid this kind of differences?

https://github.com/gradle/gradle/blob/master/subprojects/code-quality/src/main/groovy/org/gradle/api/plugins/quality/internal/findbugs/FindBugsSpecBuilder.java#L168

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants