Our automated QA test cases are scheduled and executed by Jenkins. I have to run the test cases on different environments say UAT , STAGE and PROD (as they have different test data) and these test cases are 'grouped' as SANITY , REGRESSION and BATS. I'm using maven + testNG (surefire plugin) to build and execute it .
Now I need to run this as jobs in Jenkins as 'BATS in STAGE' or say 'REGRESSION in DEV' etc. For this , I thought best approach would be, in Jenkins jobs confis, call something like ..
mvn test -Denv=STAGE -Dgroup=SANITY
Other option is setting the params ( env and group) in system variables of Jenkins and go from there.
But I'm facing some major blocks as raised in a different post here ..
How to pass java code a parameter from maven for testing
This looks like a common requirement , has anyone addressed this before ? Is my approach correct, any better way of doing it ?
Please suggest.