I'm using TestNG, Jenkins, and the job-dsl-plugin.
I have a lot of TestNG XML testsuites for the tests in my project. What I want is a script that will go through each of these suites and create a job for them.
My test suites are formatted like this:
<suite name="Name of Suite">
<test name="Name of Test">
<packages>
<package name="package.to.test.*"/>
</packages>
</test>
</suite>
So the job DSL script would have to recursively go through each of the tests in my testsuites directory, grab and parse the XML of these files, and then create a job for each one of them.
- Visit repo
- Recursively read every XML file in testsuites directory
- Grab the name of the suite -> name of Jenkins job
- Grab the path to this testsuite ->
-Dtestngfile=<path>
- Create a job for each of these