java - Running Jenkins integration test without having to rebuild with Maven -
im having problems understanding how jenkins interact maven create simple build pipleines. example lets want following pipeline:
1 compile code, run unittest, , package code. 2 deploy application test server. 3 run integration tests.
this translate to:
1 mvh clean install 2 deploy.sh 3 mvn verify
for unittests use surefire , integration test use failsafe. problem mvn verify
whole build process on again. want run integration tests , not steps leading verify. standard way of solving problem?
the maven way of doing using maven. default maven build lifecycle has phase each of steps want do: https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
for example, default lifecycle comprises of following phases (for complete list of lifecycle phases, refer lifecycle reference):
validate - validate project correct , necessary information available
compile - compile source code of project
test - test compiled source code using suitable unit testing framework. these tests should not require code packaged or deployed
package - take compiled code , package in distributable format, such jar.
integration-test - process , deploy package if necessary environment integration tests can run
verify - run checks verify package valid , meets quality criteria
install - install package local repository, use dependency in other projects locally
deploy - done in integration or release environment, copies final package remote repository sharing other developers , projects.
so want deploy artifacts test server (your step 2) part of integration-test phase. have run
mvn clean install
this clean , building, running unit tests, packaging up, deploy integration environment, run integration tests , install artifacts in local repository.
Comments
Post a Comment