{"_id":"590a04f5ed80861900cbc77a","parentDoc":null,"version":{"_id":"590a04f2ed80861900cbc737","project":"55b2d5baa74a380d00e290c4","__v":4,"createdAt":"2017-05-03T16:27:30.085Z","releaseDate":"2017-05-03T16:27:30.085Z","categories":["590a04f3ed80861900cbc738","590a04f3ed80861900cbc739","590a04f3ed80861900cbc73a","590a04f3ed80861900cbc73b","590a04f3ed80861900cbc73c","590a04f3ed80861900cbc73d","590a04f3ed80861900cbc73e","590a04f3ed80861900cbc73f","590a04f3ed80861900cbc740","590a04f3ed80861900cbc741","590a04f3ed80861900cbc742","590a04f3ed80861900cbc743","590a04f3ed80861900cbc744","590a04f3ed80861900cbc745","590a04f3ed80861900cbc746","590a04f3ed80861900cbc747","590a04f3ed80861900cbc748","590a04f3ed80861900cbc749","590a04f3ed80861900cbc74a","590a04f3ed80861900cbc74b","590a04f3ed80861900cbc74c","590a04f3ed80861900cbc74d","59124949de13f61900336a7a","5914b04e7c2c552d008b7104","5914b47242c6a22300b9dc20"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"7.0.0","version":"7"},"category":{"_id":"590a04f3ed80861900cbc73a","__v":0,"project":"55b2d5baa74a380d00e290c4","version":"590a04f2ed80861900cbc737","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-04-22T20:33:51.487Z","from_sync":false,"order":2,"slug":"rest-api","title":"REST API"},"project":"55b2d5baa74a380d00e290c4","user":"55b2d5626862a10d00887af9","__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-04-15T23:58:52.091Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"name":null,"code":"curl -X GET \\\n    -H 'Authorization: Bearer {{access_token}}' \\\n    'https://api.buddybuild.com/v1/builds/{{build_id}}/coverage'","language":"curl"}]},"method":"get","results":{"codes":[{"name":"","code":"{\n  \"coverage\": 0.75,\n  \"build_id\": \"58b899061baced0100616172\",\n  \"targets\": [\n    {\n      \"name\": \"MyApp.app\",\n      \"coverage\": 0.70\n    },\n    {\n      \"name\": \"Networking.framework\",\n      \"coverage\": 0.80\n    }\n  ]\n}","language":"json","status":200},{"code":"{\n  \"coverage\": 0.75,\n  \"build_id\": \"58b899061baced0100616172\",\n  \"targets\": [\n    {\n      \"name\": \"MyApp.app\",\n      \"coverage\": 0.70,\n      \"files\": [\n        {\n          \"name\": \"Main.swift\",\n          \"coverage\": 0.70\n        }\n      ]\n    }\n  ]\n}","language":"json","name":"showFunctionCoverage=true","status":200},{"status":200,"name":"showFunctionCoverage=true","code":"{\n  \"coverage\": 0.75,\n  \"build_id\": \"58b899061baced0100616172\",\n  \"targets\": [\n    {\n      \"name\": \"MyApp.app\",\n      \"coverage\": 0.70,\n      \"files\": [\n        {\n          \"name\": \"Main.swift\",\n          \"functions\": [\n            {\n              \"name\": \"foo()\",\n              \"coverage\": 0.70\n            }\n          ]\n          \"coverage\": 0.70\n        }\n      ]\n    }\n  ]\n}","language":"json"}]},"settings":"","auth":"required","params":[{"_id":"573a9b857f35072900c85261","ref":"","in":"path","required":true,"desc":"Build identifier","default":"","type":"string","name":"build_id"},{"_id":"58f2b3bcf7f9280f00775492","ref":"","in":"query","required":false,"desc":"Show code coverage for each file","default":"false","type":"boolean","name":"showFileCoverage"},{"_id":"58f2b3bcf7f9280f00775491","ref":"","in":"query","required":false,"desc":"Show code coverage for each function","default":"false","type":"boolean","name":"showFunctionCoverage"}],"url":"/builds/:build_id/coverage"},"isReference":true,"order":7,"body":"Use this method to show code coverage for a build with a specified `build_id`.\n\nCode coverage for each target is reported separately. The top-level code coverage is the average of each target's code coverage.\n\nAdd `showFileCoverage=true` to list code coverage for each file in the response.\n\nAdd `showFunctionCoverage=true` to list code coverage for each function in the response. This parameter implies `showFileCoverage=true`.\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"Read more about [authenticating with buddybuild](http://docs.buddybuild.com/docs/api-developer-guide#authentication) or show <a href=\\\"https://dashboard.buddybuild.com/account/access-token\\\" target=\\\"_blank\\\">your personal access token</a>.\",\n  \"title\": \"Looking for your API access token?\"\n}\n[/block]","excerpt":"","slug":"show-code-coverage","type":"get","title":"Show code coverage"}

getShow code coverage


Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

build_id:
required
string
Build identifier

Query Params

showFileCoverage:
booleanfalse
Show code coverage for each file
showFunctionCoverage:
booleanfalse
Show code coverage for each function

Examples


Result Format


Documentation

Use this method to show code coverage for a build with a specified `build_id`. Code coverage for each target is reported separately. The top-level code coverage is the average of each target's code coverage. Add `showFileCoverage=true` to list code coverage for each file in the response. Add `showFunctionCoverage=true` to list code coverage for each function in the response. This parameter implies `showFileCoverage=true`. [block:callout] { "type": "info", "body": "Read more about [authenticating with buddybuild](http://docs.buddybuild.com/docs/api-developer-guide#authentication) or show <a href=\"https://dashboard.buddybuild.com/account/access-token\" target=\"_blank\">your personal access token</a>.", "title": "Looking for your API access token?" } [/block]

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}