ScalaTest插件在测试阶段跳过集成测试

时间:2019-02-27 16:16:24

标签: java scala maven scalatest maven-surefire-plugin

我在使用ScalaTest插件分两个阶段执行单元和集成测试时遇到问题。 由于某种原因,我不理解我的集成测试是在测试阶段执行的。

这是我的插件的配置。

  <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.19.1</version>
                <configuration>
                    <argLine>${surefireArgLine}</argLine>
                    <skipTests>${skipTests}</skipTests>
                    <includes>
                        <include>**/*.java</include>
                    </includes>
                    <excludes>
                        <exclude>**/*IT.scala</exclude>
                        <exclude>**/it/*.scala</exclude>
                        <exclude>**/integrationTest/**/*.scala</exclude>
                    </excludes>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.16</version>
                <configuration>
                    <skipITs>${skipITs}</skipITs>
                    <argLine>${testArgLine}</argLine>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.scalatest</groupId>
                <artifactId>scalatest-maven-plugin</artifactId>
                <version>1.0</version>
                <configuration>
                    <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
                    <junitxml>.</junitxml>
                    <filereports>TestSuite.txt</filereports>
                </configuration>
                <executions>
                    <execution>
                        <id>test</id>
                        <goals>
                            <goal>test</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>integration-test</id>
                        <phase>integration-test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

我的集成测试位于it文件夹中,称为OrderIT,因此,如果surefire正确,则应将其排除在外,但仍在运行。

我只是使用mvn clean install,不幸的是,我无法在整个生命周期中使用任何其他maven命令。

有什么主意吗?

0 个答案:

没有答案