Report aggregation with Maven

36 views
Skip to first unread message

Nicola Waters

unread,
May 8, 2024, 2:01:04 AMMay 8
to PIT Users
Hello,

Long time Pitest user, but I've never used the report aggregator before, and would like to get it working with the Maven plugin, but having some trouble.

No matter what I configure I seem to get the 'no line coverage files have been set' message: even though I can see the line report xml file in each module

I'm following the FAQ instructions but I must be making an obvious mistake, if anyone could answer the following would much appreciate it

- does the report aggregator work with arc mutate libraries present?
- am I supposed to run report-aggregate from the root project, or from the reporting module? (I get the same error either way)
- if one's Pit configuration is in the root project's plugin management (as opposed to duplicated in each module), is that likely to have an adverse effect?

I can't see any sign the aggregator plugin is actually looking at my reporting module's dependencies, so I feel like I must be making a silly mistake

thanks.
Nic

Henry Coles

unread,
May 8, 2024, 1:17:59 PMMay 8
to pitu...@googlegroups.com
Hi Nicola,

The aggregate functionality was a user supplied feature for pitest I've not previously tried myself. I've just worked through the documentation and hit (probably) the same issue as you.

It took some painful debugging, but I eventually managed to get it to work. The issue was that the plugin only works when the goal is bound to a maven lifecycle stage. If you call it directly, it is unable to find any of the other modules and fails with a misleading message. The problem isn't that it can't find line coverage files, it can't find any files at all.

I also hit a secondary issue where the version of jackson used conflicted with other plugins on the classpath. I'll push a release out shortly that fixes that and also improves the failure message slightly.

Henry

--
You received this message because you are subscribed to the Google Groups "PIT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pitusers+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pitusers/a39a7476-fc12-41d4-aba8-12d30349cc5dn%40googlegroups.com.

Henry Coles

unread,
May 9, 2024, 10:00:46 AMMay 9
to pitu...@googlegroups.com

Nicola Waters

unread,
May 9, 2024, 1:13:38 PMMay 9
to PIT Users
Hello Henry,

thanks so much for debugging it and for getting back to me- I was convinced I was doing something silly:)

I will give it a try binding it to a lifecycle phase this evening, using the version with the Json fix

thanks again,
Nic

PS Pitest is *awesome*, I started using it years ago and now I refuse to do Java without it;)

Nicola Waters

unread,
May 15, 2024, 2:35:29 PMMay 15
to PIT Users
Hi Henry,

suggested fix worked perfectly. I usually just call Pitest's goal directly, so what I changed was

- added a profile in my parent POM for Pitest and moved its plugin config into there, binding it to 'test'
- added the config to export line coverage
- added new aggregator module with its own profile, also bound to test

The reason I put the aggregator module into its own profile- originally I just put it into the main Pitest profile, but then interestingly, my arcmutate workflow (on GitHub Actions) failed at aggregate module stage, with the same error about not finding line coverage. Obviously it doesn't need the aggregated report anyway, so having it just use the main Pitest profile fixed that.

thanks very much, having this working will save a lot of time checking reports:) and I much appreciate the very quick response

Nic
Reply all
Reply to author
Forward
0 new messages