Sonar build does not run Cucumber tests

守給你的承諾、 提交于 2019-12-13 05:26:08

问题


I am trying to run Sonar build on Jenkins. My project contains both Junit and Cucumber tests. I verified the log files after build, the Sonar build kicks off after normal maven build and picks only the Junit tests but not Cucumber tests.

I have the following versions and plugins available in my POM file. Please let me know if any one has come across the similar issue and fixed it. Many Thanks!

Junit version 4.11 Cucumber version 1.1.2 Sonar version 3.5.1

        <plugin>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jetty-maven-plugin</artifactId>
            <executions>
                <execution>
                    <id>start-jetty</id>
                    <phase>process-test-classes</phase>
                    <goals>
                        <goal>run</goal>
                    </goals>
                    <configuration>
                        <scanIntervalSeconds>0</scanIntervalSeconds>
                        <daemon>true</daemon>
                    </configuration>
                </execution>
                <execution>
                    <id>stop-jetty</id>
                    <phase>prepare-package</phase>
                    <goals>
                        <goal>stop</goal>
                    </goals>
                </execution>
            </executions>

            <configuration>
                <stopPort>8999</stopPort>
                <stopKey>STOP</stopKey>
                <connectors>
                    <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
                        <port>8997</port>
                        <maxIdleTime>3600000</maxIdleTime>
                    </connector>
                </connectors>
                <systemProperties>
                    <systemProperty>
                        <name>dqs.env</name>
                        <value>local</value>
                    </systemProperty>
                </systemProperties>
            </configuration>                
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
                <excludes>
                    <exclude>**/*RunDQSWsTest.java</exclude>
                </excludes>
            </configuration>
            <executions>
                <execution>
                    <id>integration-test</id>
                    <goals>
                        <goal>test</goal>
                    </goals>
                    <phase>integration-test</phase>
                    <configuration>
                        <excludes>
                            <exclude>none</exclude>
                        </excludes>
                        <includes>
                            <include>**/*RunDQSWsTest.java</include>
                        </includes>
                    </configuration>
                </execution>
            </executions>
        </plugin>

RunDQSWsTest.java is the main file which runs all the .feature files

来源:https://stackoverflow.com/questions/17658973/sonar-build-does-not-run-cucumber-tests

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!