Open turing85 opened 1 year ago
Yes, the issue is the java 9 module system. Before 9, service loader looked for a properties file to identify implementations, after 9 it also looks at module-info.
Pitest doesn't currently support module path. At some point it will have to, but a significant proportion of its user base is still stuck on java 8 and maintaining backwards compatibilty would be complicated if the build relied on java 9 features.
As a workaround you could add the legacy property file entries and then I believe the tests should run green.
Yes, the issue is the java 9 module system. Before 9, service loader looked for a properties file to identify implementations, after 9 it also looks at module-info.
Pitest doesn't currently support module path. At some point it will have to, but a significant proportion of its user base is still stuck on java 8 and maintaining backwards compatibilty would be complicated if the build relied on java 9 features.
Hm, I see. do we have this limitation documented somewhere?
As a workaround you could add the legacy property file entries and then I believe the tests should run green.
What exactly do you mean by this? Could you link to an example or a documentation page? Found it (docs.oracle.com
). And yes, you're right; this fixes the issue.
I just ran into this issue also. I have checked the documentation/FAQ especially the "My tests normally run green but PIT says the suite isn’t green" section. Finally, I have figured it out and applied the same workaround as proposed here. Until you fix it, I suppose the FAQ could be extended with a short description.
Reproducer:
https://github.com/turing85/advent-of-code-2022/tree/pitest-bug
:day-21
:MonkeyTreeTest
andMonkeysParserTest
fail without mutations.Noteworthy:
The only difference between the failing module and all other modules is that the failing modules takes advantage of Java modules by
MonkeyParser
through themodule-info.java
,module-info.java
, andServiceLoader
inMonkeysParser
All tests in the aforementioned classes use the code related to the
ServiceLoader
. I suspect that the failing tests are related to this.Logs of
stdout
andsterr
are attached, run was done with--define verbose='true'
.