maven-failsafe-plugin

maven-failsafe-plugin Failures and BUILD SUCCESS?

北战南征 提交于 2019-12-30 16:51:12
问题 I want to use maven-failsafe-plugin to run some integration tests. If any test fails, I want Maven to fail the build and not BUILD SUCCESS. Tests run: 103, Failures: 1, Errors: 0, Skipped: 26 [INFO] BUILD SUCCESS* how can I configure it, that build not success is? My failsafe plugin is configured as: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-failsafe-plugin</artifactId> <version>${failsafe.version}</version> <configuration> <systemProperties> <CI_INTEGRATION

Maven deploy multiple wars to embedded server for integration tests

笑着哭i 提交于 2019-12-30 06:12:25
问题 I have had no issue running a maven war project on an embedded server for its own integration tests, but now I need to run multiple wars and test from a different project. I would like to setup the following scenario... I have two Maven war projects in my local workspace called War1 and War2. I would like to have a 3rd Maven project, WarIntegration, that contains only integration tests and does the following: Packages War1 Packages War2 Starts an embedded server Deploys both wars to same

What is the difference between the Maven Surefire and Maven Failsafe plugins?

南楼画角 提交于 2019-12-29 11:30:42
问题 What is the difference between Maven Surefire and Maven Failsafe plugins? I have searched all over web, but did not get the answer. 回答1: In simple words, the Failsafe plugin is designed to run integration tests while Surefire to run unit tests . This is further explained in Maven FAQ: maven-surefire-plugin is designed for running unit tests and if any of the tests fail then it will fail the build immediately. maven-failsafe-plugin is designed for running integration tests , and decouples

Error during Failsafe integration test does not cause failed Maven build

社会主义新天地 提交于 2019-12-23 13:11:11
问题 I have Failsafe running a Selenium integration test. If one of my assertions in the test does not pass and the test fails, then the Maven build will fail as expected. However, if the test errors, the build finishes unexpectedly as a success (output below) Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 14.075 sec <<< FAILURE! Results : Tests in error: test(uk.co.ned24.ExpandedIT) Tests run: 1, Failures: 0, Errors: 1, Skipped: 0 [INFO] ------------------------------------------

How can I run integration tests after building all modules in a multi-module Maven project?

一世执手 提交于 2019-12-23 12:24:21
问题 I am working on a large multi-module Maven project. Each module has fast unit tests (using the Surefire plugin), many modules have slow integration tests (using the Failsafe plugin). I would like to speed up the feedback for "simple" build failures (compilation errors and unit test failures) by running integration tests from all modules after all modules have been built and unit-tested. Can you suggest a good way of achieving this? 回答1: running integration tests from all modules after all

Problem running tests with enabled preview features in surefire and failsafe

℡╲_俬逩灬. 提交于 2019-12-22 04:14:11
问题 I'm trying to migrate a project to Java 12, with --enable-preview . I added --enable-preview in compiler settings: <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.0</version> <configuration> <release>12</release> <compilerArgs> <arg>--enable-preview</arg> </compilerArgs> </configuration> </plugin> And also added it in argLine for surefire and failsafe: <properties> <argLine>--enable-preview</argLine> </properties> And do a mvn clean verify results in: [ERROR] Failed to

How do I run JUnit 5 integration tests with the Maven Failsafe plugin?

和自甴很熟 提交于 2019-12-22 02:04:10
问题 The Maven Failsafe plugin won't find my JUnit 5 integration tests when I'm running the command mvn clean failsafe:integration-test , although it can find the files. I have the junit-jupiter-api and junit-jupiter-engine as test dependencies: <properties> <junit.jupiter.version>5.0.1</junit.jupiter.version> </properties> <dependencies> <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-api</artifactId> <version>${junit.jupiter.version}</version> <scope>test</scope> <

How to run TestNG suite with failsafe without unpacking dependency jar?

喜欢而已 提交于 2019-12-21 21:32:58
问题 I'd like to execute integration tests using a TestNG suite file which is contained in a dependency jar. The details of setting up the pom.xml are discussed here Here's the pom file I currently have. The problem is with the part where I need to define a suite file: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven

Running a JUnit4 Test Suite in Maven using maven-failsafe-plugin

 ̄綄美尐妖づ 提交于 2019-12-21 01:57:31
问题 I've got a JUnit 4 test suite that contains a number of test classes in the order they need to be run (our Integration tests need to be run in a certain order). If I use the maven-failsafe-plugin without any configuration it will run the test but not in the correct order. However, If I set the plugin to run the test suite no tests are run. Is it possible to run a test suite using the failsafe plugin? if so, where have I gone wrong!! The code is below: @RunWith(Suite.class) @SuiteClasses({

Remove (duplicate) failed TestNG result via test listener

扶醉桌前 提交于 2019-12-18 06:16:30
问题 Similar to the solution posted here TestNG retrying failed tests doesn't output the correct test results, I'm trying to remove a (duplicate) test result using a test listener during onFinish(ITestContext context). Although the removal of the result with context.getFailedTests().removeResult(result) appears to work fine (the result actually is removed), there seems to be "some other spot" where the results are being pulled from cause the build still fails. Also note that when I run the sample