Skip to content

← All questions

Reading summary.json in a shell script — which keys are stable?

Example threads. These questions and answers were written by the SDODS team to document real problems and how to fix them. The people named are illustrative, not real users. Questions asked on this site are marked new.

I want the CI job to post totals to Slack without scraping console output. .sdods/runs/<id>/summary.json looks like exactly what I need:

json
{
  "runId": "0180c7d4-9a11-7f02-b3c8-6d10a5e2f477",
  "status": "failed",
  "totals": {
    "total": 20,
    "passed": 18,
    "failed": 1,
    "skipped": 0,
    "timedOut": 0,
    "flaky": 0,
    "healed": 1,
    "durationMs": 9825,
    "workers": 4
  },
  "byProject": { "demo-shop--ui--chromium": { "total": 20, "passed": 18 } }
}

Before I build on it: is this file part of the contract or an implementation detail that is going to move under me? And what is byProject keyed on — I want to split the message per browser.

2 answers

Know the answer?

Wrap commands and output in triple backticks and they will render as a code block.

Checking whether you’re signed in…

Have a different question? Ask it.

Related