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
3
votes
0 answers

Maven plus Spring Boot plus Multi Module failsafe Integrated Testing

I have a Spring Boot multi-module project that meets all of the requirements except Integration testing. The unit tests, defined in src/test work fine in surefire as part of the test phase. Multiple hours of experimenting with failsafe have not…
3
votes
1 answer

Make Maven Failsafe exit with non-zero status when tests fail?

How can the Maven Failsafe plug-in be made to exit with a non-zero exit status if any test fails? By default it seems to exit with a zero exit status no matter if tests succeeded or failed. This is a problem when running integration tests from an…
Markus Miller
  • 3,695
  • 2
  • 29
  • 33
3
votes
2 answers

Using maven-failsafe with fabric8-maven to run integration tests that hit a containerised DB

I'm struggling to synthesise how to correctly use the maven-failsafe and fabric8-maven plugins together. I Want to run integration tests, but in the pre-integration-tests phase, start a docker container running a DB, and in the…
neuronotic
  • 487
  • 7
  • 18
3
votes
2 answers

Skip Build failure in maven if the integration test fails

I want to skip the build failure even if the integration test fails. I am using maven-failsafe for Integration test. I am currently getting the following: Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.15:verify (default)…
Jeel
  • 2,227
  • 5
  • 23
  • 38
3
votes
0 answers

Running integration tests remotely with maven

How can I run integration tests on an environment other than the one I'm building (running maven) from? I suppose I should use the failsafe plugin, but how would it find the artifact remotely, run the tests and return results? Specifically: I want…
Victor Basso
  • 5,556
  • 5
  • 42
  • 60
3
votes
0 answers

Selenium test coverage in jacoco report 0%

I am trying to get tests runnning with maven failsafe to show up in thwe jacoco report, I have split the unit and integration tests and all my tests pass and the verify runs fine. I get a created integration test report in my target directory and…
3
votes
0 answers

Run integration tests in Vagrant with Maven

I am working on augmenting a test framework that uses Maven. Due to the nature of the code being tested, it is necessary to run tests in VMs. We are currently doing this in a sort of hack-ish way by running shell scripts that SSH into the VMs via…
3
votes
1 answer

How can I view integration tests in the Netbeans Test Results?

My development environment is Netbeans 7.4 and Maven 3.0.5 (bundled with Netbeans). I'm using JUnit 4.11 to build unit (class names ending with Test) and integration tests (class names ending with IT). I'm running unit tests and excluding…
rarchibald
  • 220
  • 4
  • 9
3
votes
1 answer

run integration tests from maven failsafe plugin for a profile when I set a parameter from command line such as -DrunIT=true

I am using maven 3.0.4 . I want the failsafe and jetty plugin to run (run only integration tests) only when I set some property in executing maven command for example mvn verify -Pstage -DrunIT=true My stage profile in pom looks like…
3
votes
1 answer

Maven failsafe plugin in multi module project

I am working on a maven based project. Project has multiple modules. Here is the project structure -- Project --Module1 -- pom.xml --Module2 -- pom.xml --Module3-war -- pom.xml --parent module --pom.xml Parent…
3
votes
2 answers

cargo-maven2-plugin does not wait for jboss as7 to start before executing integration tests

I have not been able to get a successful Maven pom.xml configuration to start JBoss AS 7, deploy a war artifact, and have it wait until the artifact has been successfully deployed before starting to run integration tests. I've already…
Chris Phillipson
  • 795
  • 1
  • 15
  • 34
3
votes
1 answer

Is "mvn install" supposed to fail when an integration test does?

I have a maven project that has an integration test named, say, "BlahITCase". This test is currently failing and in turn causing "mvn install" to fail. Is this the expected behavior? My understanding was that unit test (surefire) failures will cause…
Patrick Marchwiak
  • 1,072
  • 2
  • 11
  • 24
3
votes
1 answer

Maven failsafe plugin does not run testNG XML suite

I'm using maven to run my integration tests which are in a TestNG suite. When running the suite under eclipse- my test suite runs successfully. When running "mvn verify" to run my integration tests, I see the failsafe plugin configurations debug…
Omri
  • 1,058
  • 3
  • 14
  • 26
2
votes
2 answers

Testing content in POMs for multi-module Maven project

I have read here about unit testing with the Surefire plugin and integration testing with the Failsafe plugin, but I am still unclear about how the POMs should look in a Maven project that consists of a parent and multiple child modules, each with…
2
votes
1 answer

I have a multi-module Maven 2 POM that has two WARs, how can I configure it to deploy both wars prior to running tests?

Roughly, I have (say) project A, pom packaging, that have two module M1 and M2 (say) each of which have war packaging. M2 has integration tests, but the M2 war makes service calls to the war of M1. This should really: Load same data into the…
Alex Collins
  • 980
  • 11
  • 23