Robotframework Jenkins插件多模块报告

时间:2014-02-03 12:18:24

标签: maven jenkins robotframework

我对Robotframework Jenkins插件(https://wiki.jenkins-ci.org/display/JENKINS/Robot+Framework+Plugin)和多模块maven项目有疑问: 截至最新版本1.4.0中的更改日志:JENKINS-8381 Robot summary and trend graph for multi-configuration projects已实施。 但是如何在多模块maven项目中使用该新功能?

父母的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/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<groupId>test</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>

<name>Parent</name>

<modules>
    <module>submodule1</module>
    <module>submodule2</module>
</modules>

<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.robotframework</groupId>
                <artifactId>robotframework-maven-plugin</artifactId>
                <version>${default.robotframework-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <variables>
                        <variable>LANG:EN</variable>
                    </variables>
                    <logLevel>DEBUG</logLevel>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

子模块1的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>

<parent>
    <groupId>test</groupId>
    <artifactId>parent</artifactId>
    <version>1.0-SNAPSHOT</version>
    <relativePath>../pom.xml</relativePath>
</parent>

<name>${project.artifactId}</name>
<artifactId>submodule1</artifactId>

<properties>
    <main.basedir>${project.parent.basedir}</main.basedir>
    <appVersion>${project.version}</appVersion>
</properties>

<build>
    <plugins>
        <plugin>
            <groupId>org.robotframework</groupId>
            <artifactId>robotframework-maven-plugin</artifactId>
            <configuration>
                <testCasesDirectory>src/test/robotframework/Suites</testCasesDirectory>
            </configuration>
        </plugin>
    </plugins>
</build>

然后,Jenkins Job将在父pom上调用'mvn install',它将触发所有子模块以及使用其测试套件运行robotframework,最后将为每个子模块生成log.html,report.html和output.xml在他们自己的文件夹中:/submodule1/target/robotframework-reports/output.xml,/submodule2/target/robotframework-reports/output.xml等。

现在Robotframework Jenkins插件应该聚合这些结果。但是通过我的插件配置(* /report.html,* /log.html, ** / output.xml),它只显示子模块2的报告。如何配置报告的聚合?

1 个答案:

答案 0 :(得分:1)

在我尝试了各种不同的Robotframework Jenkins插件配置后,它仍然没有按预期工作,我开始调试代码并在插件中发现了一个错误!

有关详细信息,请参阅:https://issues.jenkins-ci.org/browse/JENKINS-21644