We are in the middle of developing a large project with many interacting modules and teams working on these modules. we implemented CI with jenkins, which runs periodic and built-in assemblies that run junit tests, usability tests, and cobertura coverage.
Since we interact with so many components, for some specific projects we have implemented integration tests that call the Spring context and run many test cases that simulate a significant part of the application flow. They are implemented as Junit for simplicity / convenience, are located in the src / test folders, but they are not unit tests .
Our problem is that some component assemblies take a very long time, and one of the problems identified is that lengthy integration tests are performed twice, once at the testing stage and once in the cobertra phase (as coberra classes, and then runs the tests again). Which leads to the question: is it possible to exclude a test from cobertura?
Using exception or ignoring in the pom cobertura configuration only works for src / java classes, not test classes. I could not find anything in the cobertura plugin documentation. I am trying to find a way to do this through configuration. The only other way that, in my opinion, can be achieved is to transfer these tests to another maven module, which does not have the cobertura plugin connected, and have this module for conducting integration tests. Thus, building the parent pom will cause integration tests, but that does not fall under the scope of cobertura. But if this can be done using the configuration, it would be much easier :)
Thanks in advance, JG
==== UPDATE AND PERMISSION ====
, kkamilpl ( !), , . java-, , surefire, ", " / " ", :
<profiles>
<profile>
<id>unit-tests</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<testcase.include>**/*.class</testcase.include>
<testcase.exclude>**/integration/*.class</testcase.exclude>
</properties>
</profile>
<profile>
<id>integration-tests</id>
<properties>
<testcase.include>**/integration/*.class</testcase.include>
<testcase.exclude>**/dummyStringThatWontMatch/*.class</testcase.exclude>
</properties>
</profile>
</profiles>
( , integration) test, target test integration-tests, . jenkins ( pom), jenkins , , , by cobertura, .