clement M.
clement M.

Reputation: 141

surefire overwrites reports with soapui maven plugin for many projects with same testsuite names

I have many SOAPUI Projects. Each SOAPUI project has many testsuites.

The testsuites have the same name in different projects.

Likewise, the testcases has the same name in differents projects

For example :

Project1 has testsuite1 and testsuite2. Testsuite1 of project1 has testcase1.

Project2 has testsuite1 and testsuite2. Testsuite1 of project2 has testcase1

When I launch soapui tests with soapui-maven-plugin, the surefire reports file name are built with the testsuite name and the testcase name. The problem is that I launch the plugin for each projects so the reports are overwritten. I need to keep these reports in order jenkins to be able to generate graphs.

Is there a way to avoid this overwriting?

Is it possible to prefix the name of the report files with soapui project name?

<build>
            <plugins>
                <plugin>
                    <groupId>com.smartbear.soapui</groupId>
                    <artifactId>soapui-maven-plugin</artifactId>
                    <version>5.0.0</version>
                    <executions>
                        <execution>
                            <id>TestFluxCourant</id>
                            <goals>
                                <goal>test</goal>
                            </goals>
                            <phase>integration-test</phase>
                            <configuration>
                                <projectFile>${project.basedir}/src/test/resources/project1.xml</projectFile>
                            </configuration>
                        </execution>
                        <execution>
                            <id>TestFluxHistorique</id>
                            <goals>
                                <goal>test</goal>
                            </goals>
                            <phase>integration-test</phase>
                            <configuration>
                                <projectFile>${project.basedir}/src/test/resources/project2.xml</projectFile>
                            </configuration>
                        </execution>
                    </executions>
                    <configuration>
                        <host>${integration}:${integrationPort}</host>
                        <outputFolder>${project.build.directory}/surefire-reports</outputFolder>
                        <junitReport>true</junitReport>
                        <printReport>false</printReport>
                        <exportAll>true</exportAll>
                        <testFailIgnore>true</testFailIgnore>
                        <settingsFile>${project.basedir}/src/test/resources/Soapui-maven-conf.xml</settingsFile>
                    </configuration>
                </plugin>
            </plugins>
        </build>

Upvotes: 1

Views: 334

Answers (2)

Eiston Dsouza
Eiston Dsouza

Reputation: 404

Not sure if it works... But give this a try

<outputFolder>${project.build.directory}/surefire-reports/${projectFile}</outputFolder>

Upvotes: 0

SiKing
SiKing

Reputation: 10329

According to documentation, configuration is per execution. If you correct your pom, it should be trivial:

<plugin>
    <groupId>com.smartbear.soapui</groupId>
    <artifactId>soapui-maven-plugin</artifactId>
    <version>5.0.0</version>
    <executions>
        <execution>
            <id>TestFluxCourant</id>
            <goals>
                <goal>test</goal>
            </goals>
            <phase>integration-test</phase>
            <configuration>
                <projectFile>${project.basedir}/src/test/resources/project1.xml</projectFile>
                <host>${integration}:${integrationPort}</host>
                <outputFolder>${project.build.directory}/project1</outputFolder>
                <junitReport>true</junitReport>
                <printReport>false</printReport>
                <exportAll>true</exportAll>
                <testFailIgnore>true</testFailIgnore>
                <settingsFile>${project.basedir}/src/test/resources/Soapui-maven-conf.xml</settingsFile>
            </configuration>
        </execution>
        <execution>
            <id>TestFluxHistorique</id>
            <goals>
                <goal>test</goal>
            </goals>
            <phase>integration-test</phase>
            <configuration>
                <projectFile>${project.basedir}/src/test/resources/project2.xml</projectFile>
                <host>${integration}:${integrationPort}</host>
                <outputFolder>${project.build.directory}/project2</outputFolder>
                <junitReport>true</junitReport>
                <printReport>false</printReport>
                <exportAll>true</exportAll>
                <testFailIgnore>true</testFailIgnore>
                <settingsFile>${project.basedir}/src/test/resources/Soapui-maven-conf.xml</settingsFile>
            </configuration>
        </execution>
    </executions>
</plugin>

BTW: Not sure what surefire has to do with any of this.

Upvotes: 0

Related Questions