I know how to configure batch file to run my TestNG project on local from Jenkins. But how to configure batch file command on Jenkins to run it from Git ?
1 Answer
I think what you are asking is "How do I get Jenkins to trigger a test run and execute my TestNG tests when updates are merged to Git". Is this correct? If not please clarify.
It this is what you are looking for, what you would need to do is set up a Jenkins job that monitors your Git repository. This will show you how to set up polling for a Git repo http://www.andyfrench.info/2015/03/automatically-triggering-jenkins-build.html. Keep in mind you'd also need to configure Jenkins to point to your repo. You can do this through the Source Code Management section in your Jenkins job's configuration.
Once you have polling of your repo set up, you would then configure the Build section of your Jenkins job to kick off your tests. You could do this many ways - its really up to you. For example, if you are set up in a Maven project, you could execute the mvn test command to run your tests. It all depends on how you run your tests normally on your local machine.