How to get Jenkins to send JsUnit report if a failure occurs?

265 Views Asked by At

Below is the segment of pom.xml that Jankins runs but it doesn't send in the e-mail the error that occurred. Did anybody get this to work.

<plugin>
            <groupId>de.berlios.jsunit</groupId>
            <artifactId>jsunit-maven2-plugin</artifactId>
            <executions>
                <execution>
                    <id>test</id>
                    <configuration>
                        <sourceDirectory>./WebContent/jsunit</sourceDirectory>
                        <sources>
                            <source>blah.js</source>

                        </sources>
                        <testSourceDirectory>./WebContent/jsunit</testSourceDirectory>
                        <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
                        <testSuites>
                            <testSuite>
                                <name>SampleSuite</name>
                                <type>TESTCASES</type>
                                <includes>
                                    <include>blah_test.js</include>
                                </includes>
                            </testSuite>
                        </testSuites>
                    </configuration>
                    <goals>
                        <goal>jsunit-test</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
1

There are 1 best solutions below

0
gareth_bowles On

Jenkins won't do this by default, but if you use the Extended Email plugin you can configure your build emails to include any data you like from the console output. You might also want to look at these examples of using Jelly templates to format the emails.