运行munit测试任务后,bamboo工作失败

时间:2018-10-14 14:28:20

标签: testing mule bamboo munit

我正在尝试为Bamboo的Mulesoft代码添加CI管道。我的竹编工作中有结帐,构建,测试和部署步骤。这项工作正在成功测试并在/ target / munit-reports测试结果中创建了测试覆盖率报告,但是在测试步骤结束时,日志显示“任务失败,因为预期会出现测试用例,但未找到。整个工作失败了。我不明白为什么?没有错误,在日志中警告。仅行和步骤失败。知道为什么吗?下面是我的pom.xml,命令和日志。

**简单的14-Oct-2018 13:47:56失败的任务,因为预期会有测试用例,但没有找到。 简单的14-Oct-2018 13:47:56完成的任务'测试代码'与结果:失败****

我的命令如下:

mvn clean test -s settings.xml


<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.hcl.adc.mule</groupId>
    <artifactId>mycontacts-mule-api</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>mule</packaging>
    <name>Mule mycontacts-mule-api Application</name>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <mule.version>3.9.0</mule.version>
        <mule.munit.support.version>3.9.1</mule.munit.support.version>
        <munit.version>1.3.7</munit.version>
        <mule.tools.version>1.7</mule.tools.version>
        <application-name>mycontacts-mule-api</application-name>
        <proxy.api.version>1.0:15535407</proxy.api.version>
        <implementation.host>null</implementation.host>
        <implementation.port>80</implementation.port>
        <implementation.path>/api</implementation.path>
        <deployment-type>Cloudhub</deployment-type>
        <businessGroup>PARADIGM</businessGroup>
        <workerType>Small</workerType>
        <workers>1</workers>
        <environment>SIT</environment>
        <maven-deploy-plugin-version>2.8</maven-deploy-plugin-version>
        <mule-maven-plugin-version>2.0</mule-maven-plugin-version>
        <deploy.prop.deployEnv>sit</deploy.prop.deployEnv>
        <deploy.prop.envPrefix>sit</deploy.prop.envPrefix>
    </properties>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>${maven-deploy-plugin-version}</version>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.mule.tools.maven</groupId>
                <artifactId>mule-maven-plugin</artifactId>
                <version>${mule-maven-plugin-version}</version>
                <configuration>
                    <deploymentType>${deployment-type}</deploymentType>
                    <muleVersion>${mule.version}</muleVersion>
                    <applicationName>${application-name}</applicationName>
                    <username>${mule-username}</username>
                    <password>${mule-password}</password>

                    <businessGroup>${business-group}</businessGroup>

                    <redeploy>true</redeploy>
                    <workerType>${worker-size}</workerType>
                    <workers>${worker-count}</workers>
                    <environment>${env-name}</environment>
                    <properties>
                        <anypoint.platform.client_id>${mule-client-id}</anypoint.platform.client_id>
                        <anypoint.platform.client_secret>${mule-client-secret}</anypoint.platform.client_secret>
                        <anypoint.platform.analytics_base_uri>https://analytics-ingest.anypoint.mulesoft.com</anypoint.platform.analytics_base_uri>
                        <anypoint.platform.platform_base_uri>https://anypoint.mulesoft.com/apiplatform</anypoint.platform.platform_base_uri>
                        <anypoint.platform.coreservice_base_uri>https://anypoint.mulesoft.com/accounts</anypoint.platform.coreservice_base_uri>
                        <anypoint.platform.contracts_base_uri>https://anypoint.mulesoft.com/apigateway/ccs</anypoint.platform.contracts_base_uri>
                        <deploy-env>${deploy.prop.deployEnv}</deploy-env>
                        <env>${deploy.prop.env}</env>
                        <enable.analytics>true</enable.analytics>
                        <proxy.api.version>1.0:15535407</proxy.api.version>
                        <implementation.host>null</implementation.host>
                        <implementation.port>80</implementation.port>
                        <implementation.path>/api</implementation.path>
                    </properties>
                </configuration>
                <executions>
                    <execution>
                        <id>deploy</id>
                        <phase>deploy</phase>
                        <goals>
                            <goal>deploy</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.mulesoft.munit.tools</groupId>
                <artifactId>munit-maven-plugin</artifactId>
                <version>${munit.version}</version>
                <executions>
                    <execution>
                        <id>test</id>
                        <phase>test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <coverage>
                        <ignoreFlows>
                            <ignoreFlow>mycontacts-mule-api-console</ignoreFlow>
                            <ignoreFlow>mycontacts-mule-api-apiKitGlobalExceptionMapping</ignoreFlow>
                        </ignoreFlows> 
                        <runCoverage>true</runCoverage>
                        <formats>
                            <format>html</format>
                            <format>console</format>
                            <format>json</format>
                        </formats>
                    </coverage>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.mule.tools.maven</groupId>
                <artifactId>mule-app-maven-plugin</artifactId>
                <version>${mule.tools.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <copyToAppsDirectory>true</copyToAppsDirectory>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.7</version>
                <executions>
                    <execution>
                        <id>add-resource</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>add-resource</goal>
                        </goals>
                        <configuration>
                            <resources>
                                <resource>
                                    <directory>src/main/app/</directory>
                                </resource>
                                <resource>
                                    <directory>mappings/</directory>
                                </resource>
                                <resource>
                                    <directory>src/main/api/</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <testResources>
            <testResource>
                <directory>src/test/munit</directory>
            </testResource>
            <testResource>
                <directory>src/test/resources</directory>
            </testResource>
        </testResources>
    </build>

    <!-- Mule Dependencies -->
    <dependencies>
        <!-- Xml configuration -->
        <dependency>
            <groupId>com.mulesoft.muleesb</groupId>
            <artifactId>mule-core-ee</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- Xml configuration -->
        <dependency>
            <groupId>com.mulesoft.muleesb.modules</groupId>
            <artifactId>mule-module-spring-config-ee</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- Mule Transports -->
        <dependency>
            <groupId>org.mule.transports</groupId>
            <artifactId>mule-transport-file</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.transports</groupId>
            <artifactId>mule-transport-http</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.mulesoft.muleesb.transports</groupId>
            <artifactId>mule-transport-jdbc-ee</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.mulesoft.muleesb.transports</groupId>
            <artifactId>mule-transport-jms-ee</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.transports</groupId>
            <artifactId>mule-transport-vm</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- Mule Modules -->
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-scripting</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-xml</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- for testing -->
        <dependency>
            <groupId>org.mule.tests</groupId>
            <artifactId>mule-tests-functional</artifactId>
            <version>${mule.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-apikit</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- dependencies for Mule CoE Begins -->
        <!-- https://mvnrepository.com/artifact/guru.nidi.raml/raml-tester-standalone -->
        <dependency>
            <groupId>com.mulesoft.anypoint</groupId>
            <artifactId>mule-module-proxy</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.mulesoft.anypoint</groupId>
            <artifactId>mule-module-raml-el-gw</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.mulesoft.anypoint</groupId>
            <artifactId>mule-module-spring-config-gw</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
         </dependency>
         <dependency>
            <groupId>com.mulesoft.anypoint</groupId>
            <artifactId>api-gateway-client</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
         </dependency>
         <dependency>
            <groupId>com.mulesoft.anypoint</groupId>
            <artifactId>gateway-core</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
         </dependency>
        <dependency>
            <groupId>com.mulesoft.munit</groupId>
            <artifactId>mule-munit-support</artifactId>
            <version>${mule.munit.support.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.mulesoft.munit</groupId>
            <artifactId>munit-runner</artifactId>
            <version>${munit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.mulesoft.munit.utils</groupId>
            <artifactId>munit-dbserver-module</artifactId>
            <version>1.1.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-db</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-ws</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.mulesoft.weave</groupId>
            <artifactId>mule-plugin-weave</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-json</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-cxf</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- dependencies for Mule CoE Ends -->
    </dependencies>
    <repositories>
        <repository>
            <id>mulesoft-releases</id>
            <name>MuleSoft Releases Repository</name>
            <url>http://repository.mulesoft.org/releases/</url>
            <layout>default</layout>
        </repository>
        <repository>
              <id>mule-ee-releases</id>
              <name>MuleEE Releases Repository</name>
              <url>https://repository-master.mulesoft.org/nexus/content/repositories/releases-ee/</url>
        </repository>
        <repository> 
            <id>nexus-ee</id> 
            <name>nexus-ee</name> 
            <url>https://repository.mulesoft.org/nexus-ee/content/repositories/releases-ee/</url> 
            <layout>default</layout> 
            <releases> 
               <enabled>true</enabled> 
            </releases> 
            <snapshots> 
               <enabled>false</enabled> 
            </snapshots> 
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>mulesoft-release</id>
            <name>mulesoft release repository</name>
            <layout>default</layout>
            <url>http://repository.mulesoft.org/releases/</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>mule-public</id>
            <url>https://repository.mulesoft.org/nexus/content/repositories/releases</url>
        </pluginRepository>
    </pluginRepositories>
</project>

1 个答案:

答案 0 :(得分:1)

升级munit插件版本可解决此问题!