lundi 27 novembre 2017

Automatize test build process with maven

We have a Java Web Project running on Tomcat 7 and we use Maven as our build tool. In our actual test process we need to do some manual steps to build our project for test environment:

  1. Checkout git branch with the code to test.
  2. With maven, use the production profile to create the war file running mvn clean package -P production.
  3. Access our local PC where the war file will be deployed http://ift.tt/2jpHwZH using a web browser.
  4. Upload the war file generated by maven and wait for deploy finishes.
  5. Our tester start the testing
  6. If any problem is found, we fix it and repeat the process until the test is successful

What we would like to achieve is a minimum manual process as possible, with for example running a command like mvn deployTest -DtestId=SC-1550 will do the following steps:

  1. Run unit tests
  2. Run integration tests
  3. Build the war file on production profile
  4. Use the parameter "testId" as the war file name, so our tester will access https://localhost:8443/TESTID and start the testing. In that way, we can have multiple features ready for testing, just need to access the correct address with the test issue ID.
  5. The war file is deployed to Tomcat 7 using the maven-tomcat7 plugin in the specific IP address of our test machine
  6. The environment is ready for testing with the new feature.
  7. If any problem is found, we commit the fix on our git and again, run the maven command mvn deployTest -DtestId=SC-1550

Doing so, we substitute a mostly manual process to a single command, speeding up our testing.

My question is if there is a way to automatize this process by configuring the pom file, or using a plugin or even implementing our own plugin to do this steps with a single command.

Aucun commentaire:

Enregistrer un commentaire