Questions tagged [maven-failsafe-plugin]

The Maven Failsafe Plugin is used to run integration tests with Maven build tools.

The Maven Failsafe Plugin is designed to run integration tests while the Surefire Plugin is designed to run unit tests. The name (failsafe) was chosen both because it is a synonym of surefire and because it implies that when it fails, it does so in a safe way.

This plugin is strictly linked to the following Maven phases: integration-test, verify. However, during its usage, the pre-integration-test and post-integration-test phases are also often used (i.e. set-up and tear-down of an embedded web server).

Check the official usage page for a first look at this plugin.

375 questions
6
votes
1 answer

Maven failsafe plugin doesn't run parallel Test

I have a Maven POM file and when I provide parallel execution options, I dont see any signs of parallel execution in the logs. And XML debugging is driving me nuts. Any thoughts what is wrong here?
SuperMan
  • 3,532
  • 12
  • 45
  • 49
6
votes
2 answers

maven-failsafe-plugin won't run on verify and does not find xml on failsafe:verify

The Maven failsafe plugin will not run on my project. If I run mvn verify only surefire runs. If I type mvn failsafe:verify it fails with the following error: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.11:verify…
user2368505
  • 416
  • 3
  • 16
6
votes
2 answers

Error during Failsafe integration test does not cause failed Maven build

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…
eldoctoro
  • 893
  • 2
  • 10
  • 15
5
votes
1 answer

Netbeans - run specific Maven integration test

How can I configure Netbeans to call Maven Failsafe to run a specific integration test? I know the Maven command to do this is 'mvn -Dit.test=MyClassIT verify' I also know how to configure 'actions' in Netbeans Project properties. My problems…
Aleksandr Dubinsky
  • 22,436
  • 15
  • 82
  • 99
5
votes
1 answer

Maven is not using failsafe plugin for integration tests

When I run mvn clean install, for the integration-test phase it does not use the failsafe plugin. However if i explicilty call the plugin to run the integration test, it works (mvn failsafe:integration-test). How can I make maven use the failsafe…
Sujen
  • 1,614
  • 5
  • 19
  • 25
5
votes
3 answers

Killing self fork JVM. PING timeout elapsed

EDIT: I just wanted to clarify that, in the interest of asking a question that has a known, objective answer, this question is, What does "Killing self fork JVM. PING timeout elapsed" actually mean, e.g. what is pinging what, and why failsafe decide…
Jason Young
  • 439
  • 1
  • 8
  • 18
5
votes
0 answers

How to run a mix of JUnit 4 and JUnit 5 tests in parallel using maven-failsafe-plugin

I am trying to run parallel integration tests in mix JUnit 4 and JUnit 5 using Junit Jupiter and Junit Vintage packages as well as adding a surefire plugin for junit 5 in dependencies for latest maven-failsafe-plugin.
Ran Koretzki
  • 464
  • 3
  • 15
5
votes
3 answers

Remove (duplicate) failed TestNG result via test listener

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…
mac
  • 2,672
  • 4
  • 31
  • 43
5
votes
2 answers

Maven running jetty on integration-test stage

I use failsafe plugin. So when I type mvn failsafe:integration-test it stars my integration tests (which is great). But I want my jetty server starts on pre-integration stage then. What should I do? (I don't want launch mvn verify since it involves…
ses
  • 13,174
  • 31
  • 123
  • 226
5
votes
4 answers

Can surefire and failsafe plugin deliberately randomize execution order of test classes?

It appears that surefire and failsafe plugins execute test classes in order while tests defined within a class execute in undetermined order. To discover tests which rely on order (what we consider bad tests) we want to force the order to be…
Peter Kahn
  • 12,364
  • 20
  • 77
  • 135
5
votes
1 answer

How to run non-Java tests within maven-failsafe?

I am building a webapp project using Maven, using maven-failsafe-plugin for my integration tests. A cargo Glassfish3x container is started bound to the pre-integration-test phase, and stopped as part of the post-integration-test phase. However, my…
4
votes
2 answers

Running JUnit 4 Tests Parallel With FailSafe & SureFire plugins

We have a profile created in maven to run our Selenium junit4 type tests and below is the snippet of it without the executions tag. selenium-tests
raksja
  • 3,969
  • 5
  • 38
  • 44
4
votes
1 answer

How to run maven integration tests on shaded artifact?

I have a simple goal: I want to be able to use the maven-failsafe-plugin, or any viable alternative, to run tests against a jar I'm building with the maven-shade-plugin. Specifically, I want to run the tests after shade runs because I want an…
4
votes
2 answers

Spring boot failsafe integration tests - Failed to find merged annotation after upgrade to 2.4.2

after upgrading to Spring Boot 2.4.2 (Spring 5.3.3) our Spring Context tests broke: lut 15, 2021 4:37:49 PM org.junit.jupiter.engine.execution.JupiterEngineExecutionContext close SEVERE: Caught exception while closing extension context:…
MGorgon
  • 2,547
  • 23
  • 41
4
votes
0 answers

maven jacoco not generating code coverage for Integration tests

I have a multi-module java spring boot project. Here is my project structure - pom.xml (root) - war (project) --- pom.xml --- src/.../SBMainApplication.java - api (project) --- pom.xml --- src/../Controller1.java --- test/unit/ ---…