PIT excludes integration tests by default

216 views
Skip to first unread message

Madalina Sicoi

unread,
Dec 1, 2020, 12:41:46 PM12/1/20
to PIT Users
Hey, everyone,

It appears PIT excludes classes names containing IT or integrationtests by default. Is it possible to bypass this and allow those classes to be picked up? Adding the path for those tests to targetTests doesn't change the behaviour.

Setup:
- pitmp-maven-plugin (1.3.7)
- pitest-junit5-plugin (0.12)

Output (with verbose enabled):
- Running report with ReportOptions [targetClasses=[x.y.z*], excludedMethods=[], excludedClasses=[], excludedTestClasses=[^.*.*\..*IT$, ^.*.*\.integrationtests\..*$, ^.*.*\.it\..*.*\..*$]...

Any hint would be greatly appreciated, thanks a lot!

Madalina

Stefan

unread,
Dec 2, 2020, 6:28:49 AM12/2/20
to pitu...@googlegroups.com

Hi Madalina,


Pitest parses maven surfire options by default and overwrites the property excludedTestClasses directly configured with pitest. I guess you're using failsafe to execute those integration tests during your maven build?

I've no experience with pitmp but it seems the PmpMojo extends from pitests AbstractPitMojo. Thus it should also support the following: If you set parseSurefireConfig to false the automatic parsing of surefire config should be suppressed. This will prevent pitest (and presumably pitmp) from excluding your integration tests. Please note that this also prevents other surefire configuration options (excluded or included groups, test failure ignore settings, ....) to be used.


Regards,

Stefan


Am 01.12.20 um 18:41 schrieb Madalina Sicoi:

--
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/13150333-4c6d-4d0c-a61f-d5ecb2569f07n%40googlegroups.com.

Madalina Sicoi

unread,
Dec 2, 2020, 7:26:19 AM12/2/20
to PIT Users
Hi, Stefan,

That's a great piece of information, it works! Both the unit and integration tests are now being picked up.

Thanks a lot!

Madalina

Reply all
Reply to author
Forward
0 new messages