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

Maven verbose option in configuration has no effect; looking for quieter builds #1338

Open
binkley opened this issue Jul 30, 2024 · 6 comments

Comments

@binkley
Copy link

binkley commented Jul 30, 2024

Summary: Looking to quiet the PITest output in my Maven build unless there are errors/warnings. An ask at bottom

I compared the build output with Maven for the verbose configuration option, and I find no difference.
Contrast with the Gradle plugin for PITest which has markedly less out when verbose is false.

Checking the source code ...

What I'm concluding:

  • The Maven and Gradle plugins for PITest have different senses of "verbose"
  • Gradle plugin treats "verbose = false" as be quieter
  • Maven plugin treats "verbose = true" as show more output

The existing PITest output is rather voluminous and detailed. I recommend to others a local build that is mostly quiet unless something goes wrong, and only default noisy in CI (ie, shared remote builds like GitLab, GitHub, ADO, etc).

Ask: How can I configure a maven build (including possibly config files for logging systems) so that I don't normally see much output unless things go wrong?

Output from Maven for PITest with verbose set to true and then set to false:
build-output-verbose-true.txt
build-output-verbose-false.txt

@hcoles
Copy link
Owner

hcoles commented Jul 30, 2024

The verbose flag is set to false by default, the output you are showing is the less noisy version.

You don't state how you are setting the flag to true for your test, but it appears to have been done incorrectly if both outputs are the same. If you enable from the command line using the standard maven convention

mvn -Dverbose=true etc etc

It will activate considerably more output.

You can achieve slightly less noise using the alternate verbosity flag.

mvn -Dverbosity=QUIET etc etc

Most of the output you are seeing (loaded plugins etc) is however generated before the verbosity flags are parsed so cannot currently be suppressed.

@binkley
Copy link
Author

binkley commented Jul 30, 2024

Hey @hcoles, thank you!
I'm looking specifically for the output from the PITest plugin, such as:

> org.pitest.mutationtest.engine.gregor.mutators.returns.BooleanFalseReturnValsMutator
>> Generated 2 Killed 2 (100%)
> KILLED 2 SURVIVED 0 TIMED_OUT 0 NON_VIABLE 0
> MEMORY_ERROR 0 NOT_STARTED 0 STARTED 0 RUN_ERROR 0
> NO_COVERAGE 0

With the Gradle plugin for PITest, I can set verbose to false and not see this. With Maven it still shows.
However, I believe this is how these 2 plugins treat this flag differently. Cool.
I want to document this different to help dev teams.

I'm writing docs in https://github.com/binkley/modern-java-practices/wiki/Maintain-your-build, and want to show folks how to get the output logging that makes sense for their project.
I ran with ./mvnw -Dverbosity=QUIET pitest:mutationCoverage and ./mvnw -Dverbose=false pitest:mutationCoverage without seeing a change.

How should I document this to others? What doc links for this project should I share?

@binkley
Copy link
Author

binkley commented Sep 9, 2024

Following up this issue with pitest/pitest-junit5-plugin#107.
Where is the source for https://pitest.org/quickstart/maven/ kept? I'm happy to open a PR to update the configuration options for the Maven plugin.

@binkley
Copy link
Author

binkley commented Sep 9, 2024

@szpak ☝️

@szpak
Copy link
Contributor

szpak commented Sep 9, 2024

Following up this issue with pitest/pitest-junit5-plugin#107. Where is the source for https://pitest.org/quickstart/maven/ kept?

https://github.com/hcoles/pitest-site/blob/gh-pages/quickstart/maven.markdown#verbose

verbose
Output verbose logging. Defaults to off/false.

Good catch, there could more information about possible options (or a link) in the "verbosity"-related paragraph. @hcoles How would you see it?

@hcoles
Copy link
Owner

hcoles commented Sep 9, 2024

Yes, the documentaiton is badly maintained at the moment and the vebosity flag looks to be missing. Happy to merge PR to add it.

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

3 participants