黄瓜测试失败后 Maven 构建成功
Maven build succeeds after cucumber test fails
我的 Cucumber 测试失败了。在此之后我怀疑我的 maven 构建失败了,但这仍然成功。
我为 运行 我的 cucumbertests 创建了一个单独的 cucumbertest 配置文件。
这是我的项目 POM 的(部分)。
<profile>
<id>cucumbertest</id>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${version.surefire.plugin}</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${version.failsafe.plugin}</version>
<configuration>
<includes>
<!-- only run Functional tests with this profile -->
<include>**/cucumber/*FT.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
我也试过各种配置,比如
<profile>
<id>cucumbertest</id>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${version.surefire.plugin}</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${version.failsafe.plugin}</version>
<dependencies>
<dependency>
<groupId>org.apache.Maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>2.19.1</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>integration-tests</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<skip>false</skip>
<includes>
<!-- only run Functional tests with this profile -->
<include>**/cucumber/*FT.java</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
但其中 none 似乎有效。
终于知道我做错了什么了
我执行了以下 mvn 调用:mvn integration-test -Pcucumbertest ...
结果是执行了黄瓜测试,但未验证。
mvn verivy -Pcucumbertest
完成任务。
我的 Cucumber 测试失败了。在此之后我怀疑我的 maven 构建失败了,但这仍然成功。
我为 运行 我的 cucumbertests 创建了一个单独的 cucumbertest 配置文件。 这是我的项目 POM 的(部分)。
<profile>
<id>cucumbertest</id>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${version.surefire.plugin}</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${version.failsafe.plugin}</version>
<configuration>
<includes>
<!-- only run Functional tests with this profile -->
<include>**/cucumber/*FT.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
我也试过各种配置,比如
<profile>
<id>cucumbertest</id>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${version.surefire.plugin}</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${version.failsafe.plugin}</version>
<dependencies>
<dependency>
<groupId>org.apache.Maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>2.19.1</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>integration-tests</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<skip>false</skip>
<includes>
<!-- only run Functional tests with this profile -->
<include>**/cucumber/*FT.java</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
但其中 none 似乎有效。
终于知道我做错了什么了
我执行了以下 mvn 调用:mvn integration-test -Pcucumbertest ...
结果是执行了黄瓜测试,但未验证。
mvn verivy -Pcucumbertest
完成任务。