Can I run integration tests from Mvn (Failsafe Plugin) against different versions of a branch easily? Can I run integration tests from Mvn (Failsafe Plugin) against different versions of a branch easily? jenkins jenkins

Can I run integration tests from Mvn (Failsafe Plugin) against different versions of a branch easily?


Simply switch branch before executing mvn failsafe:integration-test. This is common pattern.

Maven Failsafe Plugin has no support for switching branches and no support for Version control systems (VCS) - and this is good, because this other plugin responsiblity.

This is easy to switch branch in tools like Jenkins. Create one job per branch, changes to code in branch should trigger jenkins build. Jenkis has support for private maven repositories, this will help with artifact collision. Also is possible to share workspace (results) from first job with second job.

In your case build job pipeline in jenkins, after first job from master execute job from branch to verify integration tests.


The best idea I've seen so far is to do a switch on the version control system and then just to run the integration tests.

Steps

  1. svn co trunk
  2. mvn clean install
  3. svn switch branch
  4. mvn failsafe:integration-test
    • If you run mvn integration-test in this stage you will rebuild the project and you will thus be testing your branch/the older version

I have coded this up and tested it against svn/mvn/jenkins stack