Skip to content

Instantly share code, notes, and snippets.

@mvogelgesang
Created May 14, 2024 23:57
Show Gist options
  • Save mvogelgesang/f10f3fd78bd3cd3a681219fd9e1f1c9c to your computer and use it in GitHub Desktop.
Save mvogelgesang/f10f3fd78bd3cd3a681219fd9e1f1c9c to your computer and use it in GitHub Desktop.
Example output when running apex tests with the Salesforce CLI. `sf apex run test --json -w 10 -c`
{
"status": 0,
"result": {
"summary": {
"failRate": "0%",
"failing": 0,
"hostname": "https://java-app-8300-dev-ed.scratch.my.salesforce.com",
"orgId": "00DDE000005EMmV2AW",
"outcome": "Passed",
"passRate": "100%",
"passing": 1,
"skipped": 0,
"testRunId": "707DE00002gPShP",
"testStartTime": "2024-05-14T23:53:51.000Z",
"testsRan": 1,
"userId": "005DE00000L3GQVYA3",
"username": "test-881afjxkrqti@example.com",
"commandTime": "61 ms",
"testExecutionTime": "18 ms",
"testTotalTime": "18 ms",
"orgWideCoverage": "100%",
"testRunCoverage": "100%"
},
"tests": [
{
"Id": "07MDE00000XjqTl2AJ",
"QueueItemId": "709DE000003uk9fYAA",
"StackTrace": null,
"Message": null,
"AsyncApexJobId": "707DE00002gPShPYAW",
"MethodName": "testGetShapeName",
"Outcome": "Pass",
"ApexClass": {
"Id": "01pDE00000zCRzQYAW",
"Name": "FooTest",
"NamespacePrefix": null
},
"RunTime": 18,
"FullName": "FooTest.testGetShapeName"
}
],
"coverage": {
"coverage": [
{
"id": "01pDE00000zCRzPYAW",
"name": "Foo",
"totalLines": 10,
"lines": {
"2": 1,
"6": 1,
"7": 1,
"8": 1,
"9": 1,
"10": 1,
"11": 1,
"12": 1,
"13": 1,
"14": 1
},
"totalCovered": 10,
"coveredPercent": 100
}
],
"records": [
{
"ApexTestClass": {
"Id": "07MDE00000XjqTl2AJ",
"Name": "FooTest"
},
"Coverage": {
"coveredLines": [
2,
6,
7,
8,
9,
10,
11,
12,
13,
14
],
"uncoveredLines": []
},
"TestMethodName": "testGetShapeName",
"NumLinesCovered": 10,
"ApexClassOrTrigger": {
"Id": "01pDE00000zCRzPYAW",
"Name": "Foo"
},
"NumLinesUncovered": 0
}
],
"summary": {
"totalLines": 10,
"coveredLines": 10,
"orgWideCoverage": "100%",
"testRunCoverage": "100%"
}
}
},
"warnings": []
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment