I'm using jenkins as CI tool. I used restful api to build a job remotely but I don't know how to get test result remotely as well. I can't be more thankful if anybody know a solution
Use the XML or Json API. At most pages on Jenkins you can add /api/
to the url and get data in xml, json and similar formats. So for a job you can go to <Jenkins URL>/job/<Job Name>/api/xml
and get informaiton about the job, builds, etc. For a build you can go to <Jenkins URL>/job/<Job Name>/<build number>/api/xml
and you will get a summary for the build. Note that you can use the latestXXXBuild
in order to get the latest successful, stable, failing, complete build, like this; <Jenkins URL>/job/<Job Name>/lastCompletedBuild/api/xml
.
Additionally if youre using any plugin which publishes test results to the build, then for a given job you can go to <Jenkins URL>/job/<Job Name>/lastCompletedBuild/testReport/api/xml
and you will get an xml report with results.
There is a lot more to it, you can control what is exported with the tree
parameter and depth
parameter. For a summary go to <Jenkins URL>/api/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With