In MuleSoft development before deploying our Mule applications and APIs we write test cases for unit and integration testing.
Ignoring Flows:
<coverage>
<ignoreFlows>
<ignoreFlow>flow-name</ignoreFlow>
</ignoreFlows>
</coverage>
Ignoring File:
If you want to remove a file from your Coverage report, you can add the following piece of code in the POM file:
<coverage>
Note:
Please keep in mind that the coverage tag must be included in the Mule Maven plugin configuration tag. For example:
<plugins>
<plugin>
<groupId>com.mulesoft.munit.tools</groupId>
<artifactId>munit-maven-plugin</artifactId>
<configuration>
…
<coverage>
…
</coverage>
…
</configuration>
</plugin>
</plugins>
The steps mentioned in this article are only useful for terminal console.
Coverage report with ignore tags: mvn clean install
Coverage report without ignore tags: mvn clean install
Ignore MUnit from command line
mvn clean package -DskipTests
or
you can add skip test configuration inside pom as below:
<plugins>
<plugin>
<groupId>com.mulesoft.munit.tools</groupId>
<artifactId>munit-maven-plugin</artifactId>
<configuration>
…
<skipMunitTests>true</skipMunitTests>
…
</configuration>
</plugin>
</plugins>
Please find sample Mule project in Github Munit coverage report mule4
Happy learning 🙂
very informative. thanks for sharing 🙂
Thank you Nurav this is really motivating. I Will share more article like this.
Hi Manish,
I tried the above steps but in my case it's not working. So, could you please help me regarding this.
Thanks in advance!
It will only work with commandline only. You need to install maven. Sample project is given in the github link https://github.com/manishkumarsah/munit-coverage-report-mule4