Loading

[MUnit] Unable to run munits with the 4.4.0 runtime | Error : There are no tests to be run or all tests are ignored

Julkaisupäivä: Mar 2, 2024
Ratkaisu

SYMPTOM

Unable to run munits with the 4.4.0 runtime. Zero Test case  get executed . There are no tests to be run or all tests are ignored
================================================================================
=== Running suite: xxxx-create-user-flow-test-suite.xml ===
================================================================================
INFO 2023-01-31 20:33:08,139 [munit.01] org.mule.munit.runner.SuiteRunner: MUnit suite: xxx-create-user-flow-test-suite.xml will not be run. There are no tests to be run or all tests are ignored
================================================================================
= Tests run: 0 - Failed: 0 - Errors: 0 - Skipped: 0 - Time elapsed: 0.02 sec =

CAUSE

The root cause behind this  issue is incompatible MUnit version/dependency used in application with respect to the runtime.
If a user use a pretty old version dependency used in your application , this kind of error may occur . For instance if you use Munit plugin version 2.2.1 with runtime 4.4.0.
 
<dependency>
<groupId>com.mulesoft.munit</groupId>
<artifactId>munit-runner</artifactId>
<version>2.2.1</version>
<classifier>mule-plugin</classifier>
<scope>test</scope>
</dependency>

If you are upgrading to Mule 4.4 from an earlier Mule 4.x version, see Upgrading Mule Runtime Engine (Versions 4.x to 4.n) for upgrade instructions. To ensure optimal performance with Mule 4.4 and avoid unexpected issues, update the following modules and extensions to their latest version at the time of this release. The minimum MUnit plugin version supported is 2.3.6 and the latest.


 

SOLUTION

Therefore, removed all the old dependencies and upgrades the application with the latest version of Munit supported for mule runtime 4.4.0 i.e MUnit plugin version supported is 2.3.6 and the latest.
 
<dependency>
<groupId>com.mulesoft.munit</groupId>
<artifactId>munit-runner</artifactId>
<version>2.3.14</version>
<classifier>mule-plugin</classifier>
</dependency>



Also upgraded the below property in pom.xml:
<app.runtime>4.4.0-20230111</app.runtime>  // latest runtime patch 
<mule.maven.plugin.version>3.8.1</mule.maven.plugin.version> latest mmp version
<munit.version>2.3.14</munit.version> // latest Munit version

After updating all these the existing test case were executed successfully and the issue will be resolved.
Knowledge-artikkelin numero

001119606

 
Ladataan
Salesforce Help | Article