EGHM
EGHM

Reputation: 2140

How to run TestNG AND JUnit tests with Maven-3 under Jenkins without loosing reporting

After adding TestNG tests to our Jenkins test job reports would no longer be produced. I removed the TestNG tests and dependencies and reports started to be produced again. How can I run both TestNG and JUnit tests with Maven-3 under Jenkins with reporting?

Upvotes: 1

Views: 658

Answers (1)

James A Wilson
James A Wilson

Reputation: 14691

Is your pom configuring surefire as recommended here? (pom plugin example copied below) You should confirm that both test libraries are being run at the command line as well as from jenkins using the test goal.

<plugin>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>${surefire.version}</version>
    <dependencies>
        <dependency>
            <groupId>org.apache.maven.surefire</groupId>
            <artifactId>surefire-junit47</artifactId>
            <version>${surefire.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.surefire</groupId>
            <artifactId>surefire-testng</artifactId>
            <version>${surefire.version}</version>
        </dependency>
    </dependencies>
</plugin>

Upvotes: 1

Related Questions