JSON report#

A JSON report of a test session can be generated after the session has completed:

$ canary run ./basic
...
$ canary report json create
INFO: JSON report written to canary.json
$ cat canary.json
{
  "4b172fcef2eb368584aeec8abc4f7409dda7c131d4bd5a1d99d79af9726619cc": {
    "status": {
      "category": "PASS",
      "outcome": 0,
      "reason": "",
      "code": 0
    },
    "state": {
      "phase": "DONE"
    },
    "measurements": {
      "data": {
        "command_line": "/home/docs/checkouts/readthedocs.org/user_builds/canary-wm/envs/latest/bin/python first.pyt",
        "duration": 0.3022756576538086,
        "samples": 4,
        "cpu_percent": {
          "min": 0.0,
          "max": 99.6,
          "ave": 57.224999999999994
        },
        "memory_rss_mb": {
          "min": 0.0,
          "max": 33.921875,
          "ave": 13.7939453125
        },
        "memory_vms_mb": {
          "min": 0.0,
          "max": 39.9296875,
          "ave": 18.328125
        },
        "num_threads": {
          "min": 1,
          "max": 1,
          "ave": 1.0
        }
      }
    },
    "timekeeper": {
      "submitted": 1784346709.4368267,
      "started": 1784346709.441592,
      "finished": 1784346709.7510974,
      "mark": -1.0
    },
    "spec": {
      "file_root": "/home/docs/checkouts/readthedocs.org/user_builds/canary-wm/checkouts/latest/src/canary/examples/basic",
      "file_path": "first/first.pyt",
      "id": "4b172fcef2eb368584aeec8abc4f7409dda7c131d4bd5a1d99d79af9726619cc",
      "family": "first",
      "stdout": "canary-out.txt",
      "stderr": null,
      "dependencies": [],
      "parameters": {},
      "attributes": {},
      "keywords": [
        "basic"
      ],
      "assets": [],
      "baseline": [],
      "artifacts": [
        {
          "pattern": "testcase.lock",
          "when": "always"
        },
        {
          "pattern": "canary-out.txt",
          "when": "always"
        }
      ],
      "exclusive": false,
      "timeout": 300.0,
      "xstatus": 0,
      "preload": null,
      "modules": [],
      "rcfiles": [],
      "owners": [],
      "environment": {},
      "meta_parameters": {
        "runtime": 300.0
      },
      "command": [
        "/home/docs/checkouts/readthedocs.org/user_builds/canary-wm/envs/latest/bin/python",
        "first.pyt"
      ],
      "mask": {
        "value": false,
        "reason": null
      },
      "exec_path": "first/first",
      "view_path": "first/first"
    },
    "workspace": {
      "root": "/home/docs/checkouts/readthedocs.org/user_builds/canary-wm/checkouts/latest/src/canary/examples/.canary/sessions/2026-07-18T03-51-49.102526",
      "path": "first/first",
      "session": "2026-07-18T03-51-49.102526"
    },
    "dependencies": [],
    "variables": {
      "PYTHONPATH": "/home/docs/checkouts/readthedocs.org/user_builds/canary-wm/checkouts/latest/src/canary/examples/.canary/sessions/2026-07-18T03-51-49.102526/first/first:",
      "PATH": "/home/docs/checkouts/readthedocs.org/user_builds/canary-wm/checkouts/latest/src/canary/examples/.canary/sessions/2026-07-18T03-51-49.102526/first/first:/home/docs/checkouts/readthedocs.org/user_builds/canary-wm/envs/latest/bin:/home/docs/.asdf/shims:/home/docs/.asdf/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
    },
    "allocation": {
      "metadata": {},
      "resources": {},
      "state": "inactive"
    },
    "rparameters": {
      "cpus": 1,
      "gpus": 0,
      "nodes": 1
    },
    "mask": null
  },
  "b1f18b409e6d4e06a34c9601f7ba4dbb3f96c16647aa20bdc736dfd9378f678d": {
    "status": {
      "category": "PASS",
      "outcome": 0,
      "reason": "",
      "code": 0
    },
    "state": {
      "phase": "DONE"
    },
    "measurements": {
      "data": {
        "command_line": "/home/docs/checkouts/readthedocs.org/user_builds/canary-wm/envs/latest/bin/python second.pyt",
        "duration": 0.3021516799926758,
        "samples": 4,
        "cpu_percent": {
          "min": 0.0,
          "max": 99.5,
          "ave": 59.724999999999994
        },
        "memory_rss_mb": {
          "min": 0.0,
          "max": 34.19921875,
          "ave": 13.8955078125
        },
        "memory_vms_mb": {
          "min": 0.0,
          "max": 39.921875,
          "ave": 18.330078125
        },
        "num_threads": {
          "min": 1,
          "max": 1,
          "ave": 1.0
        }
      }
    },
    "timekeeper": {
      "submitted": 1784346709.8007374,
      "started": 1784346709.806044,
      "finished": 1784346710.1165323,
      "mark": -1.0
    },
    "spec": {
      "file_root": "/home/docs/checkouts/readthedocs.org/user_builds/canary-wm/checkouts/latest/src/canary/examples/basic",
      "file_path": "second/second.pyt",
      "id": "b1f18b409e6d4e06a34c9601f7ba4dbb3f96c16647aa20bdc736dfd9378f678d",
      "family": "second",
      "stdout": "canary-out.txt",
      "stderr": null,
      "dependencies": [],
      "parameters": {},
      "attributes": {},
      "keywords": [
        "basic",
        "second"
      ],
      "assets": [
        {
          "src": "/home/docs/checkouts/readthedocs.org/user_builds/canary-wm/checkouts/latest/src/canary/examples/basic/second/add.py",
          "dst": null,
          "action": "link"
        }
      ],
      "baseline": [],
      "artifacts": [
        {
          "pattern": "testcase.lock",
          "when": "always"
        },
        {
          "pattern": "canary-out.txt",
          "when": "always"
        }
      ],
      "exclusive": false,
      "timeout": 300.0,
      "xstatus": 0,
      "preload": null,
      "modules": [],
      "rcfiles": [],
      "owners": [],
      "environment": {},
      "meta_parameters": {
        "runtime": 300.0
      },
      "command": [
        "/home/docs/checkouts/readthedocs.org/user_builds/canary-wm/envs/latest/bin/python",
        "second.pyt"
      ],
      "mask": {
        "value": false,
        "reason": null
      },
      "exec_path": "second/second",
      "view_path": "second/second"
    },
    "workspace": {
      "root": "/home/docs/checkouts/readthedocs.org/user_builds/canary-wm/checkouts/latest/src/canary/examples/.canary/sessions/2026-07-18T03-51-49.102526",
      "path": "second/second",
      "session": "2026-07-18T03-51-49.102526"
    },
    "dependencies": [],
    "variables": {
      "PYTHONPATH": "/home/docs/checkouts/readthedocs.org/user_builds/canary-wm/checkouts/latest/src/canary/examples/.canary/sessions/2026-07-18T03-51-49.102526/second/second:",
      "PATH": "/home/docs/checkouts/readthedocs.org/user_builds/canary-wm/checkouts/latest/src/canary/examples/.canary/sessions/2026-07-18T03-51-49.102526/second/second:/home/docs/checkouts/readthedocs.org/user_builds/canary-wm/envs/latest/bin:/home/docs/.asdf/shims:/home/docs/.asdf/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
    },
    "allocation": {
      "metadata": {},
      "resources": {},
      "state": "inactive"
    },
    "rparameters": {
      "cpus": 1,
      "gpus": 0,
      "nodes": 1
    },
    "mask": null
  }
}