0

I have a pre-requisite test that needs to be run before the Regression suite in jenkins. Please advice ? The pre-requisite tests does some configuration task before the regression could start. The environment that we are using is eclipse with TestNG, maven. The coding language used is java.

Bob Jones
  • 171
  • 1
  • 4
  • 22

1 Answers1

1

Use the pre-integration-test phase for running the configuration setups. Set it up with the Maven Failsafe plugin in the pom.xml. Refer to this - http://maven.apache.org/surefire/maven-failsafe-plugin/ and Maven Failsafe Plugin: how to use the pre- and post-integration-test phases


Update with pom.xml sample build section.

<build>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.21.0</version>
                <executions>

                    <execution>
                        <id>pre-test</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <includes>
                                <include>**/PreTest.class</include>
                            </includes>
                        </configuration>
                    </execution>

                    <execution>
                        <id>int-test</id>
                        <phase>integration-test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <includes>
                                <include>**/IntTest.class</include>
                            </includes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

Use this in the pre-integration-test configuration instead

<configuration>
    <suiteXmlFiles>
         <suiteXmlFile>
             src/test/resources/testng.xml(Path to testng xml) 
         </suiteXmlFile>
    </suiteXmlFiles>
</configuration>
Grasshopper
  • 8,908
  • 2
  • 17
  • 32