You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I made a pull request to update pitest version. It works well for all modules except one.
The module differs from others since it has no source code but only test sources. The purpose is to do cross-module tests (testing that everything works together).
The issue seems to be related to:
I understand that pitest alone can't work if there is no source code because it doesn't handle multi-module projects.
However, the purpose of pitmp is to allow to run pitest on mutli-module projects and to provide cross-module mutation testing.
Therefore, pitmp should provide correct configuration to pitest by adding classes of other modules.
Steps to reproduce
Create a maven project with child module-a and child module-b
Add dependency to module-b in module-a
Add some code and tests in module-b (Example with methods foo, bar and ExampleTest that tests foo method only)
Add only tests in module-a that test code of module-b (CrossModuleTest that tests bar method)
It fails on module-a with No mutations found. This probably means there is an issue with either the supplied classpath or filters.
This is because pitest tries load source files from directory module-a/target/classes and finds nothing.
Workarounds
I tried to by adding a simple class named Fake in src/main/java of module-a that has a single method just to feign source code so that the directory module-a/target/classes is created. Pitest runs but there is nothing in the report about the tests written in module-a that test code of module-b. This is not what I expected since it should run all tests of module-a, mutate all tests of module-a and also mutate code of dependencies (module-b in this case).
A workaround seems to copy code of all dependencies manually but it should be done by pitmp automatically.
Another possible solution may be to provide a custom CodeSourceFactory extension to provide additional sources in the classpath used by pitest.
The text was updated successfully, but these errors were encountered:
Characteristics
Description
I made a pull request to update pitest version. It works well for all modules except one.
The module differs from others since it has no source code but only test sources. The purpose is to do cross-module tests (testing that everything works together).
The issue seems to be related to:
I understand that pitest alone can't work if there is no source code because it doesn't handle multi-module projects.
However, the purpose of pitmp is to allow to run pitest on mutli-module projects and to provide cross-module mutation testing.
Therefore, pitmp should provide correct configuration to pitest by adding classes of other modules.
Steps to reproduce
module-a
and childmodule-b
module-b
inmodule-a
module-b
(Example
with methodsfoo
,bar
andExampleTest
that testsfoo
method only)module-a
that test code ofmodule-b
(CrossModuleTest
that testsbar
method)It fails on
module-a
withNo mutations found. This probably means there is an issue with either the supplied classpath or filters.
This is because pitest tries load source files from directory
module-a/target/classes
and finds nothing.Workarounds
I tried to by adding a simple class named
Fake
insrc/main/java
ofmodule-a
that has a single method just to feign source code so that the directorymodule-a/target/classes
is created. Pitest runs but there is nothing in the report about the tests written inmodule-a
that test code ofmodule-b
. This is not what I expected since it should run all tests ofmodule-a
, mutate all tests ofmodule-a
and also mutate code of dependencies (module-b
in this case).A workaround seems to copy code of all dependencies manually but it should be done by pitmp automatically.
Another possible solution may be to provide a custom
CodeSourceFactory
extension to provide additional sources in the classpath used by pitest.The text was updated successfully, but these errors were encountered: