This is a simple Python3 Script to get Apex Test Coverage from Salesforce deployment ID.
Just got the inspiration from How to get accurate code coverage from Metadata API.
The code will get the deployment ID(also known as asyncId) from the log file. So you need to generage a log file named "log.txt" during your salesforce running test task through ant and Salesforce Force.com Migration Tool.
An easy way is to add a record in the ant task.
And once you have the log.txt, you can just get the code coverage by this script. The script need three parameters:
- Salesforce username
- Salesforce password
- Salesforce security token
Thanks for: