Surefire报告在报告中生成重复结果

时间:2017-06-09 08:33:36

标签: maven ant soapui maven-surefire-plugin damage-control

我正在关注MAVEN的SO链接和使用jenkins运行的SOAPUI自动化的ANT任务。

它工作正常并执行。但Surefire html报告生成相同的testSuite,testCases两次。 enter image description here

ANT JUnit报告生成正确的报告enter image description here

下面是我的pom.xml文件 -

<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.amadeus.developers</groupId>
<artifactId>pad-apis</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>PAD API (Self-Services APIs)</name>
<url>http://rndwww.nce.amadeus.net/git/scm/ad/pad-api-regression.git</url>
<description>Automated api test for Amadeus Self-Services APIs</description>

<pluginRepositories>
    <pluginRepository>
        <id>smartbear-sweden-plugin-repository</id>
        <url>http://www.soapui.org/repository/maven2/</url>
    </pluginRepository>
</pluginRepositories>

<dependencies>
    <dependency>
        <groupId>org.reflections</groupId>
        <artifactId>reflections</artifactId>
        <version>0.9.9-RC1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml</artifactId>
        <version>3.10-FINAL</version>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
        <scope>test</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>com.smartbear.soapui</groupId>
            <artifactId>soapui-maven-plugin</artifactId> 
            <version>5.3.0</version>
            <configuration>                 
                <projectFile>${project.basedir}/src/test/PAD-API-Regression-soapui-project.xml</projectFile>                    
                <outputFolder>${project.basedir}/target/surefire-reports</outputFolder>                 
                <junitReport>true</junitReport>
                <exportAll>true</exportAll>
                <printReport>true</printReport>
                <testFailIgnore>true</testFailIgnore>
            </configuration>
            <executions>
                <execution>
                    <id>test-report</id>                
                    <phase>test</phase>
                    <goals>             
                        <goal>test</goal>                           
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
                <source>1.7</source>
                <target>1.7</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.jvnet.maven-antrun-extended-plugin</groupId>
            <artifactId>maven-antrun-extended-plugin</artifactId>
            <executions>
                <execution>
                    <id>test-report</id>                
                    <phase>test</phase>
                    <goals>             
                        <goal>run</goal>                            
                    </goals>
                    <configuration>
                        <tasks>
                            <junitreport todir="target/surefire-reports">
                                <fileset dir="target/surefire-reports">
                                    <include name="**/*.xml"/>
                                </fileset>
                                <report format="noframes" todir="target/site"/>
                            </junitreport>
                        </tasks>
                    </configuration>
                </execution>
            </executions>
            <dependencies>
                <dependency>
                    <groupId>org.apache.ant</groupId>
                    <artifactId>ant-junit</artifactId>
                    <version>1.8.0</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.ant</groupId>
                    <artifactId>ant-trax</artifactId>
                    <version>1.8.0</version>
                </dependency>
            </dependencies>     
        </plugin>
    </plugins>
</build>
<reporting>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-report-plugin</artifactId>
            <version>2.20</version>
            <configuration>
                <reportsDirectories>
                    <reportsDirectories>${project.basedir}/target/surefire-reports</reportsDirectories>
                </reportsDirectories>
                <skipTests>true</skipTests>
                <redirectTestOutputToFile>true</redirectTestOutputToFile>
                <linkXRef>false</linkXRef>
                <outputName>report</outputName>
            </configuration>
        </plugin>
        <plugin>
            <groupId>com.github.damage-control.report</groupId>
            <artifactId>damage-control-maven-plugin</artifactId>
            <version>1.2</version>
        </plugin>
    </plugins>
</reporting>

我尝试修改pom.xml文件中的一些配置

in surefire plugin

<executions>
      <execution>
        <id>attach-sources</id>
        <goals>
          <goal>jar-no-fork</goal>
        </goals>
      </execution>
</executions>

in ANT task config -

<phase>generate-sources</phase>

什么都没有用。

在pom.xml文件中,我还有损坏控制插件来生成报告 - 但损害控制插件也没有产生适当的报告 -

对于损坏控制报告,我了解生成的.xml / .txt文件不是Selenium Surefire插件生成的正确格式。这可能是不能生成适当的损害控制报告的理由。因为这是SOAPUI项目 - 是否有任何工作来从SOAPUI项目生成损坏控制报告 -

以下是来自SOAPUI项目和Selenium项目的日志 -

SOAPUI日志 -

Status: OK
Time Taken: 9
Size: 3858
Timestamp: Fri Jun 09 09:14:06 CEST 2017
TestStep: API_airport-lists-by-city/country_UtilitiesFamily

----------------- Messages ------------------------------

----------------- Properties ------------------------------
StatusCode: 200
Method: GET
HTTP Version: HTTP/1.1
Endpoint: amadeus.net:8888
 URL: http://..../api/v0/apis/7

---------------- Request ---------------------------
Host: [amadeus.net:8888]
Accept-Encoding: [gzip,deflate]
User-Agent: [Apache-HttpClient/4.1.1 (java 1.5)]
Connection: [Keep-Alive]

GET http://....../api/v0/apis/7 
HTTP/1.1
Accept-Encoding: gzip,deflate
Host: amadeus.net:8888
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

Surefire报告日志 -

-------------------------------------------------------------------------------
Test set: com.amadeus.developers.pad.amp.catalogue.Catalogue_TryIt_002_SoapSpec
 Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 22.517 sec - in com.amadeus.developers.pad.amp.catalogue.Catalogue_TryIt_002_SoapSpec

两种格式都不同,我猜这就是damamge-control插件无法生成正确报告的原因。

enter image description here

但是,如果有一些可靠的报告重复解决方案并解决了soapui的损坏控制插件,那将会很有帮助。

0 个答案:

没有答案