Code Coverage
Integrations that run tests can optionally generate code coverage information, which measures which parts of your codebase are being run by your tests.
Retrieving Code Coverage for an Integration
GET
/integration/{id}/coverage{?include_methods}
Retrieves the Code Coverage information for a given integration. Code Coverage information is stored hierarchically. From top to bottom, an integration contains one or more targets, each target contains files and files contain methods. Each method contains device-specific coverage:
integration ID
target
file
method
device A
device B
…
The default behavior (i.e. /integration/b31ad8317300e89b2db73aad3d0194ad/coverage
) retrieves the entire tree, and is the same as invoking it with include_methods=true
. If include_methods=false
is specified, only target
and file
coverage is returned.
Examples
https://server.mycompany.com:20343/api/integration/b31ad8317300e89b2db73aad3d0194ad/coverage
https://server.mycompany.com:20343/api/integration/b31ad8317300e89b2db73aad3d0194ad/coverage?include_methods=true
https://server.mycompany.com:20343/api/integration/b31ad8317300e89b2db73aad3d0194ad/coverage?include_methods=false
Parameters
id (required)
The integration ID.
Type:
string
Example:
b31ad8317300e89b2db73aad3d0194ad
include_methods (optional)
If
true
, all available coverage data is returned. Iffalse
, onlytarget
andfile
coverage data is returned, excluding file methods.Type:
boolean
Request: /integration/b31ad8317300e89b2db73aad3d0194ad/coverage
Response: 200
Body
{
"trg": {
"Sketch": {
"fls": {
"SKUIController.m": {
"lnpd": 0,
"cnt": 2,
"tte": "SKUIController.m",
"lnp": 50,
"dvcs": [
{
"dvc": "E82BDC1",
"lnp": 50,
"lnpd": 0
}
],
"mth": [
{
"tte": "+[SKUIController fileWithPath:]",
"dvcs": [
{
"dvc": "E82BDC1",
"lnp": 50,
"lnpd": 0
}
],
"lnp": 50,
"lnpd": 0
},
{
"tte": "-[SKUIController initWithPath:]",
"dvcs": [
{
"dvc": "E82BDC1",
"lnp": 75,
"lnpd": 0
}
],
"lnp": 50,
"lnpd": 12
}
]
}
},
"dvcs": [
{
"dvc": "E82BDC1",
"lnp": 50,
"lnpd": 0
}
],
"cnt": 2,
"lnp": 50,
"lnpd": 0
}
},
"dvcs": [
{
"osVersion": "10.11",
"connected": true,
"simulator": false,
"modelCode": "MacBookPro11,3",
"deviceType": "com.apple.mac",
"modelName": "MacBook Pro",
"revision": "3-57fbd763eaee716c31707cd0623c099e",
"modelUTI": "com.apple.macbookpro-15-retina-display",
"name": "XcodeServer Mac",
"trusted": true,
"doc_type": "device",
"supported": true,
"processor": "2.5 GHz Intel Core i7",
"identifier": "676EE417-E15F-50DF-9D20-525B7E3F13CE-x86_64",
"enabledForDevelopment": true,
"serialNumber": "XYZ",
"platformIdentifier": "com.apple.platform.macosx",
"ID": "5764488b58526c86cab94e981d0034ed",
"architecture": "x86_64",
"retina": false,
"isServer": true
}
],
"integrationID": "5764488b58526c86cab94e981d00dac1",
"integrationNumber": 3,
"lnp": 50,
"lnpd": 12
}
Request: /integration/b31ad8317300e89b2db73aad3d0194ad/coverage?include_methods=false
Response: 200
Body
{
"trg": {
"Sketch": {
"fls": {
"SKUIController.m": {
"lnpd": 0,
"cnt": 2,
"tte": "SKUIController.m",
"lnp": 50,
"dvcs": [
{
"dvc": "E82BDC1",
"lnp": 30.45007032348804,
"lnpd": 0
}
]
}
},
"dvcs": [
{
"dvc": "E82BDC1",
"lnp": 60.57347670250897,
"lnpd": 0
}
],
"cnt": 1,
"lnp": 50,
"lnpd": 0
}
},
"dvcs": [
{
"osVersion": "10.11",
"connected": true,
"simulator": false,
"modelCode": "MacBookPro11,3",
"deviceType": "com.apple.mac",
"modelName": "MacBook Pro",
"revision": "3-57fbd763eaee716c31707cd0623c099e",
"modelUTI": "com.apple.macbookpro-15-retina-display",
"name": "XcodeServer Mac",
"trusted": true,
"doc_type": "device",
"supported": true,
"processor": "2.5 GHz Intel Core i7",
"identifier": "676EE417-E15F-50DF-9D20-525B7E3F13CE-x86_64",
"enabledForDevelopment": true,
"serialNumber": "XYZ",
"platformIdentifier": "com.apple.platform.macosx",
"ID": "5764488b58526c86cab94e981d0034ed",
"architecture": "x86_64",
"retina": false,
"isServer": true
}
],
"integrationID": "5764488b58526c86cab94e981d00dac1",
"integrationNumber": 3,
"lnp": 50,
"lnpd": 12
}
Response: 400
Body
{
"status": 400,
"message": "Filter 'foobar' is not supported"
}
Response: 404
Body
{
"status": 404,
"message": "integration not found"
}
Copyright © 2018 Apple Inc. All rights reserved. Terms of Use | Privacy Policy | Updated: 2016-03-21