0

I want to run 3 different jobs for 3 testNG suits on pipeline with in an order. with this configuration each job runs all tests , actually this configuration doesn’t take this suits from this file, it runs what pom.xml has, it has these 3 suits.

gitlab-ci.yml

build: stage: build script: - mvn compile

stages:

  • test1
  • test2
  • test3

ui-test-qa3-1: stage: test1 script: - ls - mvn test -fn -DsuiteXMLFile="testQA3v2.2.xml"

tags: - ui-test

ui-test-qa3-2: stage: test2 script: - ls - mvn test -fn -DsuiteXMLFile="testQA3v2.2_1.xml" needs: - ui-test-qa3-1

tags: - ui-test

ui-test-qa3-3: stage: test3 script: - ls - mvn test -fn -DsuiteXMLFile="testQA3v2.2_2.xml" needs: - ui-test-qa3-2 tags: - ui-test

and pom.xml build

install
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.1.2</version>
                <configuration>
                    <suiteXmlFiles>
                        <suiteXmlFile>testQA3v2.2.xml</suiteXmlFile>
                           <suiteXmlFile>testQA3v2.2_1.xml</suiteXmlFile>
                              <suiteXmlFile>testQA3v2.2_2.xml</suiteXmlFile>

                    </suiteXmlFiles>
                </configuration>


            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>

I tried to run without suite config. in pom.xml but than it runs all tests in the project. I want to run job1 with suite1 and than job2 for suite2 then job3 suite3

esra
  • 1

0 Answers0